0

Many of my app users are experiencing following crash.

It is only affecting users on iOS 4.3.x (Device could be any - iPhone/iPad/iPod)

0    libobjc.A.dylib 0x34f00c98 objc_msgSend + 15
1    CoreFoundation 0x3134bc43 -[NSObject(NSObject) release] + 30
2    UIKit 0x314c900f -[UIViewController dealloc] + 174
3    UIKit 0x3151f0cd -[UITableViewController dealloc] + 124
4    MyApp 0x0001f985 -[WebNotesListViewController dealloc] (WebNotesListViewController.m:61)
5    CoreFoundation 0x3134bc43 -[NSObject(NSObject) release] + 30
6    MyApp 0x41b3 __arclite_objc_storeStrong (arclite.m:252)
7    MyApp 0x000bc44d -[CountTouchGR .cxx_destruct] (CountTouchGR.m:13)
8    libobjc.A.dylib 0x34f01961 object_cxxDestructFromClass + 52
9    libobjc.A.dylib 0x34f03b15 object_cxxDestruct + 12
10   libobjc.A.dylib 0x34f03b25 objc_destructInstance + 12
11   libobjc.A.dylib 0x34f01917 object_dispose + 26
12   CoreFoundation 0x3134bee5 -[NSObject(NSObject) dealloc] + 24
13   UIKit 0x314aead7 -[UIGestureRecognizer dealloc] + 346
14   UIKit 0x316aefc3 -[UISwipeGestureRecognizer dealloc] + 62
15   CoreFoundation 0x3134bc43 -[NSObject(NSObject) release] + 30
16   CoreFoundation 0x3134c1a1 CFRelease + 68
17   CoreFoundation 0x31352139 -[__NSArrayM removeObjectAtIndex:] + 88
18   CoreFoundation 0x3135a9dd -[NSMutableArray removeAllObjects] + 36
19   UIKit 0x31470fcf -[UIView(UIViewGestures) removeAllGestureRecognizers] + 174
20   UIKit 0x31470e6f -[UIView dealloc] + 294
21   UIKit 0x315b27e5 -[UIScrollView dealloc] + 252
22   UIKit 0x315bed0d -[UITableView dealloc] + 676
23   CoreFoundation 0x3134bc43 -[NSObject(NSObject) release] + 30
24   UIKit 0x314828df -[UIViewController setView:] + 270
25   UIKit 0x315759cb -[UIViewController unloadViewForced:] + 78
26   UIKit 0x315856b9 -[UIViewController unloadViewIfReloadable] + 16
27   UIKit 0x315cc12d -[UIViewController purgeMemoryForReason:] + 40
28   UIKit 0x315cc14d -[UIViewController didReceiveMemoryWarning] + 16
29   MyApp 0x0001fc3b -[WebNotesListViewController didReceiveMemoryWarning] (WebNotesListViewController.m:101)
30   UIKit 0x315cc163 -[UIViewController _didReceiveMemoryWarning:] + 14
31   Foundation 0x34c28183 _nsnote_callback + 142
32   CoreFoundation 0x313b620f __CFXNotificationPost_old + 402
33   CoreFoundation 0x31350eeb _CFXNotificationPostNotification + 118
34   Foundation 0x34c255d3 -[NSNotificationCenter postNotificationName:object:userInfo:] + 70
35   Foundation 0x34c271c1 -[NSNotificationCenter postNotificationName:object:] + 24
36   UIKit 0x315a2361 -[UIApplication _performMemoryWarning] + 48
37   UIKit 0x315a2d83 -[UIApplication _receivedMemoryNotification] + 126
38   UIKit 0x315a0507 _memoryStatusChanged + 42
39   CoreFoundation 0x313b6d69 __CFNotificationCenterDarwinCallBack + 24
40   CoreFoundation 0x313b3bdf __CFMachPortPerform + 210
41   CoreFoundation 0x313bea97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
42   CoreFoundation 0x313c083f __CFRunLoopDoSource1 + 166
43   CoreFoundation 0x313c160d __CFRunLoopRun + 520
44   CoreFoundation 0x31351ec3 CFRunLoopRunSpecific + 230
45   CoreFoundation 0x31351dcb CFRunLoopRunInMode + 58
46   GraphicsServices 0x30cd041f GSEventRunModal + 114
47   GraphicsServices 0x30cd04cb GSEventRun + 62
48   UIKit 0x31477d69 -[UIApplication _run] + 404
49   UIKit 0x31475807 UIApplicationMain + 670
50   MyApp 0x4239 main (main.m:14)

I am unable to decipher the real cause (Can converting to ARC has any relation with it?).

BufferStack
  • 549
  • 9
  • 20
  • There's a similar problem in [this question](http://stackoverflow.com/questions/9155455/uitableview-crashes-when-the-same-row-is-selected-twice/9155477#9155477) – tipycalFlow Feb 11 '12 at 06:02

4 Answers4

2

You're sending a message to an object which has already been deallocated. Try reproducing the crash while using the NSZombies instrument.

Also, without Zombies, try setting a breakpoint at the beginning of [WebNotesListViewController dealloc] and stepping through until you hit the crash.

Community
  • 1
  • 1
Matthew Bischoff
  • 1,043
  • 11
  • 27
  • k.. I am now able to reproduce crash.. but when I perform the same steps with Zombies enabled.. the app doesn't crash & no message is written to the log.. I even tried Zombies Instrument.. it doesn't flag anything either.. what am I missing.. (I am new to Zombies.. followed different tutorials - but still no help!) – BufferStack Feb 11 '12 at 07:33
1

Seems like WebNotesListViewController.m:101 got a memory warning. Hence it (the view) was unloaded and in the process deallocated. And then one of its attributes were referenced giving an EXEC_BAD_ACCESS

mbh
  • 3,302
  • 2
  • 22
  • 24
1

In the didReceiveMemoryWarning method of WebNotesListViewController you are doing something you should not in releasing memory - hard to say exactly what but it seems to have something to do with your table.

Pretty sure it is related to the ARC conversion, see what the code might be doing in that method.

EDIT:

On second look, do you still have a dealloc in your WebNotesListViewController class - the crash is really coming from that class being deallocated.

Kendall Helmstetter Gelner
  • 74,769
  • 26
  • 128
  • 150
  • that method only has `[super didReceiveMemoryWarning];` line of code – BufferStack Feb 11 '12 at 06:18
  • Somewhere else in the class then you are causing one of the objects in the view to get released. Matthew's suggestion is a good one, run your code with Zombies enabled in the simulator - then in the simulator menu select "simulate memory warning" which should trigger this bug. – Kendall Helmstetter Gelner Feb 11 '12 at 06:44
  • can you please read my comment on Matthew's post & suggest a solution? – BufferStack Feb 11 '12 at 07:53
  • Sorry, nothing to be added to that - if it does not flag the crash you are out of luck as far as Zombies goes. Added another thought to my response. – Kendall Helmstetter Gelner Feb 11 '12 at 08:10
  • Well, also try "Edit Scheme" and set the "Profile" command to use a Debug build instead of release. Then it might flag. – Kendall Helmstetter Gelner Feb 11 '12 at 08:10
  • "Profile" is already set "debug" build. Even "Record Ref Counts" & "Enable Zombies detection" are enabled in Allocations Instrument. If Zombies cannot help :(, what else can be tried? – BufferStack Feb 11 '12 at 08:15
0

The problem was related to CountTouchGR class... I do not know the exact technical reason.. but it needed to be declared as global variable, not in viewDidLoad as was being done earlier.

Thanks to all who tried helping.

BufferStack
  • 549
  • 9
  • 20