diff -p -up perl-5.10.0/sv.c.pix perl-5.10.0/sv.c --- perl-5.10.0/sv.c.pix 2007-12-18 11:47:08.000000000 +0100 +++ perl-5.10.0/sv.c 2008-04-01 15:08:10.000000000 +0200 @@ -5091,6 +5091,17 @@ Perl_sv_clear(pTHX_ register SV *sv) assert(sv); assert(SvREFCNT(sv) == 0); + 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 and IV slots in the size