develooper Front page | perl.perl5.porters | Postings from May 2008

Re: [perl #52740] crash when localizing a symtab entry

Thread Previous
From:
Rafael Garcia-Suarez
Date:
May 9, 2008 08:49
Subject:
Re: [perl #52740] crash when localizing a symtab entry
Message ID:
b77c1dce0805090849n43879080mba780cceff2be309@mail.gmail.com
2008/4/11 via RT Niko Tyni <perlbug-followup@perl.org>:
> This snippet crashes Perl 5.10.0 and blead (as of change 33541 which
> is the last one in the utsl.gen.nz git repository) with a segmentation fault:
>
>  #!/usr/bin/perl -w
>  use Compress::Zlib;
>  use Devel::Symdump;
>  print Devel::Symdump->isa_tree;
>  __END__
>
> (The snippet is reduced from the mod_perl2 2.0.4rc1 test suite,
>  where Apache crashes on shutdown after the tests.)
>
> This can be reduced to
>
>  #!/usr/bin/perl
>  use constant "foo" => "a";
>  index("a", foo);
>  local(*g) = ${::}{foo};
>  __END__

Thanks for the impressive and detailed bug report, that was useful.

Here's a patch that solves the problem. I've not had time yet to run all tests
with it, but core tests are fine.

--- sv.c
+++ sv.c
@@ -3718,8 +3718,10 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, regi
                GvMULTI_on(dstr);
                return;
            }
-           glob_assign_glob(dstr, sstr, dtype);
-           return;
+           if (isGV_with_GP(sstr)) {
+               glob_assign_glob(dstr, sstr, dtype);
+               return;
+           }
        }

        if (dtype >= SVt_PV) {

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