--- sv.c.orig 2011-05-08 05:10:08.000000000 +0200 +++ sv.c 2011-06-06 16:12:07.421329360 +0200 @@ -6058,6 +6058,17 @@ assert(SvREFCNT(sv) == 0); assert(SvTYPE(sv) != (svtype)SVTYPEMASK); + if (type == SVTYPEMASK) { + /* in some bad cases, scalar is freed a second time, + resulting in a segfault (mdvbz#34505) in mg_free(sv) below. + + perl HEAD has an assert (http://public.activestate.com/cgi-bin/perlbrowse/p/32788), + but since we can't reproduce and it's seems hard to fix those cases, + (as http://rt.perl.org/rt3/Public/Bug/Display.html?id=50142 seems to say ??) + we need to workaround... */ + return; + } + if (type <= SVt_IV) { /* See the comment in sv.h about the collusion between this * early return and the overloading of the NULL slots in the