Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.99k stars 557 forks source link

$dbline[$i] == 0 generates warnings #4553

Closed p5pRT closed 21 years ago

p5pRT commented 23 years ago

Migrated from rt.perl.org#7875 (status was 'resolved')

Searchable as RT7875$

p5pRT commented 23 years ago

From d-lewart@ux1.cso.uiuc.edu


I would like to be able to debug scripts that use warnings. lib/perl5db.pl uses the magical "$dbline[$i] == 0" but it generates "Argument ... isn't numeric in numeric eq (==)" warnings. Below is an example.

Thank you\, Daniel Lewart d-lewart@​uiuc.edu

$ perl@​12856/bin/perl -dWV

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

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

Config​::myconfig(/scratch/d-lewart/perl@​12856/lib/5.7.2/sun4-solaris/Config.pm​:948)​: 948​: return $summary if $summary_expanded;   DB\<1> n Config​::myconfig(/scratch/d-lewart/perl@​12856/lib/5.7.2/sun4-solaris/Config.pm​:949)​: 949​: $summary =~ s{\$(\w+)} Argument "^I^I { my $c = $Config{$1}; defined($c) ? $c : 'unde..." isn't numeric in numeric eq (==) at /scratch/d-lewart/perl@​12856/lib/5.7.2/perl5db.pl line 670.   DB​::dbwarn('Argument "^I^I { my $c = $Config{$1}; defined($c) ? $c : \'unde..." isn\'t numeric in numeric eq (==) at /scratch/d-lewart/perl@​12856/lib/5.7.2/perl5db.pl line 670.\x{a}') called at /scratch/d-lewart/perl@​12856/lib/5.7.2/perl5db.pl line 670   DB​::DB called at /scratch/d-lewart/perl@​12856/lib/5.7.2/sun4-solaris/Config.pm line 949   Config​::myconfig() called at /dev/null line 0 950​: { my $c = $Config{$1}; defined($c) ? $c : 'undef' }ge;   DB\<1> q



Flags​:   category=core   severity=low


Site configuration information for perl v5.7.2​:

Configured by d-lewart at Mon Nov 5 17​:59​:28 CST 2001.

Summary of my perl5 (revision 5.0 version 7 subversion 2 patch 12855) configuration​:   Platform​:   osname=solaris\, osvers=2.7\, archname=sun4-solaris   uname='sunos staff1.cso.uiuc.edu 5.7 generic_106541-12 sun4u sparc sunw\,ultra-2 '   config_args='-des -Dcc=gcc -Dprefix=/scratch/d-lewart/perl@​12856 -Dusedevel'   hint=recommended\, useposix=true\, d_sigaction=define   usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef   useperlio=define d_sfio=undef uselargefiles=define usesocks=undef   use64bitint=undef use64bitall=undef uselongdouble=undef   usemymalloc=n\, bincompat5005=define   Compiler​:   cc='gcc'\, ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'\,   optimize='-O'\,   cppflags='-fno-strict-aliasing -I/usr/local/include'   ccversion=''\, gccversion='2.95.2 19991024 (release)'\, gccosandvers='solaris2.7'   intsize=4\, longsize=4\, ptrsize=4\, doublesize=8\, byteorder=4321   d_longlong=define\, longlongsize=8\, d_longdbl=define\, longdblsize=16   ivtype='long'\, ivsize=4\, nvtype='double'\, nvsize=8\, Off_t='off_t'\, lseeksize=8   alignbytes=8\, prototype=define   Linker and Libraries​:   ld='gcc'\, ldflags =' -L/usr/local/lib '   libpth=/usr/local/lib /usr/lib /usr/ccs/lib   libs=-lsocket -lnsl -ldl -lm -lc   perllibs=-lsocket -lnsl -ldl -lm -lc   libc=/lib/libc.so\, so=so\, useshrplib=false\, libperl=libperl.a   Dynamic Linking​:   dlsrc=dl_dlopen.xs\, dlext=so\, d_dlsymun=undef\, ccdlflags=' '   cccdlflags='-fPIC'\, lddlflags='-G -L/usr/local/lib'

Locally applied patches​:   DEVEL12855


@​INC for perl v5.7.2​:   /scratch/d-lewart/perl@​12856/lib/5.7.2/sun4-solaris   /scratch/d-lewart/perl@​12856/lib/5.7.2   /scratch/d-lewart/perl@​12856/lib/site_perl/5.7.2/sun4-solaris   /scratch/d-lewart/perl@​12856/lib/site_perl/5.7.2   /scratch/d-lewart/perl@​12856/lib/site_perl   .


Environment for perl v5.7.2​:   HOME=/homea/d/d-/d-l/d-lewart   LANG (unset)   LANGUAGE (unset)   LD_LIBRARY_PATH (unset)   LOGDIR (unset)   PATH=/homea/d/d-/d-l/d-lewart/bin​:/usr/local/bin​:/bin​:/usr/bin​:/usr/ccs/bin​:/usr/games​:/usr/ucb   PERL_BADLANG (unset)   SHELL=/bin/ksh

p5pRT commented 23 years ago

From [Unknown Contact. See original ticket]

This *is* probably something that should be fixed\, but in the mean time\, can you just put 'no warnings' at the top of perl5db.pl to shut it up?

--Brent Dax brentdax@​cpan.org Configure pumpking for Perl 6

When I take action\, I’m not going to fire a $2 million missile at a $10 empty tent and hit a camel in the butt.   --Dubya

p5pRT commented 23 years ago

From [Unknown Contact. See original ticket]

# I would like to be able to debug scripts that use warnings. # lib/perl5db.pl uses the magical "$dbline[$i] == 0" but it generates # "Argument ... isn't numeric in numeric eq (==)" warnings. # Below is an example.

This *is* probably something that should be fixed\, but in the mean time\, can you just put 'no warnings' at the top of perl5db.pl to shut it up?

Nope. perl5db.pl is too fragile for something that simple. See below.

Thanks\, Dan d-lewart@​uiuc.edu


$ perl -de 42 No DB​::DB routine defined at /scratch/d-lewart/perl@​12856/lib/5.7.2/Exporter.pm line 6. BEGIN failed--compilation aborted at /scratch/d-lewart/perl@​12856/lib/5.7.2/Exporter.pm line 6. Compilation failed in require at /scratch/d-lewart/perl@​12856/lib/5.7.2/Carp.pm line 83. Compilation failed in require at /scratch/d-lewart/perl@​12856/lib/5.7.2/warnings.pm line 129. BEGIN failed--compilation aborted at /scratch/d-lewart/perl@​12856/lib/5.7.2/warnings.pm line 129. Compilation failed in require at /scratch/d-lewart/perl@​12856/lib/5.7.2/perl5db.pl line 3. BEGIN failed--compilation aborted at /scratch/d-lewart/perl@​12856/lib/5.7.2/perl5db.pl line 3. Compilation failed in require. BEGIN failed--compilation aborted.


p5pRT commented 23 years ago

From @schwern

Yep\, @​dbline definately contains strings. I'm tempted to just change it to !$dbline[$i]\, but I have this nagging feeling that it's only the symptom of a real bug.

--

Michael G. Schwern \schwern@&#8203;pobox\.com http​://www.pobox.com/~schwern/ Perl6 Quality Assurance \perl\-qa@&#8203;perl\.org Kwalitee Is Job One And it's made from all-natural baby skin\, so you know it's good for the environment.   http​://www.goats.com/archive/000606.html

p5pRT commented 23 years ago

From @schwern

If I try to break on the second line of this little program\, bleadperl just hangs. 5.6.1 will let me do it\, but I'm not going to touch that problem.

  $foo =   0;

So instead we check $dbline[$i] !~ /\S/ to see if we can break on it. Slightly better than just seeing if it's numerically 0\, and no warnings. Also\, we revive the breakable_line() function and replace all the $dbline[$i] == 0 with that.

I had to move the dying part of breakable_line() to breakable_line_in_filename()\, but since that was the only place breakable_line() was called there's no problem.

I also pushed the version # up to 1.15. I've also logged that which was done between 1.13 and now as 1.14.

# Changes​: 1.15​: Nov 6\, 2001 Michael G Schwern \schwern@&#8203;pobox\.com # + Explaining @​dbline and %dbline in the comments # + breakable_line() no longer dies\, breakable_line_in_filename() # does the dying. # + breakable_line() now checks to see if a line contains non-whitespace # instead of just == 0. # + using breakable_line() instead of $dbline[$i] == 0 # fixing perlbug 20011106.083

--- perl5db.pl 2001/11/06 18​:14​:51 1.1 +++ perl5db.pl 2001/11/07 01​:28​:14 @​@​ -2\,7 +2\,7 @​@​

# Debugger for Perl 5.00x; perl5db.pl patch level​:

-$VERSION = 1.14; +$VERSION = 1.15; $header = "perl5db.pl version $VERSION";

# @​@​ -25\,14 +25\,15 @​@​ # if caller() is called from the package DB\, it provides some # additional data. # -# The array @​{$main​::{'_\<'.$filename}} is the line-by-line contents of -# $filename. +# The array @​{$main​::{'_\<'.$filename}} (herein called @​dbline) is the +# line-by-line contents of $filename. # -# The hash %{'_\<'.$filename} contains breakpoints and action (it is -# keyed by line number)\, and individual entries are settable (as -# opposed to the whole hash). Only true/false is important to the -# interpreter\, though the values used by perl5db.pl have the form -# "$break_condition\0$action". Values are magical in numeric context. +# The hash %{'_\<'.$filename} (herein called %dbline) contains +# breakpoints and action (it is keyed by line number)\, and individual +# entries are settable (as opposed to the whole hash). Only true/false +# is important to the interpreter\, though the values used by +# perl5db.pl have the form "$break_condition\0$action". Values are +# magical in numeric context. # # The scalar ${'_\<'.$filename} contains $filename. # @​@​ -40\,10 +41\,6 @​@​ # (for subroutines defined outside of the package DB). In fact the same is # true if $deep is not defined. # -# $Log​: perl5db.pl\,v $ -# Revision 1.1 2001/11/06 18​:14​:51 schwern -# Initial revision -#

# # At start reads $rcfile that may set important options. This file @​@​ -257\,6 +254\,20 @​@​ # + Fixed warnings generated by "p 42" (Print expression) # Changes​: 1.13​: Jun 19\, 2001 Scott.L.Miller@​compaq.com # + Added windowSize option +# Changes​: 1.14​: Oct 9\, 2001 multiple +# + Clean up after itself on VMS (Charles Lane in 12385) +# + Adding "@​ file" syntax (Peter Scott in 12014) +# + Debug reloading selfloaded stuff (Ilya Zakharevich in 11457) +# + $^S and other debugger fixes (Ilya Zakharevich in 11120) +# + Forgot a my() declaration (Ilya Zakharevich in 11085) +# Changes​: 1.15​: Nov 6\, 2001 Michael G Schwern \schwern@&#8203;pobox\.com +# + Explaining @​dbline and %dbline in the comments +# + breakable_line() no longer dies\, breakable_line_in_filename() +# does the dying. +# + breakable_line() now checks to see if a line contains non-whitespace +# instead of just == 0. +# + Using breakable_line() instead of $dbline[$i] == 0 +# fixing perlbug 20011106.083 ####################################################################

# Needed for the statement after exec()​: @​@​ -670\,7 +681\,7 @​@​   } else {   print_lineinfo($position);   } - for ($i = $line + 1; $i \<= $max && $dbline[$i] == 0; ++$i) { #{ vi + for ($i = $line + 1; $i \<= $max && !breakable_line($i); ++$i) {   last if $dbline[$i] =~ /^\s*[\;\}\#\n]/;   last if $signal;   $after = ($dbline[$i] =~ /\n$/ ? '' : "\n"); @​@​ -1136\,7 +1147\,7 @​@​   $cmd =~ /^a\b\s*(\d*)\s*(.*)/ && do {   $i = $1 || $line; $j = $2;   if (length $j) { - if ($dbline[$i] == 0) { + if (!breakable_line($i)) {   print $OUT "Line $i may not have an action.\n";   } else {   $had_breakpoints{$filename} |= 2; @​@​ -1175\,14 +1186\,14 @​@​   *dbline = $main​::{'_\<' . $filename};   $had_breakpoints{$filename} |= 1;   $max = $#dbline; - ++$i while $dbline[$i] == 0 && $i \< $max; + ++$i while !breakable_line($i) && $i \< $max;   } else {   print $OUT "Subroutine $subname not found.\n";   next CMD;   }   }   if ($i) { - if ($dbline[$i] == 0) { + if (!breakable_line($i)) {   print $OUT "Line $i not breakable.\n";   next CMD;   } @​@​ -1623\,19 +1634\,25 @​@​   my $delta = $from \< $to ? +1 : -1;   my $limit = $delta > 0 ? $#dbline : 1;   $limit = $to if ($limit - $to) * $delta > 0; - $i += $delta while $dbline[$i] == 0 and ($limit - $i) * $delta > 0; + $i += $delta while $dbline[$i] !~ /\S/ and ($limit - $i) * $delta > 0;   } - return $i unless $dbline[$i] == 0; - my ($pl\, $upto) = (''\, ''); - ($pl\, $upto) = ('s'\, "..$to") if @​_ >=2 and $from != $to; - die "Line$pl $from$upto$filename_error not breakable\n"; + return $i if $dbline[$i] =~ /\S/; }

sub breakable_line_in_filename {   my ($f) = shift;   local *dbline = $main​::{'_\<' . $f};   local $filename_error = " of `$f'"; - breakable_line(@​_); + + my $is_breakable = breakable_line(@​_); + + unless( $is_breakable ) { + my ($pl\, $upto) = (''\, ''); + ($pl\, $upto) = ('s'\, "..$to") if @​_ >=2 and $from != $to; + die "Line$pl $from$upto$filename_error not breakable\n"; + } + + return $is_breakable; }

sub break_on_line { @​@​ -1644\,7 +1661\,7 @​@​   my $inii = $i;   my $after = '';   my $pl = ''; - die "Line $i$filename_error not breakable.\n" if $dbline[$i] == 0; + die "Line $i$filename_error not breakable.\n" unless breakable_line($i);   $had_breakpoints{$filename} |= 1;   if ($dbline{$i}) { $dbline{$i} =~ s/^[^\0]*/$cond/; }   else { $dbline{$i} = $cond; } @​@​ -1705\,7 +1722\,7 @​@​

sub delete_breakpoint {   my $i = shift; - die "Line $i not breakable.\n" if $dbline[$i] == 0; + die "Line $i not breakable.\n" unless breakable_line($i);   $dbline{$i} =~ s/^[^\0]*//;   delete $dbline{$i} if $dbline{$i} eq ''; } @​@​ -1767\,7 +1784\,7 @​@​   local $^W = 0; # != 0 is magical below   $had_breakpoints{$file} |= 1;   my $max = $#dbline; - ++$i until $dbline[$i] != 0 or $i >= $max; + ++$i until breakable_line($i) or $i >= $max;   $dbline{$i} = delete $postponed{$subname};   } else {   print $OUT "Subroutine $subname not found.\n";

--

Michael G. Schwern \schwern@&#8203;pobox\.com http​://www.pobox.com/~schwern/ Perl6 Quality Assurance \perl\-qa@&#8203;perl\.org Kwalitee Is Job One I'm going to have to hurt you on principle.

p5pRT commented 23 years ago

From [Unknown Contact. See original ticket]


I would like to be able to debug scripts that use warnings. lib/perl5db.pl uses the magical "$dbline[$i] == 0" but it generates "Argument ... isn't numeric in numeric eq (==)" warnings. Below is an example.

Thank you\, Daniel Lewart d-lewart@​uiuc.edu

$ perl@​12856/bin/perl -dWV

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

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

Config​::myconfig(/scratch/d-lewart/perl@​12856/lib/5.7.2/sun4-solaris/Config.pm​:948)​: 948​: return $summary if $summary_expanded;   DB\<1> n Config​::myconfig(/scratch/d-lewart/perl@​12856/lib/5.7.2/sun4-solaris/Config.pm​:949)​: 949​: $summary =~ s{\$(\w+)} Argument "^I^I { my $c = $Config{$1}; defined($c) ? $c : 'unde..." isn't numeric in numeric eq (==) at /scratch/d-lewart/perl@​12856/lib/5.7.2/perl5db.pl line 670.   DB​::dbwarn('Argument "^I^I { my $c = $Config{$1}; defined($c) ? $c : \'unde..." isn\'t numeric in numeric eq (==) at /scratch/d-lewart/perl@​12856/lib/5.7.2/perl5db.pl line 670.\x{a}') called at /scratch/d-lewart/perl@​12856/lib/5.7.2/perl5db.pl line 670   DB​::DB called at /scratch/d-lewart/perl@​12856/lib/5.7.2/sun4-solaris/Config.pm line 949   Config​::myconfig() called at /dev/null line 0 950​: { my $c = $Config{$1}; defined($c) ? $c : 'undef' }ge;   DB\<1> q



Flags​:   category=core   severity=low


Site configuration information for perl v5.7.2​:

Configured by d-lewart at Mon Nov 5 17​:59​:28 CST 2001.

Summary of my perl5 (revision 5.0 version 7 subversion 2 patch 12855) configuration​:   Platform​:   osname=solaris\, osvers=2.7\, archname=sun4-solaris   uname='sunos staff1.cso.uiuc.edu 5.7 generic_106541-12 sun4u sparc sunw\,ultra-2 '   config_args='-des -Dcc=gcc -Dprefix=/scratch/d-lewart/perl@​12856 -Dusedevel'   hint=recommended\, useposix=true\, d_sigaction=define   usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef   useperlio=define d_sfio=undef uselargefiles=define usesocks=undef   use64bitint=undef use64bitall=undef uselongdouble=undef   usemymalloc=n\, bincompat5005=define   Compiler​:   cc='gcc'\, ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'\,   optimize='-O'\,   cppflags='-fno-strict-aliasing -I/usr/local/include'   ccversion=''\, gccversion='2.95.2 19991024 (release)'\, gccosandvers='solaris2.7'   intsize=4\, longsize=4\, ptrsize=4\, doublesize=8\, byteorder=4321   d_longlong=define\, longlongsize=8\, d_longdbl=define\, longdblsize=16   ivtype='long'\, ivsize=4\, nvtype='double'\, nvsize=8\, Off_t='off_t'\, lseeksize=8   alignbytes=8\, prototype=define   Linker and Libraries​:   ld='gcc'\, ldflags =' -L/usr/local/lib '   libpth=/usr/local/lib /usr/lib /usr/ccs/lib   libs=-lsocket -lnsl -ldl -lm -lc   perllibs=-lsocket -lnsl -ldl -lm -lc   libc=/lib/libc.so\, so=so\, useshrplib=false\, libperl=libperl.a   Dynamic Linking​:   dlsrc=dl_dlopen.xs\, dlext=so\, d_dlsymun=undef\, ccdlflags=' '   cccdlflags='-fPIC'\, lddlflags='-G -L/usr/local/lib'

Locally applied patches​:   DEVEL12855


@​INC for perl v5.7.2​:   /scratch/d-lewart/perl@​12856/lib/5.7.2/sun4-solaris   /scratch/d-lewart/perl@​12856/lib/5.7.2   /scratch/d-lewart/perl@​12856/lib/site_perl/5.7.2/sun4-solaris   /scratch/d-lewart/perl@​12856/lib/site_perl/5.7.2   /scratch/d-lewart/perl@​12856/lib/site_perl   .


Environment for perl v5.7.2​:   HOME=/homea/d/d-/d-l/d-lewart   LANG (unset)   LANGUAGE (unset)   LD_LIBRARY_PATH (unset)   LOGDIR (unset)   PATH=/homea/d/d-/d-l/d-lewart/bin​:/usr/local/bin​:/bin​:/usr/bin​:/usr/ccs/bin​:/usr/games​:/usr/ucb   PERL_BADLANG (unset)   SHELL=/bin/ksh

p5pRT commented 23 years ago

From @mjdominus

Not so. The manual says​:

  o Each array "@​{"_\<$filename"}" holds the lines of   $filename for a file compiled by Perl. The same for   "eval"ed strings that contain subroutines\, or which   are currently being executed. The $filename for   "eval"ed strings looks like "(eval 34)". Code asser-   tions in regexes look like "(re_eval 19)".

  Values in this array are magical in numeric context​:   they compare equal to zero only if the line is not   breakable.

Basically empty lines\, and lines which are all whitespace are numerically zero. Unfortunately\, this causes warnings and the occasional bug.

Also not so.

So instead we check $dbline[$i] !~ /\S/ to see if we can break on it. Slightly better than just seeing if it's numerically 0\, and no warnings.

That's now totally broken. I don't know what the problem was before\, but you've just made it much\, much worse.

Will you *please* read perldebguts and write a couple of small Devel​:: modules before screwing up the debugger any more?

p5pRT commented 23 years ago

From @schwern

Ok\, so I'm totally wrong.

That still leaves two problems. The orignal reported bug\, that they're getting "Argument ... isn't numeric" warnings from inside perl5db.pl\, demonstrated by running your report() subroutine with warnings on.

* 1 if ($x) { * 2 print $x; Argument "} ## I AM LINE 3\n" isn't numeric in numeric eq (==) at Devel/Breakable.pm line 8.   3 } ## I AM LINE 3 Argument "\n" isn't numeric in numeric eq (==) at Devel/Breakable.pm line 8.   4 * 5 print $y;

Needs more "I am not a real man\, I am a number" magic.

There's also this little bug. If you try to set a breakpoint on the second line of the following program​:

  $foo =   42;

the debugger hangs when using bleadperl.

--

Michael G. Schwern \schwern@&#8203;pobox\.com http​://www.pobox.com/~schwern/ Perl6 Quality Assurance \perl\-qa@&#8203;perl\.org Kwalitee Is Job One gleam comes to my eyes as I combine pure water and triticale.   -- mjd

p5pRT commented 23 years ago

From @mjdominus

Yeah. I think it's a bug in the 'isn't numeric' warning\, but I'm still trying to figure it out. I don't have a lot of confidence that I will succeed.

the debugger hangs when using bleadperl.

Which seems more urgent?

gleam comes to my eyes as I combine pure water and triticale.

That haiku sucks.

p5pRT commented 23 years ago

From [Unknown Contact. See original ticket]


I would like to be able to debug scripts that use warnings. lib/perl5db.pl uses the magical "$dbline[$i] == 0" but it generates "Argument ... isn't numeric in numeric eq (==)" warnings. Below is an example.

Thank you\, Daniel Lewart d-lewart@​uiuc.edu

$ perl@​12856/bin/perl -dWV

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

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

Config​::myconfig(/scratch/d-lewart/perl@​12856/lib/5.7.2/sun4-solaris/Config.pm​:948)​: 948​: return $summary if $summary_expanded;   DB\<1> n Config​::myconfig(/scratch/d-lewart/perl@​12856/lib/5.7.2/sun4-solaris/Config.pm​:949)​: 949​: $summary =~ s{\$(\w+)} Argument "^I^I { my $c = $Config{$1}; defined($c) ? $c : 'unde..." isn't numeric in numeric eq (==) at /scratch/d-lewart/perl@​12856/lib/5.7.2/perl5db.pl line 670.   DB​::dbwarn('Argument "^I^I { my $c = $Config{$1}; defined($c) ? $c : \'unde..." isn\'t numeric in numeric eq (==) at /scratch/d-lewart/perl@​12856/lib/5.7.2/perl5db.pl line 670.\x{a}') called at /scratch/d-lewart/perl@​12856/lib/5.7.2/perl5db.pl line 670   DB​::DB called at /scratch/d-lewart/perl@​12856/lib/5.7.2/sun4-solaris/Config.pm line 949   Config​::myconfig() called at /dev/null line 0 950​: { my $c = $Config{$1}; defined($c) ? $c : 'undef' }ge;   DB\<1> q



Flags​:   category=core   severity=low


Site configuration information for perl v5.7.2​:

Configured by d-lewart at Mon Nov 5 17​:59​:28 CST 2001.

Summary of my perl5 (revision 5.0 version 7 subversion 2 patch 12855) configuration​:   Platform​:   osname=solaris\, osvers=2.7\, archname=sun4-solaris   uname='sunos staff1.cso.uiuc.edu 5.7 generic_106541-12 sun4u sparc sunw\,ultra-2 '   config_args='-des -Dcc=gcc -Dprefix=/scratch/d-lewart/perl@​12856 -Dusedevel'   hint=recommended\, useposix=true\, d_sigaction=define   usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef   useperlio=define d_sfio=undef uselargefiles=define usesocks=undef   use64bitint=undef use64bitall=undef uselongdouble=undef   usemymalloc=n\, bincompat5005=define   Compiler​:   cc='gcc'\, ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'\,   optimize='-O'\,   cppflags='-fno-strict-aliasing -I/usr/local/include'   ccversion=''\, gccversion='2.95.2 19991024 (release)'\, gccosandvers='solaris2.7'   intsize=4\, longsize=4\, ptrsize=4\, doublesize=8\, byteorder=4321   d_longlong=define\, longlongsize=8\, d_longdbl=define\, longdblsize=16   ivtype='long'\, ivsize=4\, nvtype='double'\, nvsize=8\, Off_t='off_t'\, lseeksize=8   alignbytes=8\, prototype=define   Linker and Libraries​:   ld='gcc'\, ldflags =' -L/usr/local/lib '   libpth=/usr/local/lib /usr/lib /usr/ccs/lib   libs=-lsocket -lnsl -ldl -lm -lc   perllibs=-lsocket -lnsl -ldl -lm -lc   libc=/lib/libc.so\, so=so\, useshrplib=false\, libperl=libperl.a   Dynamic Linking​:   dlsrc=dl_dlopen.xs\, dlext=so\, d_dlsymun=undef\, ccdlflags=' '   cccdlflags='-fPIC'\, lddlflags='-G -L/usr/local/lib'

Locally applied patches​:   DEVEL12855


@​INC for perl v5.7.2​:   /scratch/d-lewart/perl@​12856/lib/5.7.2/sun4-solaris   /scratch/d-lewart/perl@​12856/lib/5.7.2   /scratch/d-lewart/perl@​12856/lib/site_perl/5.7.2/sun4-solaris   /scratch/d-lewart/perl@​12856/lib/site_perl/5.7.2   /scratch/d-lewart/perl@​12856/lib/site_perl   .


Environment for perl v5.7.2​:   HOME=/homea/d/d-/d-l/d-lewart   LANG (unset)   LANGUAGE (unset)   LD_LIBRARY_PATH (unset)   LOGDIR (unset)   PATH=/homea/d/d-/d-l/d-lewart/bin​:/usr/local/bin​:/bin​:/usr/bin​:/usr/ccs/bin​:/usr/games​:/usr/ucb   PERL_BADLANG (unset)   SHELL=/bin/ksh

p5pRT commented 23 years ago

From @schwern

Bug reopened.

--

Michael G. Schwern \schwern@&#8203;pobox\.com http​://www.pobox.com/~schwern/ Perl6 Quality Assurance \perl\-qa@&#8203;perl\.org Kwalitee Is Job One "None of our men are "experts."... because no one ever considers himself expert if he really knows his job."
-- From Henry Ford Sr.\, "My Life and Work\," p. 86 (1922)​:

p5pRT commented 23 years ago

From @mjdominus

The magic values in @​dbline (which is an alias to @​{"​::_\<$filename"}) have both an integer and a string value.

The string part contains the actual line of code.
The integer part contains zero if the line is not breakable\, and nonzero if it is breakable.

The problem is that when the integer part is zero\, the IOK flag isn't turned on\, so Perl tries to convert the string part to an integer.

I think I've finally hunted down the place that sets up the array in the first place\, so I may actually have a patch for this tonight.

p5pRT commented 23 years ago

From @mjdominus

The problem is that when the integer part is zero\, the IOK flag isn't turned on\, so Perl tries to convert the string part to an integer.

Michael said​:

There's also this little bug. If you try to set a breakpoint on the second line of the following program​:

$foo =
    42;

the debugger hangs when using bleadperl.

I bet this is the same problem. The "42;" line (line 2) is not breakable\, so $dbline[2] has PV = " 42;" and IV = 0\, but IOK is off.

Then test $dbline[2] == 0 seeks that !IOK\, and tries to convert " 42;" to a number. The result is the number 42. Since 42 is *not* zero\, the debugger decides that the line is breakable\, and havok ensues.

By the way\, thanks. I've always wanted to be a dragon.

p5pRT commented 23 years ago

From @mjdominus

I think this patch (against 5.7.2) fixes the problem. All tests pass.

Thanks for your report.

--- gv.c 2001/11/07 05​:12​:15 1.1 +++ gv.c 2001/11/07 05​:12​:44 @​@​ -72\,6 +72\,7 @​@​   tmpbuf = smallbuf;   else   New(603\, tmpbuf\, tmplen + 1\, char); + /* This is where the debugger's %{"​::_\<$filename"} hash is created */   tmpbuf[0] = '_';   tmpbuf[1] = '\<';   strcpy(tmpbuf + 2\, name); --- op.c 2001/11/07 04​:17​:18 1.1 +++ op.c 2001/11/07 05​:17​:20 @​@​ -3637\,10 +3637\,10 @​@​

  if (PERLDB_LINE && PL_curstash != PL_debstash) {   SV **svp = av_fetch(CopFILEAV(PL_curcop)\, (I32)CopLINE(cop)\, FALSE); - if (svp && *svp != &PL_sv_undef && !SvIOK(*svp)) { - (void)SvIOK_on(*svp); + if (svp && *svp != &PL_sv_undef ) { + (void)SvIOK_on(*svp);   SvIVX(*svp) = PTR2IV(cop); - } + }   }

  return prepend_elem(OP_LINESEQ\, (OP*)cop\, o); --- toke.c 2001/11/07 05​:02​:06 1.1 +++ toke.c 2001/11/07 05​:14​:29 @​@​ -633\,6 +633\,8 @​@​

  sv_upgrade(sv\, SVt_PVMG);   sv_setpvn(sv\,PL_bufptr\,PL_bufend-PL_bufptr); + (void)SvIOK_on(sv); + SvIVX(sv) = 0;   av_store(CopFILEAV(PL_curcop)\,(I32)CopLINE(PL_curcop)\,sv);   }   } @​@​ -2453\,6 +2455\,8 @​@​

  sv_upgrade(sv\, SVt_PVMG);   sv_setsv(sv\,PL_linestr); + (void)SvIOK_on(sv); + SvIVX(sv) = 0;   av_store(CopFILEAV(PL_curcop)\,(I32)CopLINE(PL_curcop)\,sv);   }   goto retry; @​@​ -2536\,6 +2540\,8 @​@​

  sv_upgrade(sv\, SVt_PVMG);   sv_setsv(sv\,PL_linestr); + (void)SvIOK_on(sv); + SvIVX(sv) = 0;   av_store(CopFILEAV(PL_curcop)\,(I32)CopLINE(PL_curcop)\,sv);   }   PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr); @​@​ -6512\,6 +6518\,8 @​@​

  sv_upgrade(sv\, SVt_PVMG);   sv_setsv(sv\,PL_linestr); + (void)SvIOK_on(sv); + SvIVX(sv) = 0;   av_store(CopFILEAV(PL_curcop)\, (I32)CopLINE(PL_curcop)\,sv);   }   if (*s == term && memEQ(s\,PL_tokenbuf\,len)) { @​@​ -6845\,6 +6853\,8 @​@​

  sv_upgrade(sv\, SVt_PVMG);   sv_setsv(sv\,PL_linestr); + (void)SvIOK_on(sv); + SvIVX(sv) = 0;   av_store(CopFILEAV(PL_curcop)\, (I32)CopLINE(PL_curcop)\, sv);   }

p5pRT commented 23 years ago

From [Unknown Contact. See original ticket]

Thanks\, applied. (#12882)

- ams

p5pRT commented 23 years ago

From @schwern

http​://www.armory.com/tests/draconity.html

RAHRR!! Eat silly knight.

--

Michael G. Schwern \schwern@&#8203;pobox\.com http​://www.pobox.com/~schwern/ Perl6 Quality Assurance \perl\-qa@&#8203;perl\.org Kwalitee Is Job One If you got the wax out of your ears you could hear the twister picking up the trailer park of your future!

p5pRT commented 23 years ago

From @mjdominus

I was not able to confirm this. Can you please check to see if my patch from yesterday makes the problem go away?

Thanks.

p5pRT commented 23 years ago

From @schwern

It's gone in 12892\, which is about 7pm EST last night.

--

Michael G. Schwern \schwern@&#8203;pobox\.com http​://www.pobox.com/~schwern/ Perl6 Quality Assurance \perl\-qa@&#8203;perl\.org Kwalitee Is Job One Only mindless violence can raise my spirits now!

p5pRT commented 23 years ago

From [Unknown Contact. See original ticket]

I think this patch (against 5.7.2) fixes the problem.

I tested perl@​12892 (which includes your fine patch) and it works!

Thank you!!! Dan d-lewart@​uiuc.edu

p5pRT commented 23 years ago

From [Unknown Contact. See original ticket]


I would like to be able to debug scripts that use warnings. lib/perl5db.pl uses the magical "$dbline[$i] == 0" but it generates "Argument ... isn't numeric in numeric eq (==)" warnings. Below is an example.

Thank you\, Daniel Lewart d-lewart@​uiuc.edu

$ perl@​12856/bin/perl -dWV

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

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

Config​::myconfig(/scratch/d-lewart/perl@​12856/lib/5.7.2/sun4-solaris/Config.pm​:948)​: 948​: return $summary if $summary_expanded;   DB\<1> n Config​::myconfig(/scratch/d-lewart/perl@​12856/lib/5.7.2/sun4-solaris/Config.pm​:949)​: 949​: $summary =~ s{\$(\w+)} Argument "^I^I { my $c = $Config{$1}; defined($c) ? $c : 'unde..." isn't numeric in numeric eq (==) at /scratch/d-lewart/perl@​12856/lib/5.7.2/perl5db.pl line 670.   DB​::dbwarn('Argument "^I^I { my $c = $Config{$1}; defined($c) ? $c : \'unde..." isn\'t numeric in numeric eq (==) at /scratch/d-lewart/perl@​12856/lib/5.7.2/perl5db.pl line 670.\x{a}') called at /scratch/d-lewart/perl@​12856/lib/5.7.2/perl5db.pl line 670   DB​::DB called at /scratch/d-lewart/perl@​12856/lib/5.7.2/sun4-solaris/Config.pm line 949   Config​::myconfig() called at /dev/null line 0 950​: { my $c = $Config{$1}; defined($c) ? $c : 'undef' }ge;   DB\<1> q



Flags​:   category=core   severity=low


Site configuration information for perl v5.7.2​:

Configured by d-lewart at Mon Nov 5 17​:59​:28 CST 2001.

Summary of my perl5 (revision 5.0 version 7 subversion 2 patch 12855) configuration​:   Platform​:   osname=solaris\, osvers=2.7\, archname=sun4-solaris   uname='sunos staff1.cso.uiuc.edu 5.7 generic_106541-12 sun4u sparc sunw\,ultra-2 '   config_args='-des -Dcc=gcc -Dprefix=/scratch/d-lewart/perl@​12856 -Dusedevel'   hint=recommended\, useposix=true\, d_sigaction=define   usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef   useperlio=define d_sfio=undef uselargefiles=define usesocks=undef   use64bitint=undef use64bitall=undef uselongdouble=undef   usemymalloc=n\, bincompat5005=define   Compiler​:   cc='gcc'\, ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'\,   optimize='-O'\,   cppflags='-fno-strict-aliasing -I/usr/local/include'   ccversion=''\, gccversion='2.95.2 19991024 (release)'\, gccosandvers='solaris2.7'   intsize=4\, longsize=4\, ptrsize=4\, doublesize=8\, byteorder=4321   d_longlong=define\, longlongsize=8\, d_longdbl=define\, longdblsize=16   ivtype='long'\, ivsize=4\, nvtype='double'\, nvsize=8\, Off_t='off_t'\, lseeksize=8   alignbytes=8\, prototype=define   Linker and Libraries​:   ld='gcc'\, ldflags =' -L/usr/local/lib '   libpth=/usr/local/lib /usr/lib /usr/ccs/lib   libs=-lsocket -lnsl -ldl -lm -lc   perllibs=-lsocket -lnsl -ldl -lm -lc   libc=/lib/libc.so\, so=so\, useshrplib=false\, libperl=libperl.a   Dynamic Linking​:   dlsrc=dl_dlopen.xs\, dlext=so\, d_dlsymun=undef\, ccdlflags=' '   cccdlflags='-fPIC'\, lddlflags='-G -L/usr/local/lib'

Locally applied patches​:   DEVEL12855


@​INC for perl v5.7.2​:   /scratch/d-lewart/perl@​12856/lib/5.7.2/sun4-solaris   /scratch/d-lewart/perl@​12856/lib/5.7.2   /scratch/d-lewart/perl@​12856/lib/site_perl/5.7.2/sun4-solaris   /scratch/d-lewart/perl@​12856/lib/site_perl/5.7.2   /scratch/d-lewart/perl@​12856/lib/site_perl   .


Environment for perl v5.7.2​:   HOME=/homea/d/d-/d-l/d-lewart   LANG (unset)   LANGUAGE (unset)   LD_LIBRARY_PATH (unset)   LOGDIR (unset)   PATH=/homea/d/d-/d-l/d-lewart/bin​:/usr/local/bin​:/bin​:/usr/bin​:/usr/ccs/bin​:/usr/games​:/usr/ucb   PERL_BADLANG (unset)   SHELL=/bin/ksh

p5pRT commented 23 years ago

From @schwern

  $foo =   42;

--

Michael G. Schwern \schwern@&#8203;pobox\.com http​://www.pobox.com/~schwern/ Perl6 Quality Assurance \perl\-qa@&#8203;perl\.org Kwalitee Is Job One We're talkin' to you\, weaselnuts.   http​://www.goats.com/archive/000831.html