Perl / perl5

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

sigsegv with perl 5.6 #1811

Closed p5pRT closed 20 years ago

p5pRT commented 24 years ago

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

Searchable as RT3073$

p5pRT commented 24 years ago

From pixel@mandrakesoft.com

Created by pixel@kenobi.mandrakesoft.com

Smallest i got​:

******************** foreach (\){   s/_//;   $o[$_] = 1; }

__DATA__ _a ********************  

Perl Info ``` Flags: category=core severity=low Site configuration information for perl v5.6.0: Configured by pixel at Fri Mar 31 16:32:49 CEST 2000. Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=linux, osvers=2.2.15-0.16mdksmp, archname=i386-linux uname='linux kenobi.mandrakesoft.com 2.2.15-0.16mdksmp #1 smp mon mar 13 16:40:10 cet 2000 i686 unknown ' config_args='-des -Dprefix=/usr -Darchname=i386-linux -Dd_dosuid -Dd_semctl_semun -Di_db -Di_ndbm -Di_gdbm -Ud_csh -Dman3dir=/usr/lib/perl5/man/man3 -Doptimize=-O3 -fomit-frame-pointer -fno-exceptions -fno-rtti -pipe -s -mpentium -mcpu=pentium -march=pentium -ffast-math -fexpensive-optimizations' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef Compiler: cc='cc', optimize='-O3 -fomit-frame-pointer -fno-exceptions -fno-rtti -pipe -s -mpentium -mcpu=pentium -march=pentium -ffast-math -fexpensive-optimizations', gccversion=2.95.3 19991030 (prerelease) cppflags='-fno-strict-aliasing' ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' stdchar='char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 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 -ldl -lm -lc -lposix -lcrypt 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 v5.6.0: /home/pixel/etc/perl/i386-linux /home/pixel/etc/perl /home/pixel/etc/perl/i386-linux /home/pixel/etc/perl/site_perl /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 /usr/lib/perl5/site_perl . Environment for perl v5.6.0: HOME=/home/pixel LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH=/home/pixel/lib/i386 LOGDIR (unset) PATH=/home/pixel/bin:/home/pixel/bin/oneliner:/home/pixel/bin/perl:/home/pixel/bin/python:/home/pixel/bin/tcl:/home/pixel/bin/i386:/usr/freeware/bin:/usr/etc:/usr/local/bin:/usr/X11R6/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/pixel/bin PERL5LIB=/home/pixel/etc/perl:/home/pixel/etc/perl/i386-linux:/home/pixel/etc/perl/site_perl PERL_BADLANG (unset) SHELL=/bin/zsh ```
p5pRT commented 24 years ago

From [Unknown Contact. See original ticket]

Pixel writes​:

foreach (\){ s/_//; $o[$_] = 1; }

__DATA__ _a

Here is the bt on the core​:

  [1] free(0x126815\, 0x0\, 0x0\, 0x0\, 0x0\, 0x0)\, at 0x33b64   [2] Perl_sv_clear(0x0\, 0x0\, 0x0\, 0x0\, 0x0\, 0x0)\, at 0x99b58   [3] Perl_sv_free(0x127160\, 0x0\, 0x0\, 0x0\, 0x0\, 0x0)\, at 0x99e70   [4] Perl_free_tmps(0x2\, 0x125d7c\, 0x121024\, 0xffffffff\, 0x0\, 0x6860006)\, at 0xb5090 =>[5] perl_run(my_perl = 0x126804)\, line 1331 in "perl.c"   [6] main(0x0\, 0x125480\, 0xffbeedec\, 0x119c00\, 0x0\, 0x0)\, at 0x2790c

Note sv_clear(0).

Ilya

p5pRT commented 24 years ago

From @gsar

On Mon\, 10 Apr 2000 17​:00​:59 EDT\, Ilya Zakharevich wrote​:

Pixel writes​:

foreach (\){ s/_//; $o[$_] = 1; }

__DATA__ _a

Here is the bt on the core​:

[1] free(0x126815\, 0x0\, 0x0\, 0x0\, 0x0\, 0x0)\, at 0x33b64 [2] Perl_sv_clear(0x0\, 0x0\, 0x0\, 0x0\, 0x0\, 0x0)\, at 0x99b58 [3] Perl_sv_free(0x127160\, 0x0\, 0x0\, 0x0\, 0x0\, 0x0)\, at 0x99e70 [4] Perl_free_tmps(0x2\, 0x125d7c\, 0x121024\, 0xffffffff\, 0x0\, 0x6860006)\, at 0xb5090 =>[5] perl_run(my_perl = 0x126804)\, line 1331 in "perl.c" [6] main(0x0\, 0x125480\, 0xffbeedec\, 0x119c00\, 0x0\, 0x0)\, at 0x2790c

Note sv_clear(0).

Here's the fix for that.

Sarathy gsar@​activestate.com

Inline Patch ```diff -----------------------------------8<----------------------------------- Change 5983 by gsar@auger on 2000/04/28 07:15:04 numeric conversion of non-number in change#3378 tramples on OOK offset, causing segfaults Affected files ... ... //depot/perl/sv.c#228 edit Differences ... ==== //depot/perl/sv.c#228 (text) ==== Index: perl/sv.c --- perl/sv.c.~1~ Fri Apr 28 00:15:08 2000 +++ perl/sv.c Fri Apr 28 00:15:08 2000 @@ -1483,8 +1483,8 @@ if (SvTYPE(sv) < SVt_PVIV) sv_upgrade(sv, SVt_PVIV); + (void)SvIOK_on(sv); SvIVX(sv) = 0; - (void)SvIOK_on(sv); if (ckWARN(WARN_NUMERIC)) not_a_number(sv); } @@ -1637,10 +1637,10 @@ if (SvTYPE(sv) < SVt_PVIV) sv_upgrade(sv, SVt_PVIV); + (void)SvIOK_on(sv); + (void)SvIsUV_on(sv); SvUVX(sv) = 0; /* We assume that 0s have the same bitmap in IV and UV. */ - (void)SvIOK_on(sv); - (void)SvIsUV_on(sv); if (ckWARN(WARN_NUMERIC)) not_a_number(sv); } End of Patch. ```