Perl / perl5

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

SIGSEGV in Perl_gv_check: entry filled with ASCII '0000' #6454

Closed p5pRT closed 14 years ago

p5pRT commented 21 years ago

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

Searchable as RT21982$

p5pRT commented 21 years ago

From stephens@ion09.dev.ionink.com

Created by stephens@ion09.dev.ionink.com

I have a set of Perl modules that cause memory corruption and subsequent SIGSEGV. This bug seems to go back to at least Perl 5.6.1.

At first I was using a stock perl5.6.1 and perl5.8.0 on RedHat 8.0. They were Configured without -Dusemyalloc\, this was crashing in a libc malloc() internal function\, in both perl5.6.1 and perl5.8.0\, during parsing. I recompiled perl5.8.0 with -Dusemymalloc and -Doptimize='-g'\, to rule out problems with libc malloc().

Here is the stacktrace from gdb​:

====================================================================

Current directory is /tmp/stephens/perl-5.8.0-debug/src/perl-5.8.0/ GNU gdb Red Hat Linux (5.2.1-4) Copyright 2002 Free Software Foundation\, Inc. GDB is free software\, covered by the GNU General Public License\, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux"... /tmp/stephens/perl-5.8.0-debug/src/perl-5.8.0/test4.pl​: No such file or directory. (gdb) cd /home/stephens/ion/src/uml2code/test Working directory /home/stephens/ion/src/uml2code/test. (gdb) run test4.pl Starting program​: /tmp/stephens/perl-5.8.0-debug/src/perl-5.8.0/perl test4.pl

Program received signal SIGSEGV\, Segmentation fault. 0x080698ba in Perl_gv_check (stash=0x8247b80) at gv.c​:1153 (gdb) bt #0 0x080698ba in Perl_gv_check (stash=0x8247b80) at gv.c​:1153 #1 0x08069915 in Perl_gv_check (stash=0x823a850) at gv.c​:1157 #2 0x08069915 in Perl_gv_check (stash=0x816108c) at gv.c​:1157 #3 0x0805fe4d in S_parse_body (env=0x0\, xsinit=0x805caa0 \<xs_init>) at perl.c​:1548 #4 0x0805efec in perl_parse (my_perl=0x815ff08\, xsinit=0x805caa0 \<xs_init>\, argc=2\, argv=0xbfffe0e4\, env=0x0)   at perl.c​:1041 #5 0x0805ca52 in main (argc=2\, argv=0xbfffe0e4\, env=0xbfffe0f0) at perlmain.c​:83 #6 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6 (gdb) up #1 0x08069915 in Perl_gv_check (stash=0x823a850) at gv.c​:1157 (gdb) up #2 0x08069915 in Perl_gv_check (stash=0x816108c) at gv.c​:1157 (gdb) p hv $1 = (struct hv *) 0x823a850 (gdb) p *hv $2 = {sv_any = 0x8236468\, sv_refcnt = 4\, sv_flags = 536870923} (gdb) p hv->sv_any $3 = (struct xpvhv *) 0x8236468 (gdb) p *(hv->sv_any) $4 = {xhv_array = 0x81d9c08 ""\, xhv_fill = 3\, xhv_max = 7\, xhv_keys = 3\, xnv_nv = 0\, xmg_magic = 0x0\,   xmg_stash = 0x0\, xhv_riter = -1\, xhv_eiter = 0x0\, xhv_pmroot = 0x0\, xhv_name = 0x81fe628 "UML"} (gdb) do #1 0x08069915 in Perl_gv_check (stash=0x823a850) at gv.c​:1157 (gdb) p *(hv->sv_any) $5 = {xhv_array = 0x8166e08 "\003\003\003\003\003\0034\v (\022\v"\, xhv_fill = 13\, xhv_max = 31\, xhv_keys = 16\,   xnv_nv = 0\, xmg_magic = 0x0\, xmg_stash = 0x0\, xhv_riter = -1\, xhv_eiter = 0x0\, xhv_pmroot = 0x0\,   xhv_name = 0x82c5128 "UML​::MetaMetaModel"} (gdb) do #0 0x080698ba in Perl_gv_check (stash=0x8247b80) at gv.c​:1153 (gdb) p entry $6 = (struct he *) 0x3030303 (gdb) p (char)0x30 $7 = 48 '0' (gdb) l 1148
1149 if (!HvARRAY(stash)) 1150 return; 1151 for (i = 0; i \<= (I32) HvMAX(stash); i++) { 1152 for (entry = HvARRAY(stash)[i]; entry; entry = HeNEXT(entry)) { 1153 if (HeKEY(entry)[HeKLEN(entry)-1] == '​:' && 1154 (gv = (GV*)HeVAL(entry)) && (hv = GvHV(gv))) 1155 { 1156 if (hv != PL_defstash && hv != stash) 1157 gv_check(hv); /* nested package */ (gdb) p i $8 = 0 (gdb)

====================================================================

The first entry of the "stash" hash array in the "UML​::MetaMetaModel" stash appears to be corrupted\, which send "entry" into outer space to a planet filled with ASCII '0' ("zero"\, not null) characters.

The script "test4.pl" is part of a UML meta-meta-model toolkit\, "uml2code"\, I am working on. It generates a Perl (\, XMI or Java) implementation of the UML meta-model by bootstrapping from with a meta-meta-model\, which is a subset of the meta-model. Whew!

You can download uml2code at http​://kurtstephens.com/pub/uml2code/release/uml2code-20030417.tar.gz

I have not been able to get it to happen with a smaller code set. The failure maybe related to the really hairy Data​::Dumper code in uml2code/test/gen/UML/MetaModel.pm.

Prerequisites for uml2code are Parse​::RecDescent and XML​::Writer.

Something related​: If you run perl -DT test4.pl it doesn't SIGSEGV\, it fail with "Can't call method "generalization" on unblessed reference at ../lib/perl/UML/MetaMetaModel/Util.pm line 269." (after a really long time; go eat lunch). This die() is probably my fault.

Please let me know how I can help.

Thanks\, Kurt Stephens ks.perl@​kurtstephens.com

====================================================================

Perl Info ``` Flags: category=core severity=critical Site configuration information for perl v5.8.0: Configured by stephens at Thu Apr 17 01:49:56 EDT 2003. Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform: osname=linux, osvers=2.4.18-24.8.0, archname=i686-linux uname='linux ion09 2.4.18-24.8.0 #1 fri jan 31 06:51:30 est 2003 i686 i686 i386 gnulinux ' config_args='-des -Dusemymalloc -Uinstalluserbinperl -Dprefix=/tmp/stephens/perl-5.8.0-debug -Doptimize=-g' 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='cc', ccflags ='-DDEBUGGING -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm', optimize='-g', cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/include/gdbm' ccversion='', gccversion='3.2 20020903 (Red Hat Linux 8.0 3.2-7)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 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, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil libc=/lib/libc-2.2.93.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.2.93' 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.8.0: /home/stephens/local/lib/site_perl/5.6.1 /home/stephens/local/lib/site_perl/5.6.1 /tmp/stephens/perl-5.8.0-debug/lib/5.8.0/i686-linux /tmp/stephens/perl-5.8.0-debug/lib/5.8.0 /tmp/stephens/perl-5.8.0-debug/lib/site_perl/5.8.0/i686-linux /tmp/stephens/perl-5.8.0-debug/lib/site_perl/5.8.0 /tmp/stephens/perl-5.8.0-debug/lib/site_perl . Environment for perl v5.8.0: HOME=/home/stephens LANG=en_US.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/stephens/local/bin:/home/stephens/bin:/home/stephens/ion/src/bin:/home/stephens/ion/src/sbin:/home/stephens/ion/bin:/usr/sbin:/sbin:/iimp/app/p/java/prod/bin:/iimp/app/prod/bin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin PERL5LIB=/home/stephens/local/lib/site_perl/5.6.1:/home/stephens/local/lib/site_perl/5.6.1: PERL_BADLANG (unset) SHELL=/bin/bash ```
p5pRT commented 21 years ago

From ks.perl@kurtstephens.com

The email ks.perl@​kurtstephens.com can be associated with rt.perl.org user "kstephens".

p5pRT commented 21 years ago

From ks.perl@kurtstephens.com

I was misinformed and confused about the XML​::Writer 0.4 problem on OS X. The test case for this ticket uml2code/test/test4.pl works on OS X with XML​::Writer 0.4. Only the XML​::Writer 0.4 test cases cause SIGSEGV on OS X stock perl 5.6.0. If you install XML​::Writer 0.4 on OS X without running its test\, uml2code/test/test4.pl runs without causing SIGSEGV.

So that means that OS X is immune to the test4.pl SIGSEGV\, but it seems at least three separate Intel Linux builds are not.

Again\, the SIGSEGV during XML​::Writer 0.4 test on OS X has nothing to do with this ticket.

Sorry for the confusion.

p5pRT commented 21 years ago

From ks@kurtstephens.com

Update --

A friend running Apple OS X with stock perl 5.6.0 said it does not dump core when running uml2code/test/test4.pl\, if you install XML​::Writer 0.1. Oddly\, XML​::Writer v0.2-0.4 cause OS X perl 5.6.0 to segfault in test 40. I've encouraged him to post a separate perlbug for that.

He also said that Debian woody Intel with stock perl 5.6.1 also segaults on uml2code/test/test4.pl.

Thanks\, Kurt Stephens ks.perl@​kurtstephens.com

Apple OS X perl -V

This is what perl -V outputs on Mac OS X 10.2.5​:

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration​: Platform​:   osname=darwin\, osvers=6.0\, archname=darwin   uname='darwin fisheye 6.0 darwin kernel version 5.2​: mon jun 17 09​:55​:14 pdt 2002; root​:xnu-201-14.rootsxnu-201-14.objrelease_ppc power macintosh powerpc '   config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe -Dldflags='   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='-Os'\, gccversion=Apple cpp-precomp 6.14   cppflags='-g -pipe -pipe -fno-common -no-cpp-precomp -flat_namespace -DHAS_TELLDIR_PROTOTYPE -fno-strict-aliasing'   ccflags ='-g -pipe -pipe -fno-common -no-cpp-precomp -flat_namespace -DHAS_TELLDIR_PROTOTYPE -fno-strict-aliasing'   stdchar='char'\, d_stdstdio=undef\, usevfork=true   intsize=4\, longsize=4\, ptrsize=4\, doublesize=8   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\, usemymalloc=n\, prototype=define Linker and Libraries​:   ld='cc'\, ldflags =''   libpth=/usr/lib   libs=-lm -lc   libc=/System/Library/Frameworks/System.framework/System\, so=dylib\, useshrplib=true\, libperl=libperl.dylib Dynamic Linking​:   dlsrc=dl_dyld.xs\, dlext=bundle\, d_dlsymun=undef\, ccdlflags=' '   cccdlflags=' '\, lddlflags='-bundle -flat_namespace -undefined suppress'

Characteristics of this binary (from libperl)​: Compile-time options​: USE_LARGE_FILES Built under darwin Compiled at Jul 14 2002 04​:04​:33 @​INC​:   /System/Library/Perl/darwin   /System/Library/Perl   /Library/Perl/darwin   /Library/Perl   /Library/Perl   /Network/Library/Perl/darwin   /Network/Library/Perl   /Network/Library/Perl   .

=====================================================================

perlbug-followup@​perl.org wrote​:

Greetings\,

This message has been automatically generated in response to the creation of a trouble ticket regarding​: "Re​: SIGSEGV in Perl_gv_check​: entry filled with ASCII '0000'".

There is no need to reply to this message right now. Your ticket has been assigned an ID of [perl #21984].

Please include the string​:

[perl #21984]

in the subject line of all future correspondence about this issue. To do so\, you may reply to this message (please delete unnecessary quotes)

Thank you\, perlbug-followup@​perl.org

------------------------------------------------------------------------- Return-Path​: \perlmail\-perlbug\-owner@&#8203;onion\.perl\.org Delivered-To​: rt-perl5@​x1.develooper.com Received​: (qmail 18510 invoked by alias); 17 Apr 2003 16​:56​:01 -0000 Delivered-To​: bugs-perl5@​netlabs.develooper.com Received​: (qmail 18505 invoked by uid 424); 17 Apr 2003 16​:56​:00 -0000 Received​: from onion.valueclick.com (HELO onion.perl.org) (64.70.54.95) by x1.develooper.com (qpsmtpd/0.26-dev) with SMTP; Thu\, 17 Apr 2003 09​:55​:59 -0700 Received​: (qmail 52620 invoked by uid 1005); 17 Apr 2003 16​:55​:58 -0000 Delivered-To​: perlmail-perlbug@​onion.perl.org Received​: (qmail 52616 invoked by uid 76); 17 Apr 2003 16​:55​:58 -0000 Received​: from qmailr@​one.develooper.com (HELO ran-out.mx.develooper.com) (64.81.84.115) by onion.perl.org (qpsmtpd/0.26-dev) with SMTP; Thu\, 17 Apr 2003 09​:55​:58 -0700 Received​: (qmail 832 invoked by uid 225); 17 Apr 2003 16​:55​:51 -0000 Delivered-To​: perlbug@​perl.org Received​: (qmail 815 invoked by uid 507); 17 Apr 2003 16​:55​:51 -0000 Received​: from jareth.dreamhost.com (HELO jareth.dreamhost.com) (66.33.198.201) by one.develooper.com (qpsmtpd/0.26-dev) with SMTP; Thu\, 17 Apr 2003 09​:55​:49 -0700 Received​: from kurtstephens.com (unknown [64.118.232.170]) by jareth.dreamhost.com (Postfix) with ESMTP id D4D086B5F7; Thu\, 17 Apr 2003 09​:56​:08 -0700 (PDT) Message-Id​: \3E9EDE07\.4000106@&#8203;kurtstephens\.com Date​: Thu\, 17 Apr 2003 13​:01​:59 -0400 From​: Kurt Stephens \ks@&#8203;kurtstephens\.com Reply-To​: ks.perl@​kurtstephens.com User-Agent​: Mozilla/5.0 (X11; U; Linux i686; en-US; rv​:1.3) Gecko/20030312 X-Accept-Language​: en-us\, en MIME-Version​: 1.0 To​: perlbug@​perl.org CC​: ks.perl@​kurtstephens.com Subject​: Re​: SIGSEGV in Perl_gv_check​: entry filled with ASCII '0000' References​: \5\.8\.0\_11801\_1050589648@&#8203;ion09 In-Reply-To​: \5\.8\.0\_11801\_1050589648@&#8203;ion09 Content-Type​: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding​: 7bit X-SMTPD​: qpsmtpd/0.26-dev\, http​://develooper.com/code/qpsmtpd/ X-Spam-Check-BY​: one.develooper.com X-Spam-Status​: No\, hits=-6.3 required=7.0 tests=CARRIAGE_RETURNS\,IN_REP_TO\,PERLBUG_CONF\,QUOTED_EMAIL_TEXT\,REFERENCES\,SPAM_PHRASE_00_01\,SUPERLONG_LINE\,USER_AGENT\,USER_AGENT_MOZILLA_UA\,X_ACCEPT_LANG version=2.44 X-SMTPD​: qpsmtpd/0.26-dev\, http​://develooper.com/code/qpsmtpd/ X-SMTPD​: qpsmtpd/0.26-dev\, http​://develooper.com/code/qpsmtpd/ X-Virus-Checked​: Checked X-Spam-Check-BY​: x1.develooper.com X-Spam-Status​: No\, hits=-6.3 required=7.0 tests=CARRIAGE_RETURNS\,IN_REP_TO\,PERLBUG_CONF\,QUOTED_EMAIL_TEXT\,REFERENCES\,SPAM_PHRASE_00_01\,SUPERLONG_LINE\,USER_AGENT\,USER_AGENT_MOZILLA_UA\,X_ACCEPT_LANG version=2.44

Update --

A friend running Apple OS X with stock perl 5.6.0 said it does not dump core when running uml2code/test/test4.pl\, if you install XML​::Writer 0.1. Oddly\, XML​::Writer v0.2-0.4 cause OS X perl 5.6.0 to segfault in test 40. I've encouraged him to post a separate perlbug for that.

He also said that Debian woody Intel with stock perl 5.6.1 also segaults on uml2code/test/test4.pl.

Thanks\, Kurt Stephens ks.perl@​kurtstephens.com

Apple OS X perl -V

This is what perl -V outputs on Mac OS X 10.2.5​:

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration​: Platform​: osname=darwin\, osvers=6.0\, archname=darwin uname='darwin fisheye 6.0 darwin kernel version 5.2​: mon jun 17 09​:55​:14 pdt 2002; root​:xnu-201-14.rootsxnu-201-14.objrelease_ppc power macintosh powerpc ' config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe -Dldflags=' 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='-Os'\, gccversion=Apple cpp-precomp 6.14 cppflags='-g -pipe -pipe -fno-common -no-cpp-precomp -flat_namespace -DHAS_TELLDIR_PROTOTYPE -fno-strict-aliasing' ccflags ='-g -pipe -pipe -fno-common -no-cpp-precomp -flat_namespace -DHAS_TELLDIR_PROTOTYPE -fno-strict-aliasing' stdchar='char'\, d_stdstdio=undef\, usevfork=true intsize=4\, longsize=4\, ptrsize=4\, doublesize=8 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\, usemymalloc=n\, prototype=define Linker and Libraries​: ld='cc'\, ldflags ='' libpth=/usr/lib libs=-lm -lc libc=/System/Library/Frameworks/System.framework/System\, so=dylib\, useshrplib=true\, libperl=libperl.dylib Dynamic Linking​: dlsrc=dl_dyld.xs\, dlext=bundle\, d_dlsymun=undef\, ccdlflags=' ' cccdlflags=' '\, lddlflags='-bundle -flat_namespace -undefined suppress'

Characteristics of this binary (from libperl)​: Compile-time options​: USE_LARGE_FILES Built under darwin Compiled at Jul 14 2002 04​:04​:33 @​INC​: /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin /Library/Perl /Library/Perl /Network/Library/Perl/darwin /Network/Library/Perl /Network/Library/Perl .

=====================================================================

stephens@​localhost.localdomain wrote​:

This is a bug report for perl from stephens@​ion09.dev.ionink.com\, generated with the help of perlbug 1.34 running under perl v5.8.0.

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

I have a set of Perl modules that cause memory corruption and subsequent SIGSEGV. This bug seems to go back to at least Perl 5.6.1.

At first I was using a stock perl5.6.1 and perl5.8.0 on RedHat 8.0. They were Configured without -Dusemyalloc\, this was crashing in a libc malloc() internal function\, in both perl5.6.1 and perl5.8.0\, during parsing. I recompiled perl5.8.0 with -Dusemymalloc and -Doptimize='-g'\, to rule out problems with libc malloc().

Here is the stacktrace from gdb​:

====================================================================

Current directory is /tmp/stephens/perl-5.8.0-debug/src/perl-5.8.0/ GNU gdb Red Hat Linux (5.2.1-4) Copyright 2002 Free Software Foundation\, Inc. GDB is free software\, covered by the GNU General Public License\, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux"... /tmp/stephens/perl-5.8.0-debug/src/perl-5.8.0/test4.pl​: No such file or directory. (gdb) cd /home/stephens/ion/src/uml2code/test Working directory /home/stephens/ion/src/uml2code/test. (gdb) run test4.pl Starting program​: /tmp/stephens/perl-5.8.0-debug/src/perl-5.8.0/perl test4.pl

Program received signal SIGSEGV\, Segmentation fault. 0x080698ba in Perl_gv_check (stash=0x8247b80) at gv.c​:1153 (gdb) bt #0 0x080698ba in Perl_gv_check (stash=0x8247b80) at gv.c​:1153 #1 0x08069915 in Perl_gv_check (stash=0x823a850) at gv.c​:1157 #2 0x08069915 in Perl_gv_check (stash=0x816108c) at gv.c​:1157 #3 0x0805fe4d in S_parse_body (env=0x0\, xsinit=0x805caa0 \<xs_init>) at perl.c​:1548 #4 0x0805efec in perl_parse (my_perl=0x815ff08\, xsinit=0x805caa0 \<xs_init>\, argc=2\, argv=0xbfffe0e4\, env=0x0) at perl.c​:1041 #5 0x0805ca52 in main (argc=2\, argv=0xbfffe0e4\, env=0xbfffe0f0) at perlmain.c​:83 #6 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6 (gdb) up #1 0x08069915 in Perl_gv_check (stash=0x823a850) at gv.c​:1157 (gdb) up #2 0x08069915 in Perl_gv_check (stash=0x816108c) at gv.c​:1157 (gdb) p hv $1 = (struct hv *) 0x823a850 (gdb) p *hv $2 = {sv_any = 0x8236468\, sv_refcnt = 4\, sv_flags = 536870923} (gdb) p hv->sv_any $3 = (struct xpvhv *) 0x8236468 (gdb) p *(hv->sv_any) $4 = {xhv_array = 0x81d9c08 ""\, xhv_fill = 3\, xhv_max = 7\, xhv_keys = 3\, xnv_nv = 0\, xmg_magic = 0x0\, xmg_stash = 0x0\, xhv_riter = -1\, xhv_eiter = 0x0\, xhv_pmroot = 0x0\, xhv_name = 0x81fe628 "UML"} (gdb) do #1 0x08069915 in Perl_gv_check (stash=0x823a850) at gv.c​:1157 (gdb) p *(hv->sv_any) $5 = {xhv_array = 0x8166e08 "\003\003\003\003\003\0034\v (\022\v"\, xhv_fill = 13\, xhv_max = 31\, xhv_keys = 16\, xnv_nv = 0\, xmg_magic = 0x0\, xmg_stash = 0x0\, xhv_riter = -1\, xhv_eiter = 0x0\, xhv_pmroot = 0x0\, xhv_name = 0x82c5128 "UML​::MetaMetaModel"} (gdb) do #0 0x080698ba in Perl_gv_check (stash=0x8247b80) at gv.c​:1153 (gdb) p entry $6 = (struct he *) 0x3030303 (gdb) p (char)0x30 $7 = 48 '0' (gdb) l 1148
1149 if (!HvARRAY(stash)) 1150 return; 1151 for (i = 0; i \<= (I32) HvMAX(stash); i++) { 1152 for (entry = HvARRAY(stash)[i]; entry; entry = HeNEXT(entry)) { 1153 if (HeKEY(entry)[HeKLEN(entry)-1] == '​:' && 1154 (gv = (GV*)HeVAL(entry)) && (hv = GvHV(gv))) 1155 { 1156 if (hv != PL_defstash && hv != stash) 1157 gv_check(hv); /* nested package */ (gdb) p i $8 = 0 (gdb)

====================================================================

The first entry of the "stash" hash array in the "UML​::MetaMetaModel" stash appears to be corrupted\, which send "entry" into outer space to a planet filled with ASCII '0' ("zero"\, not null) characters.

The script "test4.pl" is part of a UML meta-meta-model toolkit\, "uml2code"\, I am working on. It generates a Perl (\, XMI or Java) implementation of the UML meta-model by bootstrapping from with a meta-meta-model\, which is a subset of the meta-model. Whew!

You can download uml2code at http​://kurtstephens.com/pub/uml2code/release/uml2code-20030417.tar.gz

I have not been able to get it to happen with a smaller code set. The failure maybe related to the really hairy Data​::Dumper code in uml2code/test/gen/UML/MetaModel.pm.

Prerequisites for uml2code are Parse​::RecDescent and XML​::Writer.

Something related​: If you run perl -DT test4.pl it doesn't SIGSEGV\, it fail with "Can't call method "generalization" on unblessed reference at ../lib/perl/UML/MetaMetaModel/Util.pm line 269." (after a really long time; go eat lunch). This die() is probably my fault.

Please let me know how I can help.

Thanks\, Kurt Stephens ks.perl@​kurtstephens.com

====================================================================

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

Configured by stephens at Thu Apr 17 01​:49​:56 EDT 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration​: Platform​: osname=linux\, osvers=2.4.18-24.8.0\, archname=i686-linux uname='linux ion09 2.4.18-24.8.0 #1 fri jan 31 06​:51​:30 est 2003 i686 i686 i386 gnulinux ' config_args='-des -Dusemymalloc -Uinstalluserbinperl -Dprefix=/tmp/stephens/perl-5.8.0-debug -Doptimize=-g' 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='cc'\, ccflags ='-DDEBUGGING -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm'\, optimize='-g'\, cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/include/gdbm' ccversion=''\, gccversion='3.2 20020903 (Red Hat Linux 8.0 3.2-7)'\, gccosandvers='' intsize=4\, longsize=4\, ptrsize=4\, doublesize=8\, byteorder=1234 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\, prototype=define Linker and Libraries​: ld='cc'\, ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil libc=/lib/libc-2.2.93.so\, so=so\, useshrplib=false\, libperl=libperl.a gnulibc_version='2.2.93' 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.8.0​: /home/stephens/local/lib/site_perl/5.6.1 /home/stephens/local/lib/site_perl/5.6.1 /tmp/stephens/perl-5.8.0-debug/lib/5.8.0/i686-linux /tmp/stephens/perl-5.8.0-debug/lib/5.8.0 /tmp/stephens/perl-5.8.0-debug/lib/site_perl/5.8.0/i686-linux /tmp/stephens/perl-5.8.0-debug/lib/site_perl/5.8.0 /tmp/stephens/perl-5.8.0-debug/lib/site_perl .

--- Environment for perl v5.8.0​: HOME=/home/stephens LANG=en_US.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/stephens/local/bin​:/home/stephens/bin​:/home/stephens/ion/src/bin​:/home/stephens/ion/src/sbin​:/home/stephens/ion/bin​:/usr/sbin​:/sbin​:/iimp/app/p/java/prod/bin​:/iimp/app/prod/bin​:/usr/kerberos/bin​:/usr/local/sbin​:/usr/local/bin​:/usr/local/bin​:/bin​:/usr/bin​:/usr/X11R6/bin PERL5LIB=/home/stephens/local/lib/site_perl/5.6.1​:/home/stephens/local/lib/site_perl/5.6.1​: PERL_BADLANG (unset) SHELL=/bin/bash

p5pRT commented 14 years ago

From @xdg

Test program runs without segfault on my 5.10.1 and 5.11.0.

p5pRT commented 14 years ago

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