Perl / perl5

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

Missing semicolon after `no warnings' crashes Perl #7449

Closed p5pRT closed 20 years ago

p5pRT commented 20 years ago

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

Searchable as RT30965$

p5pRT commented 20 years ago

From DanVDascalescu@yahoo.com

Created by danvdascalescu@yahoo.com

The following (incorrect) code crashed ActiveState perl 5.8.4 with the error signature below​:

AppName​: perl.exe AppVer​: 5.8.4.810 ModName​: perl58.dll ModVer​: 5.8.4.810 Offset​: 0002286a

sub a {   my %b = c(); # necessary to fill a scratchpad   if (1) {   no warnings # or `no bugs' for that matter :-)   sub d { 4 }   } }

Hope this helps\, Dan Dascalescu

-- I Do Not Yahoo! Get rid of ads and banners in e-mail with Proxmail! http​://proxmail.notlong.com

Perl Info ``` Flags: category=core severity=low Site configuration information for perl v5.8.4: Configured by ActiveState at Tue Jun 1 11:52:09 2004. Summary of my perl5 (revision 5 version 8 subversion 4) configuration: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=undef use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX', optimize='-MD -Zi -DNDEBUG -O1', cppflags='-DWIN32' ccversion='', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -libpath:"C:\Perl\lib\CORE" -machine:x86' libpth=C:\PROGRA~1\MICROS~3\VC98\lib libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib gnulibc_version='undef' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf -libpath:"C:\Perl\lib\CORE" -machine:x86' Locally applied patches: ACTIVEPERL_LOCAL_PATCHES_ENTRY 22751 Update to Test.pm 1.25 21540 Fix backward-compatibility issues in if.pm @INC for perl v5.8.4: c:/Perl/lib c:/Perl/site/lib . Environment for perl v5.8.4: HOME (unset) LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=c:\Perl\bin;c:\dn\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\nls PERLDB_OPTS=RemotePort=127.0.0.1:2000 PERL_BADLANG (unset) SHELL (unset) ```
p5pRT commented 20 years ago

From @nwc10

On Fri\, Aug 06\, 2004 at 08​:52​:23AM -0000\, Dan Dascalescu wrote​:

----------------------------------------------------------------- [Please enter your report here]

The following (incorrect) code crashed ActiveState perl 5.8.4 with the error signature below​:

AppName​: perl.exe AppVer​: 5.8.4.810 ModName​: perl58.dll ModVer​: 5.8.4.810 Offset​: 0002286a

sub a { my %b = c(); # necessary to fill a scratchpad if (1) { no warnings # or `no bugs' for that matter :-) sub d { 4 } } }

Thanks for the report. I can recreate this with a threaded perl build of 5.8.5 on Linux. It's not present in development perl.

valgrind shows the following\, which doesn't get me any further but might help someone else​:

$ valgrind ./perl -Ilib ==8960== Memcheck\, a memory error detector for x86-linux. ==8960== Copyright (C) 2002-2004\, and GNU GPL'd\, by Julian Seward et al. ==8960== Using valgrind-2.1.2\, a program supervision framework for x86-linux. ==8960== Copyright (C) 2000-2004\, and GNU GPL'd\, by Julian Seward et al. ==8960== For more details\, rerun with​: -v ==8960== sub a {   my %b = c(); # necessary to fill a scratchpad   if (1) {   no warnings # or `no bugs' for that matter :-)   sub d { 4 }   } } ==8960== Invalid read of size 4 ==8960== at 0x80AD8CC​: Perl_pad_free (pad.c​:1165) ==8960== by 0x8097525​: Perl_op_clear (op.c​:460) ==8960== by 0x80970B4​: Perl_op_free (op.c​:324) ==8960== by 0x8097051​: Perl_op_free (op.c​:312) ==8960== Address 0x1BB31960 is 0 bytes after a block of size 16 alloc'd ==8960== at 0x1B904EDD​: malloc (vg_replace_malloc.c​:131) ==8960== by 0x80C5311​: Perl_safesysmalloc (util.c​:67) ==8960== by 0x80DB0B0​: Perl_av_extend (av.c​:158) ==8960== by 0x80DB972​: Perl_av_store (av.c​:322) syntax error at - line 5\, near "no warnings # or `no bugs' for that matter :-)   sub d " syntax error at - line 6\, near "}" Execution of - aborted due to compilation errors. ==8960== warning​: Valgrind's siglongjmp is incomplete ==8960== (it ignores cleanup handlers) ==8960== your program may misbehave as a result ==8960== ==8960== ERROR SUMMARY​: 1 errors from 1 contexts (suppressed​: 23 from 1) ==8960== malloc/free​: in use at exit​: 222148 bytes in 636 blocks. ==8960== malloc/free​: 772 allocs\, 136 frees\, 241295 bytes allocated. ==8960== For a detailed leak analysis\, rerun with​: --leak-check=yes ==8960== For counts of detected errors\, rerun with​: -v

And one } is left unread on stdin\, and gets to the shell.

Nicholas Clark

p5pRT commented 20 years ago

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

p5pRT commented 20 years ago

From @iabyn

On Sat\, Aug 07\, 2004 at 10​:04​:18PM +0100\, Nicholas Clark wrote​:

On Fri\, Aug 06\, 2004 at 08​:52​:23AM -0000\, Dan Dascalescu wrote​:

----------------------------------------------------------------- [Please enter your report here]

The following (incorrect) code crashed ActiveState perl 5.8.4 with the error signature below​:

AppName​: perl.exe AppVer​: 5.8.4.810 ModName​: perl58.dll ModVer​: 5.8.4.810 Offset​: 0002286a

sub a { my %b = c(); # necessary to fill a scratchpad if (1) { no warnings # or `no bugs' for that matter :-) sub d { 4 } } }

Thanks for the report. I can recreate this with a threaded perl build of 5.8.5 on Linux. It's not present in development perl.

This was 'fixed' in bleedperl by the transition fromn yacc to bison\, #22302 - although in theory that shouldn't have fixed it - it was just a coincidence of the way bison does its error handling. The real fix\, which was then applied on top of this\, was #22306. But applying that fix to old-style yacc setup was such a pain that it was the original motivation for me to do the whole yacc -> bison thing.

Dave.

-- "There's something wrong with our bloody ships today\, Chatfield."   -- Admiral Beatty at the Battle of Jutland\, 31st May 1916.

p5pRT commented 20 years ago

From @nwc10

On Sun\, Aug 08\, 2004 at 12​:09​:04PM +0100\, Dave Mitchell wrote​:

This was 'fixed' in bleedperl by the transition fromn yacc to bison\, #22302 - although in theory that shouldn't have fixed it - it was just a coincidence of the way bison does its error handling. The real fix\, which was then applied on top of this\, was #22306. But applying that fix to old-style yacc setup was such a pain that it was the original motivation for me to do the whole yacc -> bison thing.

This is what I feared it might be. I've still not found anyone able to verify that the yacc -> bison changes work on MVS. I'd like to know this before merging it to maint.

Hence resolving this bug in the 5.8.x releases depends on that.

Nicholas Clark

p5pRT commented 20 years ago

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

p5pRT commented 20 years ago

From @rspier

This is what I feared it might be. I've still not found anyone able to verify that the yacc -> bison changes work on MVS. I'd like to know this before merging it to maint.

http​://www.conmicro.cx/hercules/ might get us the "hardware".

Now we just need a legal copy of the OS to run on it.

""" OS/360 (PCP\, MFT and MVT) is in the public domain\, as far as we know. The status of OSes for which IBM did not charge a license fee is somewhat murky; these include MVS 3.8\, VM/370 release 6\, and DOS/VS release 34. """   -http​://www.conmicro.cx/hercules/hercfaq.html

The hercfaq goes on to point out some places where you can get those freeish things\, including​: http​://www.bsp-gmbh.com/turnkey/tk3_faq.html which looks interesting.

I'm tempted to try these out\, but we probably actually want to make sure it runs on _modern_ systems\, not old ones. And\, the fact that I don't know JCL doesn't really bother me.

-R (off to play with da dogs)