Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Signal 11, segmentation fault on iphone App exit

I have an iphone app. It seems to run fine. When I connect to a provisioned iphone to Xcode and run the App, the console log in the Organizer window, always complains about a Segmentation fault when quitting the app with the home key.

Has anyone else seen this, and do you have an idea of what the problem might be? I use a thread to load web pages in the backround, but I stop the thread when exiting.

My app does save some persistent information. When I use the build and analyze function I get some 2 potential memory leaks, but in each case I'm allocating an object and keeping it in an array.

Any ideas, or is this normal?

like image 627
Gerry Avatar asked Dec 04 '09 22:12

Gerry


People also ask

What causes segmentation fault 11?

When Segmentation fault 11 occurs, it means that a program has attempted to access a memory location that it's not allowed to access. The error can also occur if the application tries to access memory in a method that isn't allowed.

What causes signal 11?

ANSWER. Signal 11, or officially know as "segmentation fault", means that the program accessed a memory location that was not assigned. That's usually a bug in the program. So if you're writing your own program, that's the most likely cause.


1 Answers

Try running your application with NSZombieEnabled. This will tell you if you're over releasing any object. To enable zombies do the following:

  1. Choose Project > Edit Active Executable to open the executable Info window.
  2. Click Arguments.
  3. Click the add (+) button in the “Variables to be set in the environment” section.
  4. Enter NSZombieEnabled in the Name column and YES in the Value column.
  5. Make sure that the checkmark forthe NSZombieEnabled entry is selected.
like image 141
lyonanderson Avatar answered Nov 03 '22 23:11

lyonanderson