Opened 3 years ago

Closed 2 years ago

#1274 closed defect (not relevant)

--die Plugin-Manager & Pod::Abstract::Path bleeding into Padre $SIG

Reported by: bowtie Owned by:
Priority: minor Milestone:
Component: not classified yet Version: 0.87
Keywords: $SIG __DIE__ Cc: Alias, zenog

Description

when you run Padre from trunk, with perl dev -a --die and open Plugin Manager you get a screen full of this.

DIE: Can't call method "can" on unblessed reference at /home/kevin/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Pod/Abstract/Path.pm line 471.

--------------------------------------------------------------------------------
 at /home/kevin/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Pod/Abstract/Path.pm line 471
    eval {...} called at /home/kevin/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Pod/Abstract/Path.pm line 471
    Pod::Abstract::Path::match_expression('Pod::Abstract::Path=HASH(0x127b9968)', 'ARRAY(0x127b99b8)', 'test_regexp', 0, 'Pod::Abstract::Path=HASH(0x127b9838)', 'ARRAY(0x127b9828)') called at /home/kevin/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Pod/Abstract/Path.pm line 359
    Pod::Abstract::Path::process('Pod::Abstract::Path=HASH(0x127b9968)', 'Pod::Abstract::Node=HASH(0x127a2be0)') called at /home/kevin/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Pod/Abstract/Node.pm line 275
    Pod::Abstract::Node::select('Pod::Abstract::Node=HASH(0x127a2be0)', '/head1[@heading =~ {NAME}]') called at /usr/src/Padre/Padre/lib/Padre/Browser/POD.pm line 121
    Padre::Browser::POD::resolve('Padre::Browser::POD', 'Padre::Plugin::My', undef) called at /usr/src/Padre/Padre/lib/Padre/Browser.pm line 289
    Padre::Browser::resolve('Padre::Browser=HASH(0xf6a1a28)', 'Padre::Plugin::My') called at /usr/src/Padre/Padre/lib/Padre/Wx/Dialog/PluginManager.pm line 244
    Padre::Wx::Dialog::PluginManager::list_item_selected('Padre::Wx::Dialog::PluginManager=HASH(0x119675a0)', 'Wx::ListEvent=SCALAR(0x9090608)') called at /usr/src/Padre/Padre/lib/Padre/Wx/Dialog/PluginManager.pm line 74
    Padre::Wx::Dialog::PluginManager::__ANON__('Padre::Wx::Dialog::PluginManager=HASH(0x119675a0)', 'Wx::ListEvent=SCALAR(0x9090608)') called at /usr/src/Padre/Padre/lib/Padre/Wx/Dialog/PluginManager.pm line 211
    eval {...} called at /usr/src/Padre/Padre/lib/Padre/Wx/Dialog/PluginManager.pm line 211
    Padre::Wx::Dialog::PluginManager::show('Padre::Wx::Dialog::PluginManager=HASH(0x119675a0)') called at /usr/src/Padre/Padre/lib/Padre/Wx/ActionLibrary.pm line 2389
    Padre::Wx::ActionLibrary::__ANON__('Padre::Wx::Main=HASH(0x9f034f0)', 'Wx::CommandEvent=SCALAR(0xb850f78)') called at /usr/src/Padre/Padre/lib/Padre/Wx/Action.pm line 217
    Padre::Wx::Action::_event('Padre::Wx::Action=HASH(0xa0ebff0)', 'Padre::Wx::Main=HASH(0x9f034f0)', 'Wx::CommandEvent=SCALAR(0xb850f78)') called at /usr/src/Padre/Padre/lib/Padre/Wx/Action.pm line 102
    Padre::Wx::Action::__ANON__('Padre::Wx::Main=HASH(0x9f034f0)', 'Wx::CommandEvent=SCALAR(0xb850f78)') called at /usr/src/Padre/Padre/lib/Padre.pm line 249
    eval {...} called at /usr/src/Padre/Padre/lib/Padre.pm line 249
    Padre::run('Padre=HASH(0x91a5178)') called at /usr/src/Padre/Padre/script/padre line 178

this is caused by the eval line 471 from Pod::Abstract::Path

sub match_expression {
    my $self = shift;
    my $ilist = shift;
    my $test_action = shift;
    my $invert = shift;
    my $exp = shift;
    my $r_exp = shift;
    
    my $op = shift; # Only for some operators
    
    my $nlist = [ ];
    foreach my $n(@$ilist) {
        my @t_list = $exp->process($n);
        my $t_result;
        # Allow for r_exp to be another expression - generate both
        # node lists if required.
        if( eval { $r_exp->can('process') } ) {
            my @r_list = $r_exp->process($n);
            $t_result = $self->$test_action(\@t_list, \@r_list, $op);
        } else {
            $t_result = $self->$test_action(\@t_list, $r_exp, $op);
        }
        $t_result = !$t_result if $invert;
        if($t_result) {
            push @$nlist, $n;
        }
    }
    return $nlist;
}

As this Module is not part of Padre, hence we might not see a valid padre $SIG as they could be mixed in with Pod::Abstract::Path bleeding.

So here is a patch to stop it bleeding into Padre $SIG handler.

  • lib/Padre/Browser/POD.pm

     
    7070 
    7171    return unless -s $tempfile; 
    7272 
    73     my $pa = Pod::Abstract->load_file($tempfile); 
     73    my $pa; 
     74    local $SIG{__DIE__} = 'IGNORE'; 
     75    eval { $pa = Pod::Abstract->load_file($tempfile); }; 
     76    local $SIG{__DIE__} = 'DEFAULT'; 
    7477    close $fh; 
    7578    unlink($tempfile); 

Some more guidance would be nice, what next??

Change History (2)

comment:1 Changed 3 years ago by bowtie

a little kick for hyppolit

comment:2 Changed 2 years ago by bowtie

  • Resolution set to not relevant
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.