Skip to content

Frequent crash in -[LARSAdController cleanUpAdAdapter:] #106

@chamberlain2007

Description

@chamberlain2007

I'm seeing a fairly frequent crash in production, caused by removing an observer from an ad adapter which it is not observing, along the lines of the following:

Cannot remove an observer <LARSAdController 0x155c0f40> for the key path "adVisible" from <TOLAdAdapterGoogleAds 0x1f1f7db0> because it is not registered as an observer.

Full stacktrace is as follows:

Thread : Fatal Exception: NSRangeException
0  CoreFoundation                 0x30b75f0b __exceptionPreprocess + 130
1  libobjc.A.dylib                0x3b30cce7 objc_exception_throw + 38
2  CoreFoundation                 0x30b75e4d -[NSException initWithCoder:]
3  Foundation                     0x314c2b0f -[NSObject(NSKeyValueObserverRegistration) _removeObserver:forProperty:] + 578
4  Foundation                     0x314c2537 -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:] + 166
5  Transit360                     0x001fade3 -[LARSAdController cleanUpAdAdapter:] (LARSAdController.m:404)
6  UIKit                          0x333f8b3b -[UIViewAnimationBlockDelegate _sendDeferredCompletion:] + 66
7  Foundation                     0x31555117 __NSFireDelayedPerform + 414
8  CoreFoundation                 0x30b40f4f __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 14
9  CoreFoundation                 0x30b40b6b __CFRunLoopDoTimer + 794
10 CoreFoundation                 0x30b3eef3 __CFRunLoopRun + 1218
11 CoreFoundation                 0x30aa9769 CFRunLoopRunSpecific + 524
12 CoreFoundation                 0x30aa954b CFRunLoopRunInMode + 106
13 GraphicsServices               0x35a166d3 GSEventRunModal + 138
14 UIKit                          0x33408891 UIApplicationMain + 1136
15 Transit360                     0x00021d93 main (main.m:23)
16 libdyld.dylib                  0x3b80aab7 start + 2

I haven't been able to reproduce the crash with any consistency (I've seen it a few times), but have seen it a few times. However, it outweighs the other crashes in Crashlytics by a wide margin.

We are currently using version 3.0.2 installed via CocoaPods. I see there has been some work around the KVO with kLARSAdObserverKeyPathAdLoaded, but this seems to be the opposite issue with kLARSAdObserverKeyPathIsAdVisible: instead of registering too many times for notifications, it seems to happen to few.

Any thoughts on this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions