Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I track down a segmentation fault in a Cocoa application?

I'm having a problem with a Cocoa application I am writing. It has to parse a timestamped file that is updated every hour, and during testing it keeps crashing consistently at around 11:45 PM due to a segmentation fault. I'm assuming I must be messaging an object that has been deallocated. What tools are provided with the Xcode install to track object allocations and (hopefully) tell me if I am messaging an object that has been deallocated?

I am using Mac OS X 10.5.

like image 939
mipadi Avatar asked Dec 30 '25 20:12

mipadi


1 Answers

I would recommend the following:

  • Use NSZombieEnabled to monitor when messages are sent to deallocated NSObjects
  • Use Instruments to track object allocations and/or memory leaks
like image 56
fbrereto Avatar answered Jan 02 '26 09:01

fbrereto



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!