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

[perl #52740] [PATCH-tests] crash when localizing a symtab entry

Thread Next
From:
Bram via RT
Date:
August 11, 2008 05:23
Subject:
[perl #52740] [PATCH-tests] crash when localizing a symtab entry
Message ID:
rt-3.6.HEAD-29759-1218391153-38.52740-15-0@perl.org
On Fri May 09 08:50:13 2008, rafael wrote:
> 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) {
> 


The patch was applied with Change 33807 but no tests were included.

A patch with the test is attached (added it in t/op/local.t).


Kind regards,

Bram


Thread Next


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