Opened 3 years ago

Closed 22 months ago

#1374 closed defect (fixed)

when you open a file that is not in a Padre Session or Perl project

Reported by: bowtie Owned by: adamk
Priority: major Milestone:
Component: editor Version: 0.95
Keywords: Cc:

Description

It's just annoying that you can not open stray files.

Use of uninitialized value $chd in concatenation (.) or string at /usr/src/Padre/Padre/lib/Padre/Wx/Directory.pm line 586.
Something is wrong as one of the directory objects is undef (position=31, child=Wx::TreeItemId=SCALAR(0xe11f588), chd=) at /usr/src/Padre/Padre/lib/Padre/Wx/Directory.pm line 586.

Change History (15)

comment:1 Changed 3 years ago by bowtie

  • Version changed from 0.92 to 0.93

comment:2 Changed 3 years ago by bowtie

following on from http://irclog.perlgeek.de/padre/2012-01-12#i_4974159

tweak to /Padre/lib/Padre/Wx/Directory.pm

starting around line 568

    # Mix the returned files into the existing entries.
    # If there aren't any existing entries, this shortcuts quite nicely.
    my ( $child, $cookie ) = $tree->GetFirstChild($cursor);
    print 'Dumper( $child, $cookie );'."\n";
    print Dumper( $child, $cookie );
    my $position = 0;
    while (@_) {
        if ( $child->IsOk ) {

            # Are we before, after, or a duplicate
            $Data::Dumper::Pair = " : ";
            print 'Dumper( $tree->GetPlData($child) );'."\n";
            print Dumper( $tree->GetPlData($child) );
            my $chd = $tree->GetPlData($child);
            if ( not defined $_[0] or not defined $chd ) {

On load of none-project file, and we get the following

Dumper( $child, $cookie );
$VAR1 = bless( do{\(my $o = 182067312)}, 'Wx::TreeItemId' );
$VAR2 = 1;
Dumper( $tree->GetPlData($child) );
$VAR1 = bless( [
                 1,
                 'data',
                 'data'
               ], 'Padre::Wx::Directory::Path' );
Dumper( $tree->GetPlData($child) );
$VAR1 = bless( [
                 0,
                 '0.21_02.png',
                 '0.21_02.png'
               ], 'Padre::Wx::Directory::Path' );
Dumper( $tree->GetPlData($child) );
$VAR1 = bless( [
                 0,
                 '0.21_02.png',
                 '0.21_02.png'
               ], 'Padre::Wx::Directory::Path' );
Dumper( $tree->GetPlData($child) );
$VAR1 = bless( [
                 0,
                 '0.21_02.png',
                 '0.21_02.png'
               ], 'Padre::Wx::Directory::Path' );
Dumper( $tree->GetPlData($child) );
$VAR1 = undef;

Use of uninitialized value $chd in concatenation (.) or string at 
/usr/src/Padre/Padre/lib/Padre/Wx/Directory.pm line 587.

Something is wrong as one of the directory objects is undef 
(position=2, child=Wx::TreeItemId=SCALAR(0xae01ca0), chd=) at 
/usr/src/Padre/Padre/lib/Padre/Wx/Directory.pm line 587.

Dumper( $child, $cookie );
$VAR1 = bless( do{\(my $o = 177831576)}, 'Wx::TreeItemId' );
$VAR2 = 0;
Dumper( $child, $cookie );
$VAR1 = bless( do{\(my $o = 190727224)}, 'Wx::TreeItemId' );
$VAR2 = 0;

comment:3 Changed 3 years ago by bowtie

  • Owner set to alias, adamk
  • Status changed from new to assigned

comment:4 Changed 3 years ago by adamk

What I don't understand here is how you could end up with a tree node that has undef.

Try dumping the label text of the item as well, so you can identify which specific file it was that caused the problem. Maybe there's something about that specific file.

comment:5 Changed 3 years ago by adamk

  • Owner changed from alias, adamk to adamk
  • Status changed from assigned to accepted

I've improved the error handling code when this occurs, so it will disable the directory tree and prevent further errors. Reducing this from blocker to critical since it should no longer crash Padre.

comment:6 Changed 3 years ago by adamk

  • Priority changed from blocker to critical

comment:7 Changed 3 years ago by bowtie

O, re-tested and got a Padre crash again (on two mc's)

Use of uninitialized value $chd in concatenation (.) or string at 
/usr/src/Padre/Padre/lib/Padre/Wx/Directory.pm line 581.

Something is wrong as one of the directory objects is undef 
(position=34, child=Wx::TreeItemId=SCALAR(0xeb28898), chd=) at 
/usr/src/Padre/Padre/lib/Padre/Wx/Directory.pm line 581.

are you sure this not critical?

comment:8 Changed 3 years ago by bowtie

Your right it is different!,
now it's not consistent,

Sometimes when recent files are opened containing a an orphan (ie not part of project) padre dose not die.

Is Inconsistency a move in the right direction?

but most of the time opening a file dose try ~/*rc files for example (when you have a project/session open)

comment:9 Changed 2 years ago by bowtie

Can't locate object method "GetItemLabel?" via package "Padre::Wx::Directory::TreeCtrl?" at /usr/src/Padre/Padre/lib/Padre/Wx/Directory.pm line 586.
Perl exited with active threads:

7 running and unjoined
0 finished and unjoined
0 running and detached

comment:10 Changed 2 years ago by bowtie

just install Padre r18171, as make install rather than svn up

kevin@billy:~/perl5/perlbrew/perls/perl-5.14.2/bin$ perl -d padre

Loading DB routines from perl5db.pl version 1.33
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(padre:3):    eval 'exec /home/kevin/perl5/perlbrew/perls/perl-5.14.2/bin/perl  -S $0 ${1+"$@"}'
main::(padre:4):        if 0; # not running under some shell
                                                                                                                                      DB<1> b load /home/kevin/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Padre/Wx/Directory.pm
Will stop on load of `/home/kevin/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Padre/Wx/Directory.pm'.
                                                                                                                                      DB<2> c
11:18:55: Error: Image file is not of type 1.
'/home/kevin/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Padre/Wx/Directory.pm' loaded...
Padre::Wx::Main::directory(/home/kevin/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Padre/Wx/Directory.pm:19):
19: our $VERSION = '0.95';
                                                                                                                                      DB<2> .
Padre::Wx::Main::directory(/home/kevin/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Padre/Wx/Directory.pm:19):
19: our $VERSION = '0.95';
                                                                                                                                      DB<2> b 580
                                                                                                                                      DB<3> c

dose not generate any errors,

comment:11 Changed 2 years ago by bowtie

$DB::single = 1; -> line 588
perl -d -S padre
c

Signal SEGV at /home/kevin/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Padre/TaskHandle.pm line 197
    Padre::TaskHandle::on_message('Padre::TaskHandle=HASH(0xccce238)', 'OWNER', 'Padre::Wx::Directory::Path=ARRAY(0xbe2d580)', 'Padre::Wx::Directory::Path=ARRAY(0xbe2d440)', 'Padre::Wx::Directory::Path=ARRAY(0xbabb408)', 'Padre::Wx::Directory::Path=ARRAY(0xbe2d2f0)', 'Padre::Wx::Directory::Path=ARRAY(0xccb8168)') called at /home/kevin/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Padre/TaskManager.pm line 697
    Padre::TaskManager::on_signal('Padre::TaskManager=HASH(0xb35efd0)', 'ARRAY(0xbd1da98)') called at /home/kevin/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Padre/Wx/Role/Conduit.pm line 130
    Padre::Wx::Role::Conduit::on_signal('Padre::Wx::Frame::Null=HASH(0xa508bf8)', 'Wx::PlThreadEvent=SCALAR(0xb560e10)') called at /home/kevin/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Padre.pm line 262
    eval {...} called at /home/kevin/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Padre.pm line 262
    Padre::run('Padre=HASH(0x8f0fbb0)') called at /home/kevin/perl5/perlbrew/perls/perl-5.14.2/bin/padre line 202
Aborted

comment:12 Changed 2 years ago by bowtie

  • Priority changed from critical to major

As of r18176

Padre dose not crash when opening a none project/session file

but Project Browser is still closed

reducing Priority: magor

comment:13 Changed 2 years ago by bowtie

also note #1338
also note #1391

comment:14 Changed 2 years ago by bowtie

  • Version changed from 0.93 to 0.95

comment:15 Changed 22 months ago by bowtie

  • Resolution set to fixed
  • Status changed from accepted to closed

fixed in r19502 thanks Alias

Note: See TracTickets for help on using tickets.