Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with DB::db_complete: Can't use string ("::") as a HASH ref while "strict refs" in use #16252

Closed
p5pRT opened this issue Nov 16, 2017 · 9 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 16, 2017

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

Searchable as RT132459$

@p5pRT
Copy link
Author

p5pRT commented Nov 16, 2017

From Ulrich.Windl@rz.uni-regensburg.de

This is a bug report for perl from Ulrich.Windl@​rz.uni-regensburg.de,
generated with the help of perlbug 1.39 running under perl 5.18.2.


[Please describe your issue here]
When using Perl with "use warnings" and "use strict", a TAB-completion
for array variable @​loop_indices in the debugger fails with the following
message when used for the first time​:

  DB<3> x @​looCan't use string ("​::") as a HASH ref while "strict refs" in =
use at /usr/lib/perl5/5.18.2/perl5db.pl line 9519.
at /usr/lib/perl5/5.18.2/perl5db.pl line 9519.
  DB​::db_complete('@​loo', 'x @​loo', 2) called at /usr/lib/perl5/vendor_pe=
rl/5.18.2/x86_64-linux-thread-multi/Term/ReadLine/Gnu/XS.pm line 574
  Term​::ReadLine​::Gnu​::XS​::_trp_completion_function('@​loo', 0) called at =
/usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi/Term/ReadLine/G=
nu.pm line 719
  Term​::ReadLine​::Gnu​::AU​::__ANON__[/usr/lib/perl5/vendor_perl/5.18.2/x86=
_64-linux-thread-multi/Term/ReadLine/Gnu.pm​:719]('Term​::ReadLine=3DHASH(0x2=
273828)', '\x{1}\x{1b}[4m\x{2} DB<3> \x{1}\x{1b}[24m\x{2}') called at =
/usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi/Term/ReadLine/G=
nu.pm line 331
  Term​::ReadLine​::Gnu​::readline('Term​::ReadLine=3DHASH(0x2273828)', ' =
DB<3> ') called at /usr/lib/perl5/5.18.2/perl5db.pl line 7287
  DB​::readline(' DB<3> ') called at /usr/lib/perl5/5.18.2/perl5db.pl =
line 1832
  DB​::_DB__read_next_cmd(undef) called at /usr/lib/perl5/5.18.2/perl5db.p=
l line 2747
  DB​::DB called at -e line 1
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.

When tried a second time, Perl quits, leaving the tty in raw state (need a
"stty sane")​:

  DB<3> x @​looCan't use string ("​::") as a HASH ref while "strict refs" in =
use at /usr/lib/perl5/5.18.2/perl5db.pl line 9519.
END failed--call queue aborted at -e line 4209.
at -e line 4209.

Cited line of perl5db.pl reads​:
  push @​out, map "$prefix$_", grep /^\Q$text/,
  ( grep /^_?[a-zA-Z]/, keys %$pack ),
  ( $pack eq '​::' ? () : ( grep /​::$/, keys %​:: ) );

Finally, for the nerds, there is a compressed uuencoded typescript of a
sample session​:

@p5pRT
Copy link
Author

p5pRT commented Nov 16, 2017

@p5pRT
Copy link
Author

p5pRT commented Nov 20, 2017

From @jkeenan

On Thu, 16 Nov 2017 22​:05​:38 GMT, Ulrich.Windl@​rz.uni-regensburg.de wrote​:

This is a bug report for perl from Ulrich.Windl@​rz.uni-regensburg.de,
generated with the help of perlbug 1.39 running under perl 5.18.2.

-----------------------------------------------------------------
[Please describe your issue here]
When using Perl with "use warnings" and "use strict", a TAB-completion
for array variable @​loop_indices in the debugger fails with the following
message when used for the first time​:

DB<3> x @​looCan't use string ("​::") as a HASH ref while "strict refs" in =
use at /usr/lib/perl5/5.18.2/perl5db.pl line 9519.
at /usr/lib/perl5/5.18.2/perl5db.pl line 9519.
DB​::db_complete('@​loo', 'x @​loo', 2) called at /usr/lib/perl5/vendor_pe=
rl/5.18.2/x86_64-linux-thread-multi/Term/ReadLine/Gnu/XS.pm line 574
Term​::ReadLine​::Gnu​::XS​::_trp_completion_function('@​loo', 0) called at =
/usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi/Term/ReadLine/G=
nu.pm line 719
Term​::ReadLine​::Gnu​::AU​::__ANON__[/usr/lib/perl5/vendor_perl/5.18.2/x86=
_64-linux-thread-multi/Term/ReadLine/Gnu.pm​:719]('Term​::ReadLine=3DHASH(0x2=
273828)', '\x{1}\x{1b}[4m\x{2} DB<3> \x{1}\x{1b}[24m\x{2}') called at =
/usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi/Term/ReadLine/G=
nu.pm line 331
Term​::ReadLine​::Gnu​::readline('Term​::ReadLine=3DHASH(0x2273828)', ' =
DB<3> ') called at /usr/lib/perl5/5.18.2/perl5db.pl line 7287
DB​::readline(' DB<3> ') called at /usr/lib/perl5/5.18.2/perl5db.pl =
line 1832
DB​::_DB__read_next_cmd(undef) called at /usr/lib/perl5/5.18.2/perl5db.p=
l line 2747
DB​::DB called at -e line 1
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.

When tried a second time, Perl quits, leaving the tty in raw state (need a
"stty sane")​:

DB<3> x @​looCan't use string ("​::") as a HASH ref while "strict refs" in =
use at /usr/lib/perl5/5.18.2/perl5db.pl line 9519.
END failed--call queue aborted at -e line 4209.
at -e line 4209.

Cited line of perl5db.pl reads​:
push @​out, map "$prefix$_", grep /^\Q$text/,
( grep /^_?[a-zA-Z]/, keys %$pack ),
( $pack eq '​::' ? () : ( grep /​::$/, keys %​:: ) );

Finally, for the nerds, there is a compressed uuencoded typescript of a
sample session​:

Would you be able to attach a short Perl program which a reader could step through with the debugger and which would illustrate the problems you are encountering?

No more than 10 lines should be necessary.

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Nov 20, 2017

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Nov 21, 2017

From Ulrich.Windl@rz.uni-regensburg.de

"James E Keenan via RT" <perlbug-followup@​perl.org> schrieb am 20.11.2017 um
15​:47 in Nachricht <rt-4.0.24-6198-1511189264-704.132459-94-0@​perl.org>​:
On Thu, 16 Nov 2017 22​:05​:38 GMT, Ulrich.Windl@​rz.uni-regensburg.de wrote​:

[..]

Finally, for the nerds, there is a compressed uuencoded typescript of a
sample session​:

Would you be able to attach a short Perl program which a reader could step
through with the debugger and which would illustrate the problems you are
encountering?

No more than 10 lines should be necessary.

Being surprised that people are unable to uudecode, there is the plaintext (copy&paste) version of the uuencoded part of the original bug report​:
----replay from here ;-) ---------
Skript gestartet auf Do 16 Nov 2017 22​:38​:26 CET
user@​host​:/tmp> perl -d -e 1 -w

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.

main​::(-e​:1)​: 1
  DB<1> use strict

  DB<2> @​loop_indices

  DB<3> x @​looCan't use string ("​::") as a HASH ref while "strict refs" in use at /usr/lib/perl5/5.18.2/perl5db.pl line 9519.
at /usr/lib/perl5/5.18.2/perl5db.pl line 9519.
  DB​::db_complete('@​loo', 'x @​loo', 2) called at /usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi/Term/ReadLine/Gnu/XS.pm line 574
  Term​::ReadLine​::Gnu​::XS​::_trp_completion_function('@​loo', 0) called at /usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi/Term/ReadLine/Gnu.pm line 719
  Term​::ReadLine​::Gnu​::AU​::__ANON__[/usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi/Term/ReadLine/Gnu.pm​:719]('Term​::ReadLine=HASH(0x2273828)', '\x{1}\x{1b}[4m\x{2} DB<3> \x{1}\x{1b}[24m\x{2}') called at /usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi/Term/ReadLine/Gnu.pm line 331
  Term​::ReadLine​::Gnu​::readline('Term​::ReadLine=HASH(0x2273828)', ' DB<3> ') called at /usr/lib/perl5/5.18.2/perl5db.pl line 7287
  DB​::readline(' DB<3> ') called at /usr/lib/perl5/5.18.2/perl5db.pl line 1832
  DB​::_DB__read_next_cmd(undef) called at /usr/lib/perl5/5.18.2/perl5db.pl line 2747
  DB​::DB called at -e line 1
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<3> x @​looCan't use string ("​::") as a HASH ref while "strict refs" in use at /usr/lib/perl5/5.18.2/perl5db.pl line 9519.
END failed--call queue aborted at -e line 4209.
at -e line 4209.
user@​host​:/tmp> exit

Skript beendet​: Do 16 Nov 2017 22​:39​:18 CET
----stop replaying------

Regards,
Ulrich

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Nov 21, 2017

From @eserte

Dana Mon, 20 Nov 2017 23​:33​:01 -0800, Ulrich.Windl@​rz.uni-regensburg.de reče​:

"James E Keenan via RT" <perlbug-followup@​perl.org> schrieb am
20.11.2017 um
15​:47 in Nachricht <rt-4.0.24-6198-1511189264-704.132459-94-
0@​perl.org>​:
On Thu, 16 Nov 2017 22​:05​:38 GMT, Ulrich.Windl@​rz.uni-regensburg.de
wrote​:

[..]

Finally, for the nerds, there is a compressed uuencoded typescript
of a
sample session​:

Would you be able to attach a short Perl program which a reader could
step
through with the debugger and which would illustrate the problems you
are
encountering?

No more than 10 lines should be necessary.

Being surprised that people are unable to uudecode, there is the
plaintext (copy&paste) version of the uuencoded part of the original
bug report​:
----replay from here ;-) ---------
Skript gestartet auf Do 16 Nov 2017 22​:38​:26 CET
user@​host​:/tmp> perl -d -e 1 -w

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.

main​::(-e​:1)​: 1
DB<1> use strict

DB<2> @​loop_indices

DB<3> x @​looCan't use string ("​::") as a HASH ref while "strict refs"
in use at /usr/lib/perl5/5.18.2/perl5db.pl line 9519.
at /usr/lib/perl5/5.18.2/perl5db.pl line 9519.
DB​::db_complete('@​loo', 'x @​loo', 2) called at
/usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-
multi/Term/ReadLine/Gnu/XS.pm line 574
Term​::ReadLine​::Gnu​::XS​::_trp_completion_function('@​loo', 0)
called at /usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-
multi/Term/ReadLine/Gnu.pm line 719
Term​::ReadLine​::Gnu​::AU​::__ANON__[/usr/lib/perl5/vendor_perl/5.18.2/x86_64-
linux-thread-
multi/Term/ReadLine/Gnu.pm​:719]('Term​::ReadLine=HASH(0x2273828)',
'\x{1}\x{1b}[4m\x{2} DB<3> \x{1}\x{1b}[24m\x{2}') called at
/usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-
multi/Term/ReadLine/Gnu.pm line 331
Term​::ReadLine​::Gnu​::readline('Term​::ReadLine=HASH(0x2273828)',
' DB<3> ') called at /usr/lib/perl5/5.18.2/perl5db.pl line 7287
DB​::readline(' DB<3> ') called at
/usr/lib/perl5/5.18.2/perl5db.pl line 1832
DB​::_DB__read_next_cmd(undef) called at
/usr/lib/perl5/5.18.2/perl5db.pl line 2747
DB​::DB called at -e line 1
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<3> x @​looCan't use string ("​::") as a HASH ref while "strict refs"
in use at /usr/lib/perl5/5.18.2/perl5db.pl line 9519.
END failed--call queue aborted at -e line 4209.
at -e line 4209.
user@​host​:/tmp> exit

Skript beendet​: Do 16 Nov 2017 22​:39​:18 CET
----stop replaying------

I can reproduce the problem with perl 5.18.2, and cannot reproduce it with 5.18.4 or later perls.

Regards,
  Slaven

@p5pRT
Copy link
Author

p5pRT commented Nov 21, 2017

From Ulrich.Windl@rz.uni-regensburg.de

"slaven@​rezic.de via RT" <perlbug-followup@​perl.org> schrieb am 21.11.2017
um
09​:13 in Nachricht <rt-4.0.24-12724-1511251994-628.132459-94-0@​perl.org>​:
Dana Mon, 20 Nov 2017 23​:33​:01 -0800, Ulrich.Windl@​rz.uni-regensburg.de
reče​:

[...]

I can reproduce the problem with perl 5.18.2, and cannot reproduce it with
5.18.4 or later perls.

Can you tell which module had been fixed to solve the issue? Preferrably show
the minimal diff ;-)

Regards,
Ulrich

@p5pRT
Copy link
Author

p5pRT commented Nov 21, 2017

From @eserte

Dana Tue, 21 Nov 2017 00​:21​:26 -0800, Ulrich.Windl@​rz.uni-regensburg.de reče​:

"slaven@​rezic.de via RT" <perlbug-followup@​perl.org> schrieb am
21.11.2017
um
09​:13 in Nachricht <rt-4.0.24-12724-1511251994-628.132459-94-
0@​perl.org>​:
Dana Mon, 20 Nov 2017 23​:33​:01 -0800, Ulrich.Windl@​rz.uni-
regensburg.de
reče​:

[...]

I can reproduce the problem with perl 5.18.2, and cannot reproduce it
with
5.18.4 or later perls.

Can you tell which module had been fixed to solve the issue?
Preferrably show
the minimal diff ;-)

Regards,
Ulrich

perl5184delta says​:

  * perl5db.pl has been upgraded from version 1.39_10 to 1.39_11.

  This fixes a crash in tab completion, where available. [perl #120827]

@p5pRT
Copy link
Author

p5pRT commented Nov 28, 2017

@iabyn - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant