develooper Front page | perl.perl5.porters | Postings from November 2011

Re: perl 5.14.2 make test fails under Solaris 10 x64

Thread Previous
From:
Nicholas Clark
Date:
November 2, 2011 07:21
Subject:
Re: perl 5.14.2 make test fails under Solaris 10 x64
Message ID:
20111102142133.GY23881@plum.flirble.org
On Mon, Oct 31, 2011 at 02:45:42PM +0000, Nicholas Clark wrote:

> I can replicate this on the Solaris system I have access to.
> If I recompile sv.o with -xO2 instead of -xO3, and then (re)build perl,
> the failing tests pass.
> 
> (The failing tests abort with a SEGV. The stacktrace shows a function in sv.c)
> 
> I don't know more than this currently.

blead's (new) bisect tool run like this:

../perl/Porting/bisect.pl --start v5.14.0 --expect-fail --target=perl --force-regen -Doptimize=-xO3 -Duselargefiles -Duse64bitall ./miniperl t/op/blocks.t

reports

HEAD is now at 1bac5ec sv.c: S_anonymise_cv_maybe UTF8 cleanup.
bad - zero exit from ./miniperl t/op/blocks.t
1bac5ecc108e6bb05752e5aef66c6890163aff39 is the first bad commit
commit 1bac5ecc108e6bb05752e5aef66c6890163aff39
Author: Brian Fraser <fraserbn@gmail.com>
Date:   Mon Sep 26 13:48:52 2011 -0700

    sv.c: S_anonymise_cv_maybe UTF8 cleanup.

:100644 100644 d71f901d76899c96a55d394bb4c9780a264f65c7 a3a2c74a49f6297022b22e4e7d69c69378c1507d M      sv.c
bisect run success
That took 7346 seconds

real    122m25.731s
user    32m16.349s
sys     11m6.446s


The commit in question is:

commit 1bac5ecc108e6bb05752e5aef66c6890163aff39
Author: Brian Fraser <fraserbn@gmail.com>
Date:   Mon Sep 26 13:48:52 2011 -0700

    sv.c: S_anonymise_cv_maybe UTF8 cleanup.

diff --git a/sv.c b/sv.c
index d71f901..a3a2c74 100644
--- a/sv.c
+++ b/sv.c
@@ -5893,7 +5893,6 @@ Perl_sv_replace(pTHX_ register SV *const sv, register SV *const nsv)
 STATIC void
 S_anonymise_cv_maybe(pTHX_ GV *gv, CV* cv)
 {
-    char *stash;
     SV *gvname;
     GV *anongv;
 
@@ -5913,10 +5912,10 @@ S_anonymise_cv_maybe(pTHX_ GV *gv, CV* cv)
     }
 
     /* if not, anonymise: */
-    stash  = GvSTASH(gv) && HvNAME(GvSTASH(gv))
-              ? HvENAME(GvSTASH(gv)) : NULL;
-    gvname = Perl_newSVpvf(aTHX_ "%s::__ANON__",
-					stash ? stash : "__ANON__");
+    gvname = (GvSTASH(gv) && HvNAME(GvSTASH(gv)) && HvENAME(GvSTASH(gv)))
+                    ? newSVhek(HvENAME_HEK(GvSTASH(gv)))
+                    : newSVpvn_flags( "__ANON__", 8, 0 );
+    sv_catpvs(gvname, "::__ANON__");
     anongv = gv_fetchsv(gvname, GV_ADDMULTI, SVt_PVCV);
     SvREFCNT_dec(gvname);
 


It's part of work to make the tokeniser properly handle UTF-8, which isn't
suitable to merge back to maint-5.14

Without that commit, on Solaris with -xO3, the local variable stash contains
garbage, is passed into Perl_newSVpvf(), and one of the functions it calls
attempts to dereference the pointer and crashes.

I don't know why stash stops containing garbage if -xO2 or lower is used.

Nicholas Clark

Thread Previous


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