develooper Front page | perl.perl5.porters | Postings from July 2010

Re: Fwd: [PATCH] Re: [perl #74170] Data::Dumper -- dumping largehash returns empty string, segfaults perl

Thread Previous
From:
Tony Cook
Date:
July 2, 2010 20:30
Subject:
Re: Fwd: [PATCH] Re: [perl #74170] Data::Dumper -- dumping largehash returns empty string, segfaults perl
Message ID:
20100703032955.GA18266@mars.tony.develop-help.com
On Tue, Jun 15, 2010 at 07:11:43PM -0700, Father Chrysostomos wrote:
> I forgot to CC this to the list.
>
> Begin forwarded message:
>
>> From: Father Chrysostomos
>> Date: June 6, 2010 12:59:22 PM PDT
>> To: Tony Cook
>> Subject: Re: [PATCH] Re: [perl #74170] Data::Dumper -- dumping large  
>> hash returns empty string, segfaults perl
>>
>>
>> On May 31, 2010, at 6:19 AM, Tony Cook wrote:
>>
>>> On Sun, May 23, 2010 at 01:55:08PM -0700, Father Chrysostomos wrote:
>>>> 			newapad = apad;
>>>> 		
>>>> +		    diff = SP - PL_stack_sp;
>>>> 		    DD_dump(aTHX_ val, SvPVX_const(name), SvCUR(name), valstr,  
>>>> seenhv,
>>>> 			    postav, &level, indent, pad, xpad, newapad, sep, pair,
>>>> 			    freezer, toaster, purity, deepcopy, quotekeys,
>>>> 			    bless, maxdepth, sortkeys);
>>>> +		    /* DD_dump might have called a custom sort routine that
>>>> +		       might have reallocated the stack (see
>>>> +		       [perl #74170]). */
>>>> +		    SPAGAIN;
>>>> +		    SP += diff;
>>>> 		
>>>
>>> Couldn't that just be:
>>>
>>> PUTBACK;
>>> ...
>>> SPAGAIN;
>>>
>>> ?
>>
>> I have no idea. :-)
>>
>> I believe that will cause PL_stack_sp to have a different value when  
>> the custom sort sub is called, but I don’t know enough about perl’s  
>> stack to say whether that will make any difference.
>>
>> Father Chrysostomos
>>

Could someone with a better internals understanding take a look at
this?

I wouldn't expect any problems with a simple PUTBACK/SPAGAIN, but then
what do I know?

Tony

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