EXC_BAD_ACCESS (SIGBUS) and EXC_BAD_ACCESS (SIGSEGV) crashes when app wakes

4

I am having some issues with an app crashing that I need some direction so i can fix it. I have an app with the main view and a modal view, much like the default flipside utility template. When I run the app the first time, everything runs fine including the modal view. However, when I return to the home screen then return to the app, the app will crash if I have activated the modal view in the previous session. (Not knowing the term and being a noob, I'm calling this the app waking up.) If I didn't activate the modal view and just stayed on the main view in the previous session, then the app resumes running with out any problems.

Now, I'm having problems tracking this down further and would appreciate some direction. When I stop the app while running through xcode the debugger stops. Instruments is telling me I already fixed all the memory leaks. These are the most recent crash logs:

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000008
Crashed Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x35248c98 0x35246000 + 11416
1   CoreLocation                    0x35205f78 0x351fe000 + 32632
2   CoreLocation                    0x35206f42 0x351fe000 + 36674
3   CoreLocation                    0x35204a64 0x351fe000 + 27236
4   CoreLocation                    0x3520078a 0x351fe000 + 10122
5   CoreLocation                    0x352018cc 0x351fe000 + 14540
6   CoreLocation                    0x35202d50 0x351fe000 + 19792
7   CoreFoundation                  0x316fd706 0x31691000 + 444166
8   CoreFoundation                  0x31706a90 0x31691000 + 481936
9   CoreFoundation                  0x31708838 0x31691000 + 489528
10  CoreFoundation                  0x31709606 0x31691000 + 493062
11  CoreFoundation                  0x31699ebc 0x31691000 + 36540
12  CoreFoundation                  0x31699dc4 0x31691000 + 36292
13  GraphicsServices                0x31018418 0x31014000 + 17432
14  GraphicsServices                0x310184c4 0x31014000 + 17604
15  UIKit                           0x317bfd62 0x31791000 + 191842
16  UIKit                           0x317bd800 0x31791000 + 182272
17  MyApp                           0x000021a4 0x1000 + 4516
18  MyApp                           0x00002158 0x1000 + 4440

And

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x709ffd70
Crashed Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x35248ca4 0x35246000 + 11428
1   CoreLocation                    0x35206f42 0x351fe000 + 36674
2   CoreLocation                    0x35204a64 0x351fe000 + 27236
3   CoreLocation                    0x3520078a 0x351fe000 + 10122
4   CoreLocation                    0x352018cc 0x351fe000 + 14540
5   CoreLocation                    0x35202d50 0x351fe000 + 19792
6   CoreFoundation                  0x316fd706 0x31691000 + 444166
7   CoreFoundation                  0x31706a90 0x31691000 + 481936
8   CoreFoundation                  0x31708838 0x31691000 + 489528
9   CoreFoundation                  0x31709606 0x31691000 + 493062
10  CoreFoundation                  0x31699ebc 0x31691000 + 36540
11  CoreFoundation                  0x31699dc4 0x31691000 + 36292
12  GraphicsServices                0x31018418 0x31014000 + 17432
13  GraphicsServices                0x310184c4 0x31014000 + 17604
14  UIKit                           0x317bfd62 0x31791000 + 191842
15  UIKit                           0x317bd800 0x31791000 + 182272
16  MyApp                           0x000021a4 0x1000 + 4516
17  MyApp                           0x00002158 0x1000 + 4440

So, from what i've read, it seems like I'm referencing an object that has been erased or overwritten somehow? With that i'm just grasping at straws and am not sure how I would even track that down.

Thoughts?

iphone
objective-c
cocoa-touch
exc-bad-access
asked on Stack Overflow May 19, 2011 by Brad Stewart • edited May 20, 2011 by (unknown user)

1 Answer

3

From respondsToSelector call it's probably your ModalView, AddPersonViewController I guess, that is retaining instead of assigning delegate property or not setting to nil delegate in dealloc and viewDidUnload. In that case it will try to send message to non existing to which you delegate still holds reference.

@property (nonatomic, assign) id <delegate> *delegate;


self.delegate = nil; in dealloc and viewDidUnload.
answered on Stack Overflow May 20, 2011 by TheBlack

User contributions licensed under CC BY-SA 3.0