From: Andrew Choi Date: 2010-01-06T10:17:41+09:00 Subject: Re: How Do I Debug This?
unsubscribe - Andrew Choi(achoi@hanmail.net)




---------[ 閤精 五析 鎧遂 ]----------
薦鯉 : Re: How Do I Debug This?
劾促 : 2010鰍 1杉 06析 呪推析, 神穿 08獣 21歳 37段 +0900
左浬戚 : Jeremy Hinegardner <jeremy@hinegardner.org>
閤澗戚 : ruby-talk@ruby-lang.org (ruby-talk ML)

On Wed, Jan 06, 2010 at 07:59:34AM +0900, James Edward Gray II wrote:
> I'm getting an error in a test suite for an FFI project:
>
> ............................................................................................................................................ruby(1756) malloc: *** error for object 0x101c39310: pointer being freed was not allocated
> *** set a breakpoint in malloc_error_break to debug
>
> I assume I'm forgetting to free an allocated chunk of memory. What's te best way to zero in on the issue?
>
> Is the breakpoint suggestion a gdb tip? Is there anywhere I could go read about how to look into that?
>
> Thanks in advance for the advice.
>
> James Edward Gray II

When I have something like this, I generally will compile a debug (-g)
version of ruby and then run the spec/test via gdb to figure it out. Do a stack
trace in gdb and look where the free is being called and go from there.

I'm guessing that this might be showing up in your new OklahomaMixer project
and that this free might be happening in relation to a Tokyo Cabinet call :-).

If that is the case, I'd also compile a debug version of TC for you to use
with FFI, and you might need a debug version of FFI also.

enjoy,

-jeremy

--
========================================================================
Jeremy Hinegardner jeremy@hinegardner.org





耕焼達奄 跳凪昔