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

Debugger loops infinitely with __DIE__ and DESTROY #9358

Closed
p5pRT opened this issue May 30, 2008 · 7 comments
Closed

Debugger loops infinitely with __DIE__ and DESTROY #9358

p5pRT opened this issue May 30, 2008 · 7 comments

Comments

@p5pRT
Copy link

p5pRT commented May 30, 2008

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

Searchable as RT55084$

@p5pRT
Copy link
Author

p5pRT commented May 30, 2008

From @pjscott

If you run the following, be prepared to kill it from another window​:

  #!/usr/bin/perl -d

  sub Foo​::new { bless {} , "Foo" }
  sub Foo​::DESTROY { 1 }

  BEGIN {
  $SIG{__DIE__} = sub {
  my $foo = Foo->new;
  exit;
  };
  }

It will print the line

  Foo​::DESTROY(/tmp/foo​:4)​: sub Foo​::DESTROY { 1 }

repeatedly and be unstoppable from its own window.

This goes waaaay back. It behaves as described in 5.10.0, 5.8.8,
5.6.1. In 5.004 it just hangs. Same behavior on Linux and Solaris.

FWIW​:

Summary of my perl5 (revision 5 version 10 subversion 0) configuration​:
  Platform​:
  osname=linux, osvers=2.6.16-1.2133_fc5, archname=i686-linux
  uname='linux tweety 2.6.16-1.2133_fc5 #1 tue jun 6 00​:52​:14 edt
2006 i686 athlon i386 gnulinux '
  config_args='-des -DDEBUGGING'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=undef, usemultiplicity=undef
  useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
  use64bitint=undef, use64bitall=undef, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-DDEBUGGING -fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/include/gdbm',
  optimize='-O2 -g',
  cppflags='-DDEBUGGING -fno-strict-aliasing -pipe
-I/usr/local/include -I/usr/include/gdbm'
  ccversion='', gccversion='4.1.1 20060525 (Red Hat 4.1.1-1)',
gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
  ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
  alignbytes=4, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags =' -L/usr/local/lib'
  libpth=/usr/local/lib /lib /usr/lib
  libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
  perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
  libc=/lib/libc-2.4.so, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version='2.4'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
  cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib'

Characteristics of this binary (from libperl)​:
  Compile-time options​: DEBUGGING PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP
  USE_LARGE_FILES USE_PERLIO
  Built under linux
  Compiled at Dec 26 2007 19​:03​:58
  @​INC​:
  /usr/local/lib/perl5/5.10.0/i686-linux
  /usr/local/lib/perl5/5.10.0
  /usr/local/lib/perl5/site_perl/5.10.0/i686-linux
  /usr/local/lib/perl5/site_perl/5.10.0
  /usr/local/lib/perl5/site_perl/5.8.8
  /usr/local/lib/perl5/site_perl
  .
--
Peter Scott
Pacific Systems Design Technologies

@p5pRT
Copy link
Author

p5pRT commented May 25, 2012

From @jkeenan

On Fri May 30 10​:15​:59 2008, Peter@​PSDT.com wrote​:

If you run the following, be prepared to kill it from another window​:

#!/usr/bin/perl -d

sub Foo​::new { bless {} , "Foo" }
sub Foo​::DESTROY { 1 }

BEGIN {
$SIG{__DIE__} = sub {
my $foo = Foo->new;
exit;
};
}

It will print the line

Foo​::DESTROY(/tmp/foo​:4)​: sub Foo​::DESTROY { 1 }

repeatedly and be unstoppable from its own window.

This goes waaaay back. It behaves as described in 5.10.0, 5.8.8,
5.6.1. In 5.004 it just hangs. Same behavior on Linux and Solaris.

I tried this tonight on both Darwin/PPC and Linux/i386, both with Perl
5.16.0. I got the output Peter described, but on each machine the
process segfaulted after about 1.5 seconds. I couldn't move quickly
enough to kill the process myself.

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented May 25, 2012

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

@p5pRT
Copy link
Author

p5pRT commented Aug 26, 2013

From @kevindawson

$ perl 55084.pl
$ PERLDB_OPTS="dieLevel=1" perl -d 55084.pl

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​::(55084.pl​:17)​: exit(0);
  DB<1> c
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
$ PERLDB_OPTS="dieLevel=0" perl -d 55084.pl
Die handler removed.

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​::(55084.pl​:17)​: exit(0);
  DB<1> c
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

imho this is was fixed in shlom-fish wake and thus closed

@p5pRT
Copy link
Author

p5pRT commented Aug 26, 2013

From @kevindawson

55084.pl

@p5pRT
Copy link
Author

p5pRT commented Aug 26, 2013

From [Unknown Contact. See original ticket]

$ perl 55084.pl
$ PERLDB_OPTS="dieLevel=1" perl -d 55084.pl

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​::(55084.pl​:17)​: exit(0);
  DB<1> c
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
$ PERLDB_OPTS="dieLevel=0" perl -d 55084.pl
Die handler removed.

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​::(55084.pl​:17)​: exit(0);
  DB<1> c
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

imho this is was fixed in shlom-fish wake and thus closed

@p5pRT
Copy link
Author

p5pRT commented Sep 7, 2013

@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
Projects
None yet
Development

No branches or pull requests

1 participant