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

const subs hurt under debugger #2902

Closed
p5pRT opened this issue Nov 27, 2000 · 8 comments
Closed

const subs hurt under debugger #2902

p5pRT opened this issue Nov 27, 2000 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 27, 2000

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

Searchable as RT4783$

@p5pRT
Copy link
Author

p5pRT commented Nov 27, 2000

From @andk

Created by [email protected]

Since patch 7389 we have a problem with Socket​::INET in the debugger.
I discovered it in conjunction with Net​::FTP, so here goes my testcase​:

# /usr/local/perl-5.7.0@​7389/bin/perl -de 'use Net​::FTP;$_ = Net​::FTP->new("localhost");'
Default die handler restored.

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

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

main​::(-e​:1)​: use Net​::FTP;$_ = Net​::FTP->new("localhost");
  DB<1> c
Signal SEGV at /usr/local/perl-5.7.0@​7389/lib/5.7.0/IO/Socket/INET.pm line 32
  IO​::Socket​::INET​::new('Net​::FTP', 'PeerAddr', 'localhost', 'PeerPort', 'ftp(21)', 'Proto', 'tcp', 'Timeout', ...) called at /usr/local/perl-5.7.0@​7389/lib/site_perl/5.7.0/Net/FTP.pm line 66
  Net​::FTP​::new('Net​::FTP', 'localhost') called at -e line 1

gdb reports

(gdb) bt
#0 0x4006fce1 in __kill () from /lib/libc.so.6
#1 0x8114601 in Perl_apply (type=286, mark=0x82e26c0, sp=0x82e26c0)
  at doio.c​:1612
#2 0x810a2f9 in Perl_pp_kill () at pp_sys.c​:3977
#3 0x80b78cc in Perl_runops_debug () at run.c​:56
#4 0x80f7484 in S_docatch_body () at pp_ctl.c​:2610
#5 0x80f755b in S_docatch (o=0x84584c8) at pp_ctl.c​:2637
#6 0x80fa6f2 in Perl_pp_require () at pp_ctl.c​:3290
#7 0x80b78cc in Perl_runops_debug () at run.c​:56
#8 0x805e8af in S_call_body (myop=0xbffff75c, is_eval=0) at perl.c​:1809
#9 0x805e1a0 in perl_call_sv (sv=0x8215e54, flags=2) at perl.c​:1686
#10 0x80b1232 in Perl_sighandler (sig=11) at mg.c​:2220
#11 0x4006fc08 in __restore ()
  at ../sysdeps/unix/sysv/linux/i386/sigaction.c​:127
#12 0x80c0565 in Perl_pp_entersub () at pp_hot.c​:2425
#13 0x80b78cc in Perl_runops_debug () at run.c​:56
#14 0x805dc0e in S_run_body (oldscope=1) at perl.c​:1447
#15 0x805d82d in perl_run (my_perl=0x8146a60) at perl.c​:1372
#16 0x805a72b in main (argc=3, argv=0xbffffa64, env=0xbffffa74)
  at perlmain.c​:52

Perl Info


This perlbug was built using Perl 5.00503 - Wed Feb  2 15:34:50 EST 2000
It is being executed now by  Perl 5.007 - Sun Oct 29 23:35:33 CET 2000.

Site configuration information for perl 5.007:

Configured by k at Sun Oct 29 23:35:33 CET 2000.

Summary of my perl5 (revision 5.0 version 7 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.16a, archname=i686-linux
    uname='linux ak-71.mind.de 2.2.16a #1 smp wed jun 14 11:59:53 cest 2000 i686 unknown '
    config_args='-Dprefix=/usr/local/perl-5.7.0@7489 -Doptimize=-g -des -Dusedevel'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='cc', ccflags ='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-g',
    cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)', 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, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lposix -lcrypt -lutil
    libc=/lib/libc-2.1.3.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    


@INC for perl 5.007:
    /usr/local/perl-5.7.0@7489/lib/5.7.0/i686-linux
    /usr/local/perl-5.7.0@7489/lib/5.7.0
    /usr/local/perl-5.7.0@7489/lib/site_perl/5.7.0/i686-linux
    /usr/local/perl-5.7.0@7489/lib/site_perl/5.7.0
    /usr/local/perl-5.7.0@7489/lib/site_perl
    .


Environment for perl 5.007:
    HOME=/home/k
    LANG=en_US
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/k/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/perl/bin:/usr/X11/bin:/sbin:/usr/sbin:/usr/local/Office51/bin
    PERL_BADLANG (unset)
    SHELL=/bin/zsh


@p5pRT
Copy link
Author

p5pRT commented Nov 29, 2000

From [Unknown Contact. See original ticket]

"Andreas J. Koenig" <k@​ak-71.mind.de> wrote​:

main​::(-e​:1)​: use Net​::FTP;$_ = Net​::FTP->new("localhost");
DB<1> c
Signal SEGV at /usr/local/perl-5.7.0@​7389/lib/5.7.0/IO/Socket/INET.pm line 32
IO​::Socket​::INET​::new('Net​::FTP', 'PeerAddr', 'localhost', 'PeerPort', 'ftp(21)', 'Proto', 'tcp', 'Timeout', ...) called at /usr/local/perl-5.7.0@​7389/lib/site_perl/5.7.0/Net/FTP.pm line 66
Net​::FTP​::new('Net​::FTP', 'localhost') called at -e line 1

This solves it for me.

(An alternative would be to set CvNODEBUG when we produce null CvGVs.
I'm less sure that the below will work, but I like it because it takes
out more lines than it adds. And all non-filt-util tests pass.)

-John

Inline Patch
--- perl@7892/op.c.dist	Tue Nov 28 00:56:32 2000
+++ perl@7892/op.c	Tue Nov 28 01:02:36 2000
@@ -4569,17 +4569,11 @@
     if (const_sv) {
 	SvREFCNT_inc(const_sv);
 	if (cv) {
-	    cv_undef(cv);
-#ifdef USE_THREADS
-	    New(666, CvMUTEXP(cv), 1, perl_mutex);
-	    MUTEX_INIT(CvMUTEXP(cv));
-	    CvOWNER(cv) = 0;
-#endif /* USE_THREADS */
+	    assert(!CvROOT(cv) && !CvCONST(cv));
 	    sv_setpv((SV*)cv, "");  /* prototype is "" */
 	    CvXSUBANY(cv).any_ptr = const_sv;
 	    CvXSUB(cv) = const_sv_xsub;
 	    CvCONST_on(cv);
-	    /* XXX Does anybody care that CvFILE(cv) is blank? */
 	}
 	else {
 	    GvCV(gv) = Nullcv;

@p5pRT
Copy link
Author

p5pRT commented Nov 29, 2000

From @andk

On Tue, 28 Nov 2000 01​:13​:41 -0500 (EST), John Tobey <jtobey@​john-edwin-tobey.org> said​:

  > This solves it for me.

So it does here. Thanks! I'll make this my default perl to give it
more exposure.

  > (An alternative would be to set CvNODEBUG when we produce null CvGVs.
  > I'm less sure that the below will work, but I like it because it takes
  > out more lines than it adds. And all non-filt-util tests pass.)

Are you aware that filt-util.t isn't in the MANIFEST anymore and needs
to be deleted? The tests are in filter-util now and pass for me.

@p5pRT
Copy link
Author

p5pRT commented Nov 29, 2000

From @vanstyn

In <m140e1N-000FOoC@​feynman.localnet>, John Tobey writes​:
:"Andreas J. Koenig" <k@​ak-71.mind.de> wrote​:
:
:> main​::(-e​:1)​: use Net​::FTP;$_ = Net​::FTP->new("localhost");
:> DB<1> c
:> Signal SEGV at /usr/local/perl-5.7.0@​7389/lib/5.7.0/IO/Socket/INET.pm line 3
:2
:> IO​::Socket​::INET​::new('Net​::FTP', 'PeerAddr', 'localhost', 'PeerPort
:', 'ftp(21)', 'Proto', 'tcp', 'Timeout', ...) called at /usr/local/perl-5.7.0@​
:7389/lib/site_perl/5.7.0/Net/FTP.pm line 66
:> Net​::FTP​::new('Net​::FTP', 'localhost') called at -e line 1
:
:This solves it for me.

This reverses a patch that I recently raised to solve a coredump. See
http​://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-10/msg01284.html
for my explanation of what happened, and why the patch is needed.

Hugo

@p5pRT
Copy link
Author

p5pRT commented Nov 29, 2000

From [Unknown Contact. See original ticket]

andreas.koenig@​anima.de (Andreas J. Koenig) wrote​:

On Tue, 28 Nov 2000 01​:13​:41 -0500 (EST), John Tobey <jtobey@​john-edwin-tobey.org> said​:

This solves it for me.

So it does here. Thanks! I'll make this my default perl to give it
more exposure.

Thanks.

(An alternative would be to set CvNODEBUG when we produce null CvGVs.
I'm less sure that the below will work, but I like it because it takes
out more lines than it adds. And all non-filt-util tests pass.)

Are you aware that filt-util.t isn't in the MANIFEST anymore and needs
to be deleted? The tests are in filter-util now and pass for me.

Ermm.. now I am, thanks. I guess I'll grab the update-a-perl script
next time. <GRIPE> while hoping for 5.7.1</GRIPE> <MOAN> while
dreaming of "cvs update"</MOAN>

-John

@p5pRT
Copy link
Author

p5pRT commented Nov 29, 2000

From @simoncozens

On Tue, Nov 28, 2000 at 11​:56​:41AM -0500, John Tobey wrote​:

<MOAN> while dreaming of "cvs update"</MOAN>

Hmph. What does that give you that
rsync -avz rsync​://ftp.linux.activestate.com/perl-current/ .
doesn't?

@p5pRT
Copy link
Author

p5pRT commented Nov 29, 2000

From [Unknown Contact. See original ticket]

Hugo <hv@​crypt.compulink.co.uk> wrote​:

This reverses a patch that I recently raised to solve a coredump. See
http​://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-10/msg01284.html
for my explanation of what happened, and why the patch is needed.

Removing cv_undef(cv) removes the need for the patch.

-John

@p5pRT
Copy link
Author

p5pRT commented Dec 5, 2000

From @vanstyn

In <m140oVW-000FOoC@​feynman.localnet>, John Tobey writes​:
:Hugo <hv@​crypt.compulink.co.uk> wrote​:
:
:> This reverses a patch that I recently raised to solve a coredump. See
:> http​://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-10/msg01284.html
:> for my explanation of what happened, and why the patch is needed.
:
:Removing cv_undef(cv) removes the need for the patch.

Ah, I'm sorry​: I hadn't spotted that the cv_undef() was also removed.

Hugo

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