Nicholas Clark wrote > Sent: Tuesday, January 29, 2008 5:16 AM > To: Kort, Eric > Cc: 'perl-xs@perl.org' > Subject: Re: problem with newSViv and changing int value > > > On Mon, Jan 28, 2008 at 05:06:55PM -0500, Kort, Eric wrote: > > Unfortunately, when I attempt to recreate the error I am about to > > describe in a tidy little function, I can't. But within the larger > > context of my image processing routine, I am encountering the > > following strangeness: > > > *** glibc detected *** perl: munmap_chunk(): invalid pointer: > > 0x00007fff7f692410 *** > > As you seem to be on Linux, have you tried using valgrind on > the offending program? The cause might actually be somewhere > completely different, and often it is helpful in finding it.
I assumed it would be hard/impossible to use valgrind on XS code run by a perl script. Turned out to be easy (valgrind --leak-check=yes --trace-children=yes perl test.pl) And yes, the problem was memory mismanagement remote to the place where the problem finally reared its ugly head. Thanks, Eric > Nicholas Clark > This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient(s) please contact the sender by reply email and destroy all copies of the original message. Thank you.