develooper Front page | perl.perl5.porters | Postings from December 2011

[perl #104034] perl with usemymalloc='y' fails to compile after commit 70b71ec

Thread Previous
Peter Martini via RT
December 3, 2011 04:24
[perl #104034] perl with usemymalloc='y' fails to compile after commit 70b71ec
Message ID:
So, I've worked out the issue (thanks to the previous updaters for
locating the bug).

sv_usepvn_flags is documented as expecting a pointer to malloced memory,
and since perl's malloc does its accounting in line, will neither
operate properly nor die cleanly if its passed a pointer to memory that
isn't an address that it handed out to the rest of perl at some point. 
Specifically, if RCHECK is on, it maintains a guard value to make sure
that illegitimate memory isn't being used, and since that guard value is
written outside of the memory its allocating, its overwriting some
essentially random address in memory.

Considering what sv_sethek needs from sv_usepvn_flags - just the
overwritten immediately after the call anyway), and SvTAINT (although I
admit I don't know if this is necessary), inlining those calls into
sv_sethek directly instead of via sv_usepvn_flags gets my perl to build
again, and make test finds all tests pass.

Attached is a patch.

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