develooper Front page | perl.perl5.porters | Postings from March 2017

Re: [perl #131046] [PATCH] Carp: Do not crash when reading @DB::args

Thread Previous | Thread Next
March 25, 2017 21:39
Re: [perl #131046] [PATCH] Carp: Do not crash when reading @DB::args
Message ID:
via RT wrote:
>This patch safely iterates all elements of @DB::args array

It's not safe.  The underlying problem is stack refcounting, leading to
@DB::args pointing into freed memory.  Interpreting freed memory as SV
structures fundamentally cannot be made safe.  A patch like this would
avoid crashing in a few specific cases, where you're lucky enough that
the freed memory is still recognisable as freed, but this is neither
necessary nor sufficient in order to avoid crashing.

This manifestation of the stack refcounting problem can only be solved
by actually fixing stack refcounting.  In the meantime I'm disinclined
to apply any such inadequate bandaid.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About