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

SPAGAIN/PUTBACK trip hazards (was Re: [perl #78674] stack pointercorruption in pp_concat() with 'use encoding')

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
May 8, 2013 12:18
Subject:
SPAGAIN/PUTBACK trip hazards (was Re: [perl #78674] stack pointercorruption in pp_concat() with 'use encoding')
Message ID:
20130508121830.GX3729@plum.flirble.org
On Thu, Oct 28, 2010 at 02:22:36PM -0700, Niko Tyni wrote:

> This is due to stack pointer corruption in Perl_pp_concat() when the
> stack gets reallocated in the sv_utf8_upgrade_nomg() call (implemented
> with sv_utf8_upgrade_flags_grow()). See below for the full backtrace to
> the corresponding Perl_stack_grow() call.

I can't find any.

I was wondering, is a better solution to this whole problem to ensure that
anything that creates an inferior runloop does so on a freshly allocated
stack?

The whole paradigm of needing to get and "put back" a local copy of the
stack pointer seems fragile, and something that dates from an age of machines
with much tighter resource constraints.

(Heck, and effectively predates common use of tie, overloading, PerlIO and
the growing supply of hooks which can end up running code within what looks
like an innocent C function call)

Nicholas Clark

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