develooper Front page | perl.perl5.porters | Postings from November 2015

[perl #126735] Can not quit from perl debugger by 'q'

Thread Previous | Thread Next
From:
Shlomi Fish via RT
Date:
November 28, 2015 08:55
Subject:
[perl #126735] Can not quit from perl debugger by 'q'
Message ID:
rt-4.0.18-15298-1448700898-891.126735-15-0@perl.org
Hi KES,

On Fri Nov 27 03:44:52 2015, kes-kes@yandex.ua wrote:
> No, this patch does not fix the problem.

Really? How did you apply it? Did you run "make install"? This patch was done against bleadperl - is that what you used? This patch worked perfectly well here with bleadperl.

> The output:
> 
> perl -d t.pl
> Unable to connect to remote host: keswork:9001
> Compilation failed in require.
> at t.pl line 0.
>        main::BEGIN() called at t.pl line 0
>        eval {...} called at t.pl line 0
> BEGIN failed--compilation aborted.
> at t.pl 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> q
> syntax error at (eval 10)[/home/kes/perl/lib/5.22.0/perl5db.pl:737]
> line 4, at EOF
>  (Might be a runaway multi-line ;; string starting on line 2)
> 
> DB<1>
> 

What are the contents of t.pl? The error you are getting from it initially is really strange. 

> 
> Maybe you need "q\n" in your testcase? (NOTICE: \n)
> 

It's not a bad idea to add it, but I believe it's not necessary, because the STDIN will get an EOF.

Regards,

-- Shlomi Fish

> 26.11.2015, 22:25, "Shlomi Fish via RT" <perlbug-followup@perl.org>:
> > On Thu Nov 26 00:57:44 2015, kes-kes@yandex.ua wrote:
> >>  To: perlbug@perl.org
> >>  Subject: Can not quit from perl debugger by 'q'
> >>  Cc: kes-kes@yandex.ru
> >>  Reply-To: kes-kes@yandex.ru
> >>  Message-Id: <5.22.0_28030_1448525199@keswork>
> >>  From: kes-kes@yandex.ru
> >>
> >>  This is a bug report for perl from kes-kes@yandex.ru,
> >>  generated with the help of perlbug 1.40 running under perl 5.22.0.
> >>
> >>  -----------------------------------------------------------------
> >>  [Please describe your issue here]
> >>
> >>  When I try debug script remotely I set:
> >>
> >>  PERLDB_OPTS=RemotePort=keswork:9001
> >>
> >>  and if the nobody occasionally listen that port
> >>  I can not exit from debugger, even can not run any command
> >>  Only CTRL+C works.
> >
> > Thanks for the report, kes! The problem happens when one specifies a
> > RemotePort that cannot be connected to. Attached is a patch to fix
> > the problem on mostly recent bleadperl. It passes all tests and adds
> > some new test assertions. The patch was caused by a lexical variable
> > in lib/perl5db.pl that was used in the BEGIN stage before being
> > initialised. I believe it was I who introduced this variable as part
> > of the massive debugger refactoring I have done as part of one of my
> > TPF grants, and it wasn't caught due to inadequate test coverage.
> >
> > I ran into some problems getting the tests not to hang but they
> > should be OK now.
> >
> > Please look into applying it.
> >
> > Regards,
> >
> > -- Shlomi Fish
> >
> > ,
> >
> > diff --git a/lib/perl5db.pl b/lib/perl5db.pl
> > index 0d240ae..884f67a 100644
> > --- a/lib/perl5db.pl
> > +++ b/lib/perl5db.pl
> > @@ -2490,7 +2490,11 @@ EOP
> >  # 'm' is method.
> >  # 'v' is the value (i.e: method name or subroutine ref).
> >  # 's' is subroutine.
> > -my %cmd_lookup =
> > +my %cmd_lookup;
> > +
> > +BEGIN
> > +{
> > + %cmd_lookup =
> >  (
> >      '-' => { t => 'm', v => '_handle_dash_command', },
> >      '.' => { t => 's', v => \&_DB__handle_dot_command, },
> > @@ -2523,6 +2527,7 @@ my %cmd_lookup =
> >      (map { $_ => {t => 'm', v => '_handle_cmd_wrapper_commands' }, }
> >          qw(a A b B e E h i l L M o O v w W)),
> >  );
> > +};
> >
> >  sub DB {
> >
> > diff --git a/lib/perl5db.t b/lib/perl5db.t
> > index 98a3686..6ac3932 100644
> > --- a/lib/perl5db.t
> > +++ b/lib/perl5db.t
> > @@ -29,7 +29,7 @@ BEGIN {
> >      $ENV{PERL_RL} = 'Perl'; # Suppress system Term::ReadLine::Gnu
> >  }
> >
> > -plan(121);
> > +plan(123);
> >
> >  my $rc_filename = '.perldb';
> >
> > @@ -2799,6 +2799,22 @@ SKIP:
> >      );
> >  }
> >
> > +{
> > + # perl 5 RT #126735 regression bug.
> > + local $ENV{PERLDB_OPTS} = "NonStop=0 RemotePort=non-existent-
> > host.tld:9001";
> > + my $output = runperl( stdin => 'q', stderr => 1, switches => [ '-d'
> > ], prog => '../lib/perl5db/t/fact' );
> > + like(
> > + $output,
> > + qr/^Unable to connect to remote host:/ms,
> > + 'Tried to connect.',
> > + );
> > + unlike(
> > + $output,
> > + qr/syntax error/,
> > + 'Can quit from the debugger after a wrong RemotePort',
> > + );
> > +}
> > +
> >  END {
> >      1 while unlink ($rc_filename, $out_fn);
> >  }




---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=126735

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About