Skip Menu |

This queue is for tickets about the ParseUtil-Domain CPAN distribution.

Report information
The Basics
Id: 92938
Status: resolved
Priority: 0/
Queue: ParseUtil-Domain

People
Owner: HEYTRAV [...] cpan.org
Requestors: CHESNOKOV [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 2.31
Fixed in: 2.34



Subject: It's impossible to debug a program using ParseUtil::Domain on modern perl
Let's write a simple one-liner: perl -MParseUtil::Domain -E 'say ParseUtil::Domain::parse_domain("example.com")->{domain};' It outputs (as expected): example Let's try to debug it using built-in Perl debugger: perl -d -MParseUtil::Domain -E 'say ParseUtil::Domain::parse_domain("example.com")->{domain};' And the output is: --- Loading DB routines from perl5db.pl version 1.37 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. Internal error: missing symbol for CODE(0x22e10a8) at /opt/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/Perl6/Export/Attrs.pm line 65. at /opt/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/Perl6/Export/Attrs.pm line 65. Perl6::Export::Attrs::_invert_tagset('ParseUtil::Domain', 'HASH(0x22e9848)') called at /opt/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/Perl6/Export/Attrs.pm line 78 Perl6::Export::Attrs::_generic_import('ParseUtil::Domain') called at -e line 0 main::BEGIN() called at -e line 0 eval {...} called at -e line 0 BEGIN failed--compilation aborted. at -e line 0. Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, h q, h R or h o to get additional info. DB<1> --- Thus the program is terminated even before we start to debug it.
On Tue Feb 11 07:43:14 2014, CHESNOKOV wrote: Show quoted text
> Let's write a simple one-liner: > perl -MParseUtil::Domain -E 'say > ParseUtil::Domain::parse_domain("example.com")->{domain};' > It outputs (as expected): > example > > Let's try to debug it using built-in Perl debugger: > > perl -d -MParseUtil::Domain -E 'say > ParseUtil::Domain::parse_domain("example.com")->{domain};' > > And the output is: > > --- > Loading DB routines from perl5db.pl version 1.37 > Editor support available. > > Enter h or 'h h' for help, or 'man perldebug' for more help. > > Internal error: missing symbol for CODE(0x22e10a8) at > /opt/perlbrew/perls/perl- > 5.16.3/lib/site_perl/5.16.3/Perl6/Export/Attrs.pm line 65. > at /opt/perlbrew/perls/perl- > 5.16.3/lib/site_perl/5.16.3/Perl6/Export/Attrs.pm line 65. > Perl6::Export::Attrs::_invert_tagset('ParseUtil::Domain', > 'HASH(0x22e9848)') called at /opt/perlbrew/perls/perl- > 5.16.3/lib/site_perl/5.16.3/Perl6/Export/Attrs.pm line 78 > Perl6::Export::Attrs::_generic_import('ParseUtil::Domain') > called at -e line 0 > main::BEGIN() called at -e line 0 > eval {...} called at -e line 0 > BEGIN failed--compilation aborted. > at -e line 0. > Debugged program terminated. Use q to quit or R to restart, > use o inhibit_exit to avoid stopping after program termination, > h q, h R or h o to get additional info. > DB<1> > --- > > Thus the program is terminated even before we start to debug it.
I'll have to look into this a bit. I suspect this could be do to the debugger not loading the subroutines in "perl5i" syntax.
On Tue Feb 11 07:43:14 2014, CHESNOKOV wrote: Show quoted text
> Let's write a simple one-liner: > perl -MParseUtil::Domain -E 'say > ParseUtil::Domain::parse_domain("example.com")->{domain};' > It outputs (as expected): > example > > Let's try to debug it using built-in Perl debugger: > > perl -d -MParseUtil::Domain -E 'say > ParseUtil::Domain::parse_domain("example.com")->{domain};' > > And the output is: > > --- > Loading DB routines from perl5db.pl version 1.37 > Editor support available. > > Enter h or 'h h' for help, or 'man perldebug' for more help. > > Internal error: missing symbol for CODE(0x22e10a8) at > /opt/perlbrew/perls/perl- > 5.16.3/lib/site_perl/5.16.3/Perl6/Export/Attrs.pm line 65. > at /opt/perlbrew/perls/perl- > 5.16.3/lib/site_perl/5.16.3/Perl6/Export/Attrs.pm line 65. > Perl6::Export::Attrs::_invert_tagset('ParseUtil::Domain', > 'HASH(0x22e9848)') called at /opt/perlbrew/perls/perl- > 5.16.3/lib/site_perl/5.16.3/Perl6/Export/Attrs.pm line 78 > Perl6::Export::Attrs::_generic_import('ParseUtil::Domain') > called at -e line 0 > main::BEGIN() called at -e line 0 > eval {...} called at -e line 0 > BEGIN failed--compilation aborted. > at -e line 0. > Debugged program terminated. Use q to quit or R to restart, > use o inhibit_exit to avoid stopping after program termination, > h q, h R or h o to get additional info. > DB<1> > --- > > Thus the program is terminated even before we start to debug it.
Have a look at: https://gist.github.com/heytrav/8941503 If I uncomment the function written in perl5i syntax, I get an error pretty much identical to the one you are getting (see below). It looks to me like the combination of perl5i and Perl6::Export::Attrs do not play to well in the debugger. I am not sure what the reason for this is, but it would require delving into one or both of these codebases to figure out why subroutines aren't appearing in the symbol table. It's also a bit unfortunate since perl5i in particular is supposed to be relatively "modern Perl" as you put it. How important is operation in the debugger for you? To be honest, this was a use case I have never considered. ERL5LIB=lib:$PERL5LIB perl -d -MTest -E 'say Test::test_func();' Loading DB routines from perl5db.pl version 1.39_10 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. Internal error: missing symbol for CODE(0x7fad531c0b90) at /Users/holton/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Perl6/Export/Attrs.pm line 65. at /Users/holton/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Perl6/Export/Attrs.pm line 65. Perl6::Export::Attrs::_invert_tagset('Test', 'HASH(0x7fad547323f8)') called at /Users/holton/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Perl6/Export/Attrs.pm line 78 Perl6::Export::Attrs::_generic_import('Test') called at -e line 0 main::BEGIN() called at -e line 0 eval {...} called at -e line 0 BEGIN failed--compilation aborted.
On Tue Feb 11 14:08:12 2014, HEYTRAV wrote: Show quoted text
> On Tue Feb 11 07:43:14 2014, CHESNOKOV wrote:
> > Let's write a simple one-liner: > > perl -MParseUtil::Domain -E 'say > > ParseUtil::Domain::parse_domain("example.com")->{domain};' > > It outputs (as expected): > > example > > > > Let's try to debug it using built-in Perl debugger: > > > > perl -d -MParseUtil::Domain -E 'say > > ParseUtil::Domain::parse_domain("example.com")->{domain};' > > > > And the output is: > > > > --- > > Loading DB routines from perl5db.pl version 1.37 > > Editor support available. > > > > Enter h or 'h h' for help, or 'man perldebug' for more help. > > > > Internal error: missing symbol for CODE(0x22e10a8) at > > /opt/perlbrew/perls/perl- > > 5.16.3/lib/site_perl/5.16.3/Perl6/Export/Attrs.pm line 65. > > at /opt/perlbrew/perls/perl- > > 5.16.3/lib/site_perl/5.16.3/Perl6/Export/Attrs.pm line 65. > > Perl6::Export::Attrs::_invert_tagset('ParseUtil::Domain', > > 'HASH(0x22e9848)') called at /opt/perlbrew/perls/perl- > > 5.16.3/lib/site_perl/5.16.3/Perl6/Export/Attrs.pm line 78 > > Perl6::Export::Attrs::_generic_import('ParseUtil::Domain') > > called at -e line 0 > > main::BEGIN() called at -e line 0 > > eval {...} called at -e line 0 > > BEGIN failed--compilation aborted. > > at -e line 0. > > Debugged program terminated. Use q to quit or R to restart, > > use o inhibit_exit to avoid stopping after program termination, > > h q, h R or h o to get additional info. > > DB<1> > > --- > > > > Thus the program is terminated even before we start to debug it.
> > Have a look at: > > https://gist.github.com/heytrav/8941503 > > > If I uncomment the function written in perl5i syntax, I get an error > pretty much identical to the one you are getting (see below). It looks > to me like the combination of perl5i and Perl6::Export::Attrs do not > play to well in the debugger. I am not sure what the reason for this > is, but it would require delving into one or both of these codebases > to figure out why subroutines aren't appearing in the symbol table. > > It's also a bit unfortunate since perl5i in particular is supposed to > be relatively "modern Perl" as you put it. > > How important is operation in the debugger for you? To be honest, > this was a use case I have never considered. > > > > > > > > > > > > ERL5LIB=lib:$PERL5LIB perl -d -MTest -E 'say Test::test_func();' > > Loading DB routines from perl5db.pl version 1.39_10 > Editor support available. > > Enter h or 'h h' for help, or 'man perldebug' for more help. > > Internal error: missing symbol for CODE(0x7fad531c0b90) at > /Users/holton/perl5/perlbrew/perls/perl- > 5.18.1/lib/site_perl/5.18.1/Perl6/Export/Attrs.pm line 65. > at /Users/holton/perl5/perlbrew/perls/perl- > 5.18.1/lib/site_perl/5.18.1/Perl6/Export/Attrs.pm line 65. > Perl6::Export::Attrs::_invert_tagset('Test', > 'HASH(0x7fad547323f8)') called at > /Users/holton/perl5/perlbrew/perls/perl- > 5.18.1/lib/site_perl/5.18.1/Perl6/Export/Attrs.pm line 78 > Perl6::Export::Attrs::_generic_import('Test') called at -e > line 0 > main::BEGIN() called at -e line 0 > eval {...} called at -e line 0 > BEGIN failed--compilation aborted.
Sorry, that command was: PERL5LIB=lib:$PERL5LIB perl -d -MTest -E 'say Test::test_func();'
Hi, Show quoted text
> It's also a bit unfortunate since perl5i in particular is supposed to be relatively "modern Perl" as you put it.
No, it isn't. perl5i uses ("nasty hacked up" - (c) mst) Devel::Declare which was created as an experiment and "was not for general consumption" (http://cpanratings.perl.org/dist/Devel-Declare#3367). New perl (since v5.12 I think) has a built-in pluggable keyword API, which is what Devel::Declare was used for previously. This API is utilized in Method::Signatures module, which actually should be used if you want method signatures (the ability to define subroutines like: func ($a, $b, $c) { ... }). BTW, Method::Signatures' "func" keyword can be used as a drop-in replace for perl5i's "func". Seems like perl5i is more like an educational project, not the one that should be used in production, so I would recommend you to get rid of it. Although you can replace perl5i's features with analogs from other modules - it seems you like auto boxing - you could use https://metacpan.org/pod/Moose::Autobox or https://metacpan.org/pod/autobox (not sure which one is better). Show quoted text
> How important is operation in the debugger for you? To be honest, this was a use case I have never considered.
Very important: we are developing a web hosting solution and sometimes it's necessary to debug failing tests / scripts using a debugger.
On Wed Feb 19 14:26:46 2014, CHESNOKOV wrote: Show quoted text
> Hi, >
> > It's also a bit unfortunate since perl5i in particular is supposed to > > be relatively "modern Perl" as you put it.
> > No, it isn't. > perl5i uses ("nasty hacked up" - (c) mst) Devel::Declare which was > created as an experiment and "was not for general consumption" > (http://cpanratings.perl.org/dist/Devel-Declare#3367). New perl (since
Whatever. I saw Schwern give a talk about it and thought I'd give it a try. I'm not married to it by any means. Show quoted text
> > Very important: we are developing a web hosting solution and sometimes > it's necessary to debug failing tests / scripts using a debugger.
I just put up a new version with the perl5i changes taken out. Hopefully this will cure the problems you are having with the debugger.
On Wed Feb 19 16:40:51 2014, HEYTRAV wrote: Show quoted text
> > Whatever. I saw Schwern give a talk about it and thought I'd give it a > try. I'm not married to it by any means. > > I just put up a new version with the perl5i changes taken out. > Hopefully this will cure the problems you are having with the > debugger.
Great - it seems like this new version works fine with perl-5.16.3, thank you for the fix!
Works fine, thanks again.