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

Re: [perl #22372] AutoReply: foreach variable referenced in format segfaults

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
May 30, 2003 16:18
Subject:
Re: [perl #22372] AutoReply: foreach variable referenced in format segfaults
Message ID:
20030530231833.GB3846@fdgroup.com
On Thu, May 29, 2003 at 10:45:49PM +0200, Kjetil Torgrim Homme wrote:
> >   this script will dump core on both Solaris and Linux.  it works
> >   fine in versions prior to 5.8.0.
> format STDOUT =
> ^<<<<<<<<<<<<<<~~
> $el
> .
> 
> %hash = ("k" => "v");
> for $el (keys %hash) {
>     write;
> }

This is due to keys returning a shared hash string SV, and pp_formline()
directly modifying that value by the use of SvCUR_set() at pp_ctl.c:798.

That's what the problem is; I don't understand enough about all this
'ere new-fangled shared string and COW malarky to know what the correct
way of fixing this is. Over to Nicolas perhaps?

Dave

-- 
The optimist believes that he lives in the best of all possible worlds.
As does the pessimist.

Thread Previous | 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