develooper Front page | perl.perl5.porters | Postings from March 2004

[perl #27392] 5.8.2 cores or loops using hashref as subscript

Thread Previous | Thread Next
From:
Kenneth Lorber
Date:
March 4, 2004 18:00
Subject:
[perl #27392] 5.8.2 cores or loops using hashref as subscript
Message ID:
rt-3.0.8-27392-80748.16.6739137074924@perl.org
# New Ticket Created by  Kenneth Lorber 
# Please include the string:  [perl #27392]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=27392 >


This is a bug report for perl from keni@aol.net,
generated with the help of perlbug 1.34 running under perl v5.8.2.


-----------------------------------------------------------------
The (buggy, I-didn't-mean-to-type-that) sample code below will core under
HPUX 11:
	X: 1
	X: HASH(0x4001ecc8)
	Segmentation fault (core dumped)

gdb says:
#0  0x00058948 in Perl_av_extend (av=0x4001208c, key=1073840232) at av.c:158
158                         ary[--tmp] = &PL_sv_undef;
(gdb) where
#0  0x00058948 in Perl_av_extend (av=0x4001208c, key=1073840232) at av.c:158
#1  0x00058f1c in Perl_av_store (av=0x4001208c, key=1073840232, val=0x40018074)
    at av.c:315
#2  0x00058c68 in Perl_av_fetch (av=0x4001208c, key=1073840232, lval=1)
    at av.c:246
#3  0x000b5120 in Perl_pp_aelem () at pp_hot.c:2974
#4  0x000a7554 in Perl_runops_debug () at dump.c:1438
#5  0x0002ed5c in S_run_body (oldscope=1) at perl.c:1860
#6  0x0002e8b8 in perl_run (my_perl=0x11b000) at perl.c:1779
#7  0x0002a4cc in main (argc=2, argv=0x7eff0694, env=0x11aea4) at perlmain.c:86
#8  0xc013e8fc in ?? ()
#9  0x0005887c in Perl_av_extend (av=0x7eff06a0, key=2130642832) at av.c:118
Cannot access memory at address 0xffffff6e

5.6.1 on the same HPUX box does the same.

Under Mac OS X 10.2.8, 5.8.2 it doesn't core.  Instead it prints:
	X: 1
	X: HASH(0x28b224)
	X:
(the last line repeated 7 million times before I killed it).

5.6.0 (the official apple binary) also goes into a loop.

Sample code:

$G->{A}{B}[0] = 1;
# what I meant:
#       foreach (0..$#{$G->{A}{B}} ){
# what I wrote, causes core or loop:
	foreach (@{$G->{A}{B}} ){
		print "X: $_\n";
		$G->{A}{B}[$_]{C};
	}

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

Configured by tsadm at Fri Feb 13 13:59:59 EST 2004.

Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
  Platform:
    osname=hpux, osvers=11.00, archname=PA-RISC2.0
    uname='hp-ux tsdev-m1 b.11.00 a 9000800 633329363 two-user license '
    config_args='-Dprefix=/stats/process2/stats_share -Dcc=/usr/cygnus/bin/gcc -DPERL_POLLUTE_MALLOC'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=y, bincompat5005=undef
  Compiler:
    cc='/usr/cygnus/bin/gcc', ccflags ='-D_HPUX_SOURCE -DUINT32_MAX_BROKEN -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-g -O',
    cppflags='-D__STDC_EXT__ -D_HPUX_SOURCE -D_HPUX_SOURCE -DUINT32_MAX_BROKEN -DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='2.9-gnupro-98r2', gccosandvers='hpux11.00'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='/usr/bin/ld', ldflags =' -Wl,+vnocompatwarnings -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lnsl -lnm -lndbm -lgdbm -ldb -ldld -lm -lcrypt -lsec -lc
    perllibs=-lnsl -lnm -ldld -lm -lcrypt -lsec -lc
    libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred '
    cccdlflags='-fPIC', lddlflags='-b -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.8.2:
    /stats/process2/stats_share/lib/perl5/5.8.2/PA-RISC2.0
    /stats/process2/stats_share/lib/perl5/5.8.2
    /stats/process2/stats_share/lib/perl5/site_perl/5.8.2/PA-RISC2.0
    /stats/process2/stats_share/lib/perl5/site_perl/5.8.2
    /stats/process2/stats_share/lib/perl5/site_perl
    .

---
Environment for perl v5.8.2:
    HOME=/home/keni
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=.share/bin:/opt/perl5/bin:/home/keni/bin:/cm/bin/cvs/bin:/usr/cygnus/bin:/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/bin:/opt/upgrade/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/hparray/bin:/opt/resmon/bin:/opt/pred/bin:/opt/perf/bin:/opt/OV/bin/OpC:/opt/cxperf/bin:/opt/langtools/bin:/opt/imake/bin:/opt/graphics/common/bin:/usr/sbin/diag/contrib:/opt/aCC/bin:/usr/local/bin
    PERL_BADLANG (unset)
    SHELL=/usr/bin/csh

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About