Skip Menu |
Report information
Id: 54566
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: ntyni [at] debian.org
Cc:
AdminCc:

Operating System: Linux
PatchStatus: (no value)
Severity: medium
Type: core
Perl Version: 5.10.0
Fixed In: (no value)



Subject: assertion failure fiddling with @ISA
Date: Wed, 21 May 2008 09:53:48 +0300
To: perlbug [...] perl.org
From: ntyni [...] cc.helsinki.fi
Download (untitled) / with headers
text/plain 4.7k
This is a bug report for perl from Niko Tyni <ntyni@debian.org>, generated with the help of perlbug 1.36 running under perl 5.10.0. ----------------------------------------------------------------- This one-liner, reduced from code in HTML::Mason::Request, causes an assertion failure on blead@33852: % ./miniperl -e '@ISA=q/a/; $#ISA; $ISA[0]=q/b/' miniperl: mg.c:1587: Perl_magic_setisa: Assertion `((((_gv)->sv_flags & (0x00004000|0x00008000)) == 0x00008000) && (((svtype)((_gv)->sv_flags & 0xff)) == SVt_PVGV || ((svtype)((_gv)->sv_flags & 0xff)) == SVt_PVLV))' failed. zsh: abort (core dumped) ./miniperl -e '@ISA=q/a/; $#ISA; $ISA[0]=q/b/' #0 0x00002b6aba3ac165 in raise () from /lib/libc.so.6 #1 0x00002b6aba3ad610 in abort () from /lib/libc.so.6 #2 0x00002b6aba3a560f in __assert_fail () from /lib/libc.so.6 #3 0x00000000004c7ae7 in Perl_magic_setisa (my_perl=0x985010, sv=0x988e78, mg=0x9b0988) at mg.c:1583 #4 0x00000000004c05f5 in Perl_mg_set (my_perl=0x985010, sv=0x988e78) at mg.c:291 #5 0x000000000050434c in Perl_pp_sassign (my_perl=0x985010) at pp_hot.c:196 #6 0x00000000004ad840 in Perl_runops_debug (my_perl=0x985010) at dump.c:1984 #7 0x00000000004f7072 in S_run_body (my_perl=0x985010, oldscope=1) at perl.c:2392 #8 0x00000000004f63a4 in perl_run (my_perl=0x985010) at perl.c:2312 #9 0x00000000006b1712 in main (argc=3, argv=0x7ffff121fdf8, env=0x7ffff121fe18) at miniperlmain.c:113 As seen in <http://bugs.debian.org/480480>, this segfaults on 5.10.0 in the subsequent call to Perl_mro_isa_changed_in() as 'stash' ends up NULL. The segfault is gone with change 33684, but the assertion failure remains with -DDEBUGGING, indicating there's another bug in there. ----------------------------------------------------------------- --- Flags: category=core severity=medium --- Site configuration information for perl 5.10.0: Configured by Debian Project at Tue May 20 20:09:17 UTC 2008. Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Platform: osname=linux, osvers=2.6.18-6-xen-amd64, archname=x86_64-linux-gnu-thread-multi uname='linux sid 2.6.18-6-xen-amd64 #1 smp thu may 8 08:34:37 utc 2008 x86_64 gnulinux ' config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=x86_64-linux-gnu -Dprefix=/usr -Dprivlib=/usr/share/perl/5.10 -Darchlib=/usr/lib/perl/5.10 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.10.0 -Dsitearch=/usr/local/lib/perl/5.10.0 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -Dlibperl=libperl.so.5.10.0 -Dd_dosuid -des' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2 -g', cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include' ccversion='', gccversion='4.2.3 (Debian 4.2.3-5)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt perllibs=-ldl -lm -lpthread -lc -lcrypt libc=/lib/libc-2.7.so, so=so, useshrplib=true, libperl=libperl.so.5.10.0 gnulibc_version='2.7' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib' Locally applied patches: --- @INC for perl 5.10.0: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl . --- Environment for perl 5.10.0: HOME=/home/niko LANG=en_US.UTF-8 LANGUAGE (unset) LC_CTYPE=fi_FI.UTF-8 LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/niko/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/sbin:/usr/sbin PERL_BADLANG (unset) SHELL=/bin/zsh
Subject: Re: [perl #54566] assertion failure fiddling with @ISA
Date: Wed, 21 May 2008 14:42:48 +0200
To: perl5-porters [...] perl.org
From: "Rafael Garcia-Suarez" <rgarciasuarez [...] gmail.com>
Download (untitled) / with headers
text/plain 1.3k
2008/5/21 via RT Niko Tyni <perlbug-followup@perl.org>: Show quoted text
> This one-liner, reduced from code in HTML::Mason::Request, causes an > assertion failure on blead@33852: > > % ./miniperl -e '@ISA=q/a/; $#ISA; $ISA[0]=q/b/' > miniperl: mg.c:1587: Perl_magic_setisa: Assertion `((((_gv)->sv_flags & (0x00004000|0x00008000)) == 0x00008000) && (((svtype)((_gv)->sv_flags & 0xff)) == SVt_PVGV || ((svtype)((_gv)->sv_flags & 0xff)) == SVt_PVLV))' failed. > zsh: abort (core dumped) ./miniperl -e '@ISA=q/a/; $#ISA; $ISA[0]=q/b/' >
Looks like the original author of the code overlooked the possibility for @ISA to have several kinds of magic. Here's a patch : --- mg.c.orig 2008-05-12 18:29:57.000000000 +0200 +++ mg.c 2008-05-21 14:23:45.000000000 +0200 @@ -1583,7 +1583,7 @@ Perl_magic_setisa(pTHX_ SV *sv, MAGIC *m stash = GvSTASH( SvTYPE(mg->mg_obj) == SVt_PVGV ? (GV*)mg->mg_obj - : (GV*)SvMAGIC(mg->mg_obj)->mg_obj + : (GV*)mg_find(mg->mg_obj, PERL_MAGIC_isa)->mg_obj ); if (stash) @@ -1609,7 +1609,7 @@ Perl_magic_clearisa(pTHX_ SV *sv, MAGIC stash = GvSTASH( SvTYPE(mg->mg_obj) == SVt_PVGV ? (GV*)mg->mg_obj - : (GV*)SvMAGIC(mg->mg_obj)->mg_obj + : (GV*)mg_find(mg->mg_obj, PERL_MAGIC_isa)->mg_obj ); if (stash)
Subject: Re: [perl #54566] assertion failure fiddling with @ISA
Date: Wed, 21 May 2008 15:00:32 +0200
To: perl5-porters [...] perl.org
From: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
Download (untitled) / with headers
text/plain 1.8k
On Wed, 21 May 2008 14:42:48 +0200, "Rafael Garcia-Suarez" <rgarciasuarez@gmail.com> wrote: Show quoted text
> 2008/5/21 via RT Niko Tyni <perlbug-followup@perl.org>:
> > This one-liner, reduced from code in HTML::Mason::Request, causes an > > assertion failure on blead@33852: > > > > % ./miniperl -e '@ISA=q/a/; $#ISA; $ISA[0]=q/b/' > > miniperl: mg.c:1587: Perl_magic_setisa: Assertion `((((_gv)->sv_flags & (0x00004000|0x00008000)) == 0x00008000) && (((svtype)((_gv)->sv_flags & 0xff)) == SVt_PVGV || ((svtype)((_gv)->sv_flags & 0xff)) == SVt_PVLV))' failed. > > zsh: abort (core dumped) ./miniperl -e '@ISA=q/a/; $#ISA; $ISA[0]=q/b/' > >
> > Looks like the original author of the code overlooked the possibility > for @ISA to have several kinds of magic. > > Here's a patch :
Change 33898 submitted. Show quoted text
> --- mg.c.orig 2008-05-12 18:29:57.000000000 +0200 > +++ mg.c 2008-05-21 14:23:45.000000000 +0200 > @@ -1583,7 +1583,7 @@ Perl_magic_setisa(pTHX_ SV *sv, MAGIC *m > stash = GvSTASH( > SvTYPE(mg->mg_obj) == SVt_PVGV > ? (GV*)mg->mg_obj > - : (GV*)SvMAGIC(mg->mg_obj)->mg_obj > + : (GV*)mg_find(mg->mg_obj, PERL_MAGIC_isa)->mg_obj > ); > > if (stash) > @@ -1609,7 +1609,7 @@ Perl_magic_clearisa(pTHX_ SV *sv, MAGIC > stash = GvSTASH( > SvTYPE(mg->mg_obj) == SVt_PVGV > ? (GV*)mg->mg_obj > - : (GV*)SvMAGIC(mg->mg_obj)->mg_obj > + : (GV*)mg_find(mg->mg_obj, PERL_MAGIC_isa)->mg_obj > ); > > if (stash)
-- H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/) using & porting perl 5.6.2, 5.8.x, 5.10.x on HP-UX 10.20, 11.00, 11.11, & 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin. http://qa.perl.org http://mirrors.develooper.com/hpux/ http://www.test-smoke.org http://www.goldmark.org/jeff/stupid-disclaimers/


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org