How to find the cause of a malloc “double free” error?

后端 未结 13 788
情深已故
情深已故 2020-11-27 09:51

I\'m programming an application in Objective-C and I\'m getting this error:

MyApp(2121,0xb0185000) malloc: *** error for object 0x1068310: double

相关标签:
13条回答
  • To find these kinds of memory and pointer problems in general, you want to run your code against a runtime memory error checker like Valgrind. This should be able to point out lots of things your code is doing wrong, beyond those that cause it to crash.

    Valgrind can work on OSX (though it says it's "unsupported and incomplete and buggy"), and with a little hacking someone got it to work on iPhone SDK executables.

    Even better you can try Instruments, which is part of XCode. There's a tutorial for running it here.

    0 讨论(0)
提交回复
热议问题