Page 1 of 1

Double free or corruption error after exit

Posted: Sat Jan 04, 2014 9:55 pm
by chanko08
Hello, I'm working on the camera for my game, and I ran into an odd issue with a bit of the graphics api. If I use love.graphics.push() and love.graphics.pop(), when I quit the game I get an big backtrace and the error. I know it's related to these functions because I don't get the error if I comment them out.

Code: Select all

*** Error in `love': double free or corruption (out): 0x09a3e668 ***
Has anybody run into this error before?

In case it matters I am using version 0.9.0. Thank you for your help.

edit: Sorry, I didn't realize first posters couldnt attach files, here's a url https://www.dropbox.com/s/h95ug7nkkd6h2gu/mario.love
edit 2: The memory error happens after my love.quit is called as well.
edit 3: Apparently this happens in both of my computers, 32 and 64 bit. I originally thought that maybe it was an opengl issue, but I guess it must be something different.

Re: Double free or corruption error after exit

Posted: Sun Jan 05, 2014 3:31 am
by slime
I don't get the error running OS X, but someone else does running Windows 8. What OS are you testing on?

Does it still happen if you use a nightly build of LÖVE? http://love2d.org/builds

Re: Double free or corruption error after exit

Posted: Sun Jan 05, 2014 3:59 am
by chanko08
This happens for Ubuntu 13.10 32-bit and Ubuntu 13.04 64-bit. I'll give the nightly build a shot to see if that takes care of the issue.

edit: I gave the latest stable build a try on my 64-bit machine, and the issue exists there too.

Re: Double free or corruption error after exit

Posted: Sun Jan 05, 2014 8:01 pm
by slime
Does it still happen if you comment out the 'love.graphics.reset()' line in physics.lua?

Re: Double free or corruption error after exit

Posted: Sun Jan 05, 2014 10:00 pm
by chanko08
After commenting out love.graphics.reset() (and leaving the pop() and push() uncommented) the corruption error stops, but for some reason my tiles were being colored the red color I was using in that same code block. Am I using the drawing api incorrectly there?

edit: I can't say I know what was going on with that corruption error, but if I reset the color back by just storing it instead of calling the reset() method I can avoid the error while still being able to use push() and pop(). Perhaps there's some initialization stuff I need to do to use the graphics reset?

Re: Double free or corruption error after exit

Posted: Mon Jan 06, 2014 7:24 am
by slime
The crash because of love.graphics.reset was a bug in LÖVE you helped find, it's been fixed now for the next release (probably 0.9.1). :)