[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
Chipmunk Physics • View topic - Possible memory leak in 6.x.x rev 765 (perhaps arbitrer)

Possible memory leak in 6.x.x rev 765 (perhaps arbitrer)

Discuss any Chipmunk bugs here.

Possible memory leak in 6.x.x rev 765 (perhaps arbitrer)

Postby valefor » Sun Jun 19, 2011 11:35 am

valefor
 
Posts: 1
Joined: Fri Jun 17, 2011 1:22 pm

Re: Possible memory leak in 6.x.x rev 765 (perhaps arbitrer)

Postby slembcke » Sun Jun 19, 2011 1:57 pm

Hmm. I tried to test this pretty heavily with libGuardMalloc, but I might have missed a couple dangling pointers. I'll have to take another look at this.

Also, thank you, thank you, thank you for a simple test program! That makes it so much easier to find bugs.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Possible memory leak in 6.x.x rev 765 (perhaps arbitrer)

Postby slembcke » Sun Jun 19, 2011 2:54 pm

Neat. So I've never actually tried Valgrind before. Apparently I should more often.

One of the warnings was because you were removing a shape from the callback for cpBodyEachShape(). I fixed cpBodyEachShape() to use a while loop so it's safe to remove them now. The second invalid read I think I understand what is happening, but not how it got to that state. The invalid write in unthreadHelper() is a result of the bad read.

I haven't committed anything yet, I'll have to take a closer look tomorrow probably.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Possible memory leak in 6.x.x rev 765 (perhaps arbitrer)

Postby slembcke » Wed Jun 22, 2011 2:46 pm

Ok! So I modified it so that you can remove objects from a space during a cpBodyEach*() call. That was one of your warnings. The second was a dangling pointer bug that I fixed.

Thank you for the clear replication steps. That's always very helpful.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm


Return to Bugs

Who is online

Users browsing this forum: No registered users and 2 guests

cron