cperl icon indicating copy to clipboard operation
cperl copied to clipboard

Perl Debugger + Coro: Bizarre copy of CODE in block exit

Open sten22 opened this issue 7 years ago • 2 comments

I'm trying to use -d or Devel::Trace with Coro to debug another error, but debugger itself fail in this place:

perl -d coro-trace.pl 

Loading DB routines from perl5db.pl version 1.51_01c
Editor support available.

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

main::(coro-trace.pl:16):       coro( \&asyncThread);
  DB<1> r
Bizarre copy of CODE in block exit at /Users/user/perl5/perlbrew/perls/cperl-5.26.2/lib/site_cperl/5.26.2/darwin-2level/Coro.pm line 716.
Debugged program terminated.  Use q to quit or R to restart,

Tested on: cperl-5.26.2 - fail perl-5.26.2 - fail perl-5.24.4 - fail perl-5.14.4 - OK

coro-trace.pl:

use EV;
use Coro::EV;
use Coro;

#$Devel::Trace::TRACE = 0;

sub coro {
        my $sub = shift;
        my $coro = Coro->new($sub, @_);
        $coro->ready();
        return $coro;
};

sub asyncThread {};

coro( \&asyncThread);

EV::run;

sten22 avatar Apr 28 '18 05:04 sten22

Yes, -d is broken for a long time. Not only Coro. This was #167, which fixed only some parts of -d.

I'll leave that open to track it. To debug Coro you need to use a debugging cperl and -Dts and gdb.

rurban avatar Apr 28 '18 09:04 rurban

One more debugger issue, it's related to #361:

perl -d -MCPAN -e 'install Module::Build::Tiny'

Loading DB routines from perl5db.pl version 1.51_01c
Editor support available.

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

Signal SEGV at /Users/user/perl5/perlbrew/perls/cperl-5.26.2/lib/5.26.2/CPAN/Author.pm line 6.
        CPAN::Author::BEGIN() called at /Users/user/perl5/perlbrew/perls/cperl-5.26.2/lib/5.26.2/CPAN/InfoObj.pm line 55
        eval {...} called at /Users/user/perl5/perlbrew/perls/cperl-5.26.2/lib/5.26.2/CPAN/InfoObj.pm line 55
        require CPAN/Author.pm called at /Users/user/perl5/perlbrew/perls/cperl-5.26.2/lib/5.26.2/darwin-2level/CPAN.pm line 19
        CPAN::BEGIN() called at /Users/user/perl5/perlbrew/perls/cperl-5.26.2/lib/5.26.2/CPAN/InfoObj.pm line 55
        eval {...} called at /Users/user/perl5/perlbrew/perls/cperl-5.26.2/lib/5.26.2/CPAN/InfoObj.pm line 55
        require CPAN.pm called at -e line 0
        main::BEGIN() called at /Users/user/perl5/perlbrew/perls/cperl-5.26.2/lib/5.26.2/CPAN/InfoObj.pm line 55
        eval {...} called at /Users/user/perl5/perlbrew/perls/cperl-5.26.2/lib/5.26.2/CPAN/InfoObj.pm line 55

sten22 avatar Apr 29 '18 06:04 sten22