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
Kenneth Lorber
March 4, 2004 18:00
[perl #27392] 5.8.2 cores or loops using hashref as subscript
Message ID:
# New Ticket Created by  Kenneth Lorber 
# Please include the string:  [perl #27392]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from,
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)
(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";

[Please do not change anything below this line]
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:
    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
    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/, so=sl, useshrplib=false, libperl=libperl.a
  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:

Environment for perl v5.8.2:
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About