FAQ
This is a bug report for perl from scott@gossamer-threads.com,
generated with the help of perlbug 1.28 running under perl v5.6.0.


-----------------------------------------------------------------
In perl versions 5.00401, 5.00404, and 5.00503 the following
causes a segv and core dump:
perl -wle 'local $main::foo->{bar}; $main::foo = {}; exit'

In perl version 5.6.0 the same code causes a segv but no
core dump.

If you remove the exit() call you get the warning:
"Attempt to free unreferenced scalar." on all the versions I
have mentioned.

A stack trace in gdb shows:
#0 0x809a353 in Perl_leave_scope ()
#1 0x8099335 in Perl_pop_scope ()
#2 0x805c0a8 in Perl_my_failure_exit ()
#3 0x805bf29 in Perl_my_exit ()
#4 0x809f85f in Perl_pp_exit ()
#5 0x80b155d in Perl_runops_standard ()
#6 0x8059308 in perl_run ()
#7 0x805787f in main ()
#8 0x400671eb in __libc_start_main (main=0x8057810 <main>, argc=3,
argv=0xbffffca4, init=0x8056b2c <_init>, fini=0x80b15cc <_fini>,
rtld_fini=0x4000a610 <_dl_fini>, stack_end=0xbffffc9c)
at ../sysdeps/generic/libc-start.c:90

These are the only version of perl I have to test this on
so I do not know if it applies to any other versions.

Cheers,

Scott

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=core
severity=low
---
Site configuration information for perl v5.6.0:

Configured by pixel at Wed Jan 31 09:11:40 CET 2001.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
Platform:
osname=linux, osvers=2.2.18-8mdksmp, archname=i386-linux
uname='linux no.mandrakesoft.com 2.2.18-8mdksmp #1 smp tue jan 16 09:53:07 cet 2001 i686 unknown '
config_args='-des -Darchname=i386-linux -Dd_dosuid -Ud_csh -Duseshrplib -Doptimize=-O3 -fomit-frame-pointer -pipe -mcpu=pentiumpro -march=i586 -ffast-math -Dprefix=/usr -Di_ndbm -Di_gdbm -Di_shadow -Di_syslog -Uuselargefiles -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/lib/perl5/man/man3'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=undef
use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
Compiler:
cc='cc', optimize='-O3 -fomit-frame-pointer -pipe -mcpu=pentiumpro -march=i586 -ffast-math', gccversion=2.96 20000731 (Linux-Mandrake 7.3)
cppflags='-fno-strict-aliasing'
ccflags ='-fno-strict-aliasing'
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=4
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 -lcrypt
libc=/lib/libc-2.2.1.so, so=so, useshrplib=true, libperl=libperl.so
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.6.0/i386-linux/CORE'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:


---
@INC for perl v5.6.0:
/home/bline/projects/gmail/admin
/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
.

---
Environment for perl v5.6.0:
HOME=/home/bline
LANG=en
LANGUAGE=en_US:en
LC_COLLATE=en_US
LC_CTYPE=en_US
LC_MESSAGES=en_US
LC_MONETARY=en_US
LC_NUMERIC=en_US
LC_TIME=en_US
LD_LIBRARY_PATH=/usr/lib/qt2/lib:/home/bline/package/bin:/usr/local/omni/lib/i586_linux_2.0_glibc2.1:/usr/lib/qt2/lib:/home/bline/package/bin:/usr/local/omni/lib/i586_linux_2.0_glibc2.1:
LOGDIR (unset)
PATH=/usr/lib/qt2/bin:/usr/Komodo-1.0:/home/bline/projects/tools:/usr/lib/qt2/bin:/usr/Komodo-1.0:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/games:/home/bline/bin
PERLLIB=/home/bline/projects/gmail/admin
PERL_BADLANG (unset)
SHELL=/bin/bash

Search Discussions

  • Stephen P. Potter at Mar 29, 2001 at 8:19 pm
    Lightning flashed, thunder crashed and sbeck@gossamer-threads.com whispered:
    In perl versions 5.00401, 5.00404, and 5.00503 the following
    causes a segv and core dump:
    perl -wle 'local $main::foo->{bar}; $main::foo = {}; exit'

    In perl version 5.6.0 the same code causes a segv but no
    core dump.

    If you remove the exit() call you get the warning:
    "Attempt to free unreferenced scalar." on all the versions I
    have mentioned.
    I don't see this under bleadperl. Unfortunately, I don't have a trial
    release handy right this second to check against that. The fix has
    probably been included there though, so 5.6.1 should fix this.

    -spp

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-porters @
categoriesperl
postedMar 29, '01 at 5:18a
activeMar 29, '01 at 8:19p
posts2
users2
websiteperl.org

2 users in discussion

Stephen P. Potter: 1 post Sbeck: 1 post

People

Translate

site design / logo © 2022 Grokbase