I have a piece of code which runs correctly in real device but is giving EXC_BAD_ACCESS (code=1, address=0x0) error in simulator (iphone 6) :
The bt output is:
(lldb) bt
* thread #1: tid = 0xe40f6, 0x00000001052ab5e9 CoreFoundation`CFArrayGetCount + 25, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x00000001052ab5e9 CoreFoundation`CFArrayGetCount + 25
* frame #1: 0x0000000104c6a5af MyApp`static MyApp.SSID.fetchSSIDInfo (self=MyApp.SSID)() -> Swift.String + 95 at WifiGetter.swift:17
frame #2: 0x0000000104c4994a MyApp`MyApp.TableViewController.sendWifi (self=0x00007ff05a64da80)() -> () + 26 at TableViewController.swift:355
frame #3: 0x0000000104c49316 MyApp`MyApp.TableViewController.fetchData (self=0x00007ff05a64da80)() -> () + 38 at TableViewController.swift:308
frame #4: 0x0000000104c4567f MyApp`MyApp.TableViewController.viewDidLoad (self=0x00007ff05a64da80)() -> () + 3215 at TableViewController.swift:66
frame #5: 0x0000000104c45ea2 MyApp`#objc MyApp.TableViewController.viewDidLoad (MyApp.TableViewController)() -> () + 34 at TableViewController.swift:0
frame #6: 0x00000001063c9931 UIKit`-[UIViewController loadViewIfRequired] + 1344
frame #7: 0x000000010640cc26 UIKit`-[UINavigationController _layoutViewController:] + 54
frame #8: 0x000000010640d4dd UIKit`-[UINavigationController _updateScrollViewFromViewController:toViewController:] + 433
frame #9: 0x000000010640d633 UIKit`-[UINavigationController _startTransition:fromViewController:toViewController:] + 116
frame #10: 0x000000010640e879 UIKit`-[UINavigationController _startDeferredTransitionIfNeeded:] + 890
frame #11: 0x000000010640f67d UIKit`-[UINavigationController __viewWillLayoutSubviews] + 57
frame #12: 0x00000001065a763d UIKit`-[UILayoutContainerView layoutSubviews] + 248
frame #13: 0x00000001062ef11c UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 710
frame #14: 0x000000010c35836a QuartzCore`-[CALayer layoutSublayers] + 146
frame #15: 0x000000010c34cbd0 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 366
frame #16: 0x000000010c34ca4e QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 24
frame #17: 0x000000010c3411d5 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 277
frame #18: 0x000000010c36e9f0 QuartzCore`CA::Transaction::commit() + 508
frame #19: 0x000000010c36f154 QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
frame #20: 0x00000001053079d7 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
frame #21: 0x0000000105307947 CoreFoundation`__CFRunLoopDoObservers + 391
frame #22: 0x00000001052fcebc CoreFoundation`CFRunLoopRunSpecific + 524
frame #23: 0x000000010623998d UIKit`-[UIApplication _run] + 402
frame #24: 0x000000010623e676 UIKit`UIApplicationMain + 171
frame #25: 0x0000000104c20efd MyApp`main + 109 at AppDelegate.swift:20
frame #26: 0x0000000108ea592d libdyld.dylib`start + 1
interfaces is nil. You must handle this case. I recommend avoiding !. Making the type non-optional here will allow the if let binding to work correctly.
You should change your if let clause to if let interfaces = CNCopySupportedInterfaces() as? CFArray.
Because you use if let interfaces: CFArray! with ! mean force unwrap, therefore, when CNCopySupportedInterfaces() return nil or value which is not convertible to CFArray, force unwrap will cause crash
Related
I have a very simple Xcode UI Test with this function:
func waitForElementToAppear(_ element: XCUIElement) -> Bool {
let predicate = NSPredicate(format: "exists == true")
let exp = expectation(for: predicate, evaluatedWith: element, handler: nil)
let result = XCTWaiter().wait(for: [exp], timeout: 10)
return result == .completed
}
Which has always worked for me before Xcode 9. I am not sure if this is an Xcode 10 issue, but it has recently started without me adding or changing any code.
Here is my test code:
func testTabBarPress() {
let tabbar = self.app.tabBars["my_tabbar"]
print(tabbar)
}
This test succeeds - always.
func testTabBarPress() {
let tabbar = self.app.tabBars["my_tabbar"]
print(tabbar)
if tabbar.isHittable {
}
}
This test fails - always. It does not JUST fail, it crashes with Thread 1: EXC_BAD_ACCESS (code=1, address=0x0).
After more than 99.945 seconds it switches from crashed state to failed test state with the message: Timeout waiting for fulfillment of promise for 'remote query'..
This test:
func testTabBarPress() {
let tabbar = self.app.tabBars["my_tabbar"]
print(tabbar)
if waitForElementToAppear(tabbar) {
}
}
Crashes with the same message of EXC_BAD_ACCESS but it does succeed afterwards.
I also did reset the simulators, cleaned the build folder and updated Xcode to 10.2.1 (10E1001)
At the top of my test I define my app:
private var app: XCUIApplication = XCUIApplication() and in setup() I launch it.
Any help appreciated. Thanks!
Edit:
Here is the stack trace:
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x0000000113a833d0 libsystem_platform.dylib`_platform_strcmp + 80
frame #1: 0x00000001322086f1 UIKit`-[UIViewAccessibility _accessibilityRetrieveIvarText] + 364
frame #2: 0x00000001321f5e54 UIKit`-[UITableViewCellAccessibility _accessibilityRetrieveTableViewIvarsText] + 118
frame #3: 0x00000001321f6b27 UIKit`-[UITableViewCellAccessibility _accessibilityRetrieveTableViewCellText:] + 2749
frame #4: 0x00000001321f99c1 UIKit`-[UITableViewCellAccessibility accessibilityLabel] + 123
frame #5: 0x000000012ee47739 PreferencesFramework`-[UITableViewCellAccessibility__Preferences__UIKit accessibilityLabel] + 327
frame #6: 0x000000013243f31c UIAccessibility`-[NSObject(AXPrivCategory) _accessibilityPotentiallyAttributedValueForNonAttributedSelector:attributedSelector:] + 244
frame #7: 0x000000013243f478 UIAccessibility`-[NSObject(AXPrivCategory) _accessibilityAXAttributedLabel] + 41
frame #8: 0x00000001321d620e UIKit`-[UINavigationBarAccessibility_UIViewAccessibilityAdditions _accessibilityAXAttributedLabel] + 650
frame #9: 0x000000013220b711 UIKit`-[UITableViewCellAccessibilityElement accessibilityLabel] + 48
frame #10: 0x000000013243f31c UIAccessibility`-[NSObject(AXPrivCategory) _accessibilityPotentiallyAttributedValueForNonAttributedSelector:attributedSelector:] + 244
frame #11: 0x000000013243f478 UIAccessibility`-[NSObject(AXPrivCategory) _accessibilityAXAttributedLabel] + 41
frame #12: 0x000000013243e9ae UIAccessibility`-[NSObject(AXPrivCategory) _accessibilityProcessedLabelAttribute] + 34
frame #13: 0x0000000132442c32 UIAccessibility`-[NSObject(AXPrivCategory) accessibilityAttributeValue:] + 268
frame #14: 0x000000013246cacd UIAccessibility`_accessibilityAttributesForObject + 493
frame #15: 0x000000013246c43a UIAccessibility`-[NSObject(UIAccessibilityAutomation) _accessibilityUserTestingSnapshotDescendantsWithAttributes:maxDepth:maxChildren:maxArrayCount:] + 1239
frame #16: 0x000000013246dfd9 UIAccessibility`-[NSObject(UIAccessibilityAutomation) _accessibilityUserTestingSnapshotWithOptions:] + 1139
frame #17: 0x0000000132441f09 UIAccessibility`-[NSObject(AXPrivCategory) accessibilityAttributeValue:forParameter:] + 8537
frame #18: 0x00000001321cb100 UIKit`-[UIApplicationAccessibility accessibilityAttributeValue:forParameter:] + 290
frame #19: 0x0000000132424657 UIAccessibility`_copyParameterizedAttributeValueCallback + 434
frame #20: 0x0000000130ef1629 AXRuntime`___AXXMIGCopyParameterizedAttributeValue_block_invoke + 50
frame #21: 0x0000000130ef0f99 AXRuntime`_handleNonMainThreadCallback + 55
frame #22: 0x0000000130ef14cb AXRuntime`_AXXMIGCopyParameterizedAttributeValue + 285
frame #23: 0x0000000130eec976 AXRuntime`AXUIElementCopyParameterizedAttributeValue + 495
frame #24: 0x0000000130e80351 XCTAutomationSupport`-[XCTAccessibilityFramework userTestingSnapshotForElement:options:error:] + 420
frame #25: 0x0000000130e77e90 XCTAutomationSupport`-[XCTElementSnapshotRequest(PlatformImplementation) accessibilitySnapshotOrError:] + 1263
frame #26: 0x0000000130e8305f XCTAutomationSupport`__56-[XCTElementSnapshotRequest loadSnapshotAndReturnError:]_block_invoke_2 + 64
frame #27: 0x0000000130e728dd XCTAutomationSupport`__XCTPerformOnMainRunLoop_block_invoke + 295
frame #28: 0x0000000111251aec CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
frame #29: 0x00000001112512b0 CoreFoundation`__CFRunLoopDoBlocks + 336
frame #30: 0x000000011124c10b CoreFoundation`__CFRunLoopRun + 2747
frame #31: 0x000000011124b302 CoreFoundation`CFRunLoopRunSpecific + 626
frame #32: 0x000000011748d2fe GraphicsServices`GSEventRunModal + 65
frame #33: 0x0000000119ea2ba2 UIKitCore`UIApplicationMain + 140
* frame #34: 0x000000010d2afa4b Musify`main at AppDelegate.swift:20:7
frame #35: 0x0000000113721541 libdyld.dylib`start + 1
frame #36: 0x0000000113721541 libdyld.dylib`start + 1
And here is a trace for a recording crash:
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x0000000107c223d0 libsystem_platform.dylib`_platform_strcmp + 80
frame #1: 0x00000001269186f1 UIKit`-[UIViewAccessibility _accessibilityRetrieveIvarText] + 364
frame #2: 0x0000000126905e54 UIKit`-[UITableViewCellAccessibility _accessibilityRetrieveTableViewIvarsText] + 118
frame #3: 0x0000000126906b27 UIKit`-[UITableViewCellAccessibility _accessibilityRetrieveTableViewCellText:] + 2749
frame #4: 0x00000001269099c1 UIKit`-[UITableViewCellAccessibility accessibilityLabel] + 123
frame #5: 0x0000000123633739 PreferencesFramework`-[UITableViewCellAccessibility__Preferences__UIKit accessibilityLabel] + 327
frame #6: 0x0000000126b4f31c UIAccessibility`-[NSObject(AXPrivCategory) _accessibilityPotentiallyAttributedValueForNonAttributedSelector:attributedSelector:] + 244
frame #7: 0x0000000126b4f478 UIAccessibility`-[NSObject(AXPrivCategory) _accessibilityAXAttributedLabel] + 41
frame #8: 0x00000001268e620e UIKit`-[UINavigationBarAccessibility_UIViewAccessibilityAdditions _accessibilityAXAttributedLabel] + 650
frame #9: 0x000000012691b711 UIKit`-[UITableViewCellAccessibilityElement accessibilityLabel] + 48
frame #10: 0x0000000126b4f31c UIAccessibility`-[NSObject(AXPrivCategory) _accessibilityPotentiallyAttributedValueForNonAttributedSelector:attributedSelector:] + 244
frame #11: 0x0000000126b4f478 UIAccessibility`-[NSObject(AXPrivCategory) _accessibilityAXAttributedLabel] + 41
frame #12: 0x0000000126b4e9ae UIAccessibility`-[NSObject(AXPrivCategory) _accessibilityProcessedLabelAttribute] + 34
frame #13: 0x0000000126b52c32 UIAccessibility`-[NSObject(AXPrivCategory) accessibilityAttributeValue:] + 268
frame #14: 0x0000000126b7cacd UIAccessibility`_accessibilityAttributesForObject + 493
frame #15: 0x0000000126b7c43a UIAccessibility`-[NSObject(UIAccessibilityAutomation) _accessibilityUserTestingSnapshotDescendantsWithAttributes:maxDepth:maxChildren:maxArrayCount:] + 1239
frame #16: 0x0000000126b7dfd9 UIAccessibility`-[NSObject(UIAccessibilityAutomation) _accessibilityUserTestingSnapshotWithOptions:] + 1139
frame #17: 0x0000000126b51f09 UIAccessibility`-[NSObject(AXPrivCategory) accessibilityAttributeValue:forParameter:] + 8537
frame #18: 0x00000001268db100 UIKit`-[UIApplicationAccessibility accessibilityAttributeValue:forParameter:] + 290
frame #19: 0x0000000126b34657 UIAccessibility`_copyParameterizedAttributeValueCallback + 434
frame #20: 0x00000001260bf629 AXRuntime`___AXXMIGCopyParameterizedAttributeValue_block_invoke + 50
frame #21: 0x00000001260bef99 AXRuntime`_handleNonMainThreadCallback + 55
frame #22: 0x00000001260bf4cb AXRuntime`_AXXMIGCopyParameterizedAttributeValue + 285
frame #23: 0x00000001260b94f0 AXRuntime`_XCopyParameterizedAttributeValue + 414
frame #24: 0x00000001260ce1b7 AXRuntime`mshMIGPerform + 237
frame #25: 0x00000001053ea419 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
frame #26: 0x00000001053e9a7b CoreFoundation`__CFRunLoopDoSource1 + 459
frame #27: 0x00000001053e400a CoreFoundation`__CFRunLoopRun + 2490
frame #28: 0x00000001053e3302 CoreFoundation`CFRunLoopRunSpecific + 626
frame #29: 0x000000010b62c2fe GraphicsServices`GSEventRunModal + 65
frame #30: 0x000000010e822ba2 UIKitCore`UIApplicationMain + 140
* frame #31: 0x00000001013dea4b Musify`main at AppDelegate.swift:20:7
frame #32: 0x00000001078c0541 libdyld.dylib`start + 1
frame #33: 0x00000001078c0541 libdyld.dylib`start + 1
By the way, recording and tapping on elements also crashes.
EDIT 2:
I figured out that using the Accessibility Identifier the App also crashes.. So I just need to hover over the Simulator to make the app crash. I am out of ideas :(
i have an issue where my app crashes when attached to the debugger in just one case. My App downloads json data and transform it into core data objects. For this purpose i start a background thread to load it and have a successHandler handling the import:
RemoteConnectionService.sharedInstance.sendRequest(UserRequest(userID: user!.webID.integerValue), successHandler: { requestHandler, result in
var userData = result["user"] as! [String: AnyObject]
self.user?.update(userData)
self.tableView.reloadData()
}, errorHandler: nil)
this works everywhere as expected. the successHandler is called on the main thread, core data gets updated and all. but when doing this special request (it happens always and only with this request) Xcode stop pointing to
class AppDelegate: UIResponder, UIApplicationDelegate
with no specific failure reason. here's the backtrace (via bt):
* thread #1: tid = 0x6ab4b, 0x00000001051b19c0 libobjc.A.dylib`objc_release + 16, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
frame #0: 0x00000001051b19c0 libobjc.A.dylib`objc_release + 16
frame #1: 0x00000001051b28cd libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 591
frame #2: 0x00000001082348d8 CFNetwork`-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 207
frame #3: 0x0000000108234a37 CFNetwork`-[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 48
frame #4: 0x00000001081043a7 CFNetwork`___ZN27URLConnectionClient_Classic26_delegate_didFinishLoadingEU13block_pointerFvvE_block_invoke + 107
frame #5: 0x00000001081d1891 CFNetwork`___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 273
frame #6: 0x00000001080ef6e6 CFNetwork`RunloopBlockContext::_invoke_block(void const*, void*) + 72
frame #7: 0x00000001057c13d4 CoreFoundation`CFArrayApplyFunction + 68
frame #8: 0x00000001080ef5a7 CFNetwork`RunloopBlockContext::perform() + 133
frame #9: 0x00000001080ef3e6 CFNetwork`MultiplexerSource::perform() + 256
frame #10: 0x00000001080ef1fc CFNetwork`MultiplexerSource::_perform(void*) + 72
frame #11: 0x00000001057ee4b1 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
frame #12: 0x00000001057e437d CoreFoundation`__CFRunLoopDoSources0 + 269
frame #13: 0x00000001057e39b4 CoreFoundation`__CFRunLoopRun + 868
frame #14: 0x00000001057e33e6 CoreFoundation`CFRunLoopRunSpecific + 470
frame #15: 0x000000010abdba3e GraphicsServices`GSEventRunModal + 161
frame #16: 0x00000001063cab60 UIKit`UIApplicationMain + 1282
* frame #17: 0x00000001049556b7 App`main + 135 at AppDelegate.swift:13
frame #18: 0x00000001088fd145 libdyld.dylib`start + 1
What i don't get here is that when trying to profile it in instruments or just running it in the simulator without Xcode it works just fine. On the device it crashes on that particular request no matter what.
device backtrace looks a bit different:
* thread #1: tid = 0x19e6ab, 0x0000000192490174 libobjc.A.dylib`objc_release + 20, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x13723bec8)
frame #0: 0x0000000192490174 libobjc.A.dylib`objc_release + 20
frame #1: 0x0000000192491724 libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 564
frame #2: 0x00000001817d2e08 CFNetwork`-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 216
frame #3: 0x00000001817d2f7c CFNetwork`-[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 60
frame #4: 0x00000001816a78e4 CFNetwork`___ZN27URLConnectionClient_Classic26_delegate_didFinishLoadingEU13block_pointerFvvE_block_invoke + 104
frame #5: 0x0000000181770540 CFNetwork`___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 104
frame #6: 0x0000000181693b54 CFNetwork`RunloopBlockContext::_invoke_block(void const*, void*) + 76
frame #7: 0x0000000181c10aac CoreFoundation`CFArrayApplyFunction + 68
frame #8: 0x0000000181693a00 CFNetwork`RunloopBlockContext::perform() + 136
frame #9: 0x00000001816938b4 CFNetwork`MultiplexerSource::perform() + 312
frame #10: 0x00000001816936e0 CFNetwork`MultiplexerSource::_perform(void*) + 68
frame #11: 0x0000000181ce69ec CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
frame #12: 0x0000000181ce5c90 CoreFoundation`__CFRunLoopDoSources0 + 264
frame #13: 0x0000000181ce3d40 CoreFoundation`__CFRunLoopRun + 712
frame #14: 0x0000000181c110a4 CoreFoundation`CFRunLoopRunSpecific + 396
frame #15: 0x000000018adab5a4 GraphicsServices`GSEventRunModal + 168
frame #16: 0x0000000186542aa4 UIKit`UIApplicationMain + 1488
* frame #17: 0x0000000100069c8c App`main + 164 at AppDelegate.swift:13
frame #18: 0x0000000192ae6a08 libdyld.dylib`start + 4
Any suggestions on how to debug this? Very much appreciated :)
When I click on any button my app crashes. It throws a lldb run time error. I printed the backtrace:
* thread #1: tid = 0x2aaf3, 0x000000018db701c0 libobjc.A.dylib`objc_exception_throw, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 2.1
frame #0: 0x000000018db701c0 libobjc.A.dylib`objc_exception_throw
frame #1: 0x0000000181666bd4 CoreFoundation`-[NSException raise] + 12
frame #2: 0x0000000182124720 Foundation`-[NSObject(NSKeyValueCoding) setValue:forKey:] + 256
frame #3: 0x00000001815b25ec CoreFoundation`-[NSArray makeObjectsPerformSelector:] + 248
frame #4: 0x00000001849eadd0 UIKit`-[UINib instantiateWithOwner:options:] + 1232
frame #5: 0x000000018492f878 UIKit`-[UIViewController _loadViewFromNibNamed:bundle:] + 280
frame #6: 0x0000000184630488 UIKit`-[UIViewController loadViewIfRequired] + 88
frame #7: 0x00000001846303f4 UIKit`-[UIViewController view] + 32
frame #8: 0x00000001847dd868 UIKit`-[UINavigationController _startCustomTransition:] + 704
frame #9: 0x00000001846e7f54 UIKit`-[UINavigationController _startDeferredTransitionIfNeeded:] + 464
frame #10: 0x00000001846e7d24 UIKit`-[UINavigationController __viewWillLayoutSubviews] + 56
frame #11: 0x00000001846e7ca4 UIKit`-[UILayoutContainerView layoutSubviews] + 200
frame #12: 0x000000018462aff8 UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 348
frame #13: 0x000000018421c258 QuartzCore`-[CALayer layoutSublayers] + 184
frame #14: 0x0000000184216e20 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 300
frame #15: 0x0000000184216cd8 QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
frame #16: 0x0000000184216560 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 280
frame #17: 0x0000000184216304 QuartzCore`CA::Transaction::commit() + 424
frame #18: 0x000000018420fc38 QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 80
frame #19: 0x00000001816276a8 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
frame #20: 0x0000000181624930 CoreFoundation`__CFRunLoopDoObservers + 372
frame #21: 0x0000000181624cbc CoreFoundation`__CFRunLoopRun + 764
frame #22: 0x0000000181565c20 CoreFoundation`CFRunLoopRunSpecific + 452
frame #23: 0x000000018724dc0c GraphicsServices`GSEventRunModal + 168
frame #24: 0x0000000184696fdc UIKit`UIApplicationMain + 1156
* frame #25: 0x00000001001297a4 myapp`main(argc=1, argv=0x000000016fd33ca8) + 116 at main.m:16
frame #26: 0x000000018e163aa0 libdyld.dylib`start + 4
What does it mean?
This is your problem:
Foundation`-[NSObject(NSKeyValueCoding) setValue:forKey:]
because after this, is raised an Exception:
CoreFoundation`-[NSException raise] + 12
You are trying to set a value for a key in your object that could not exists or has some other problem.
P.S.: Update your answer with some relevant code so I can update my answer with more explanations.
I'm getting the following error randomly (and sometimes consistently on launch). It can happen when there are background threads and when there aren't and it seems to be a problem with the library so I'm having trouble tracking down the problem in my code. The breakpoint triggers on:
#0 0x07bb489b in MP3AudioStream::GeneratePackets(AudioFileStreamContinuation&) ()
and the backtrace is as follows:
* thread #1: tid = 0x1c03, 0x07bb489b AudioToolbox`MP3AudioStream::GeneratePackets(AudioFileStreamContinuation&) + 2843, stop reason = EXC_BAD_ACCESS (code=2, address=0x4)
frame #0: 0x07bb489b AudioToolbox`MP3AudioStream::GeneratePackets(AudioFileStreamContinuation&) + 2843
frame #1: 0x07b92535 AudioToolbox`AudioFileStreamWrapper::ParseBytes(unsigned long, void const*, unsigned long) + 181
frame #2: 0x07b8f41d AudioToolbox`AudioFileStreamParseBytes + 93
frame #3: 0x07f7a1be MediaToolbox`PushBytesThroughParser + 484
frame #4: 0x07f7a69a MediaToolbox`GetAudioFileStreamPacketAndFrameCount + 221
frame #5: 0x07f7c57e MediaToolbox`FigAudioFileStreamFormatReaderCopyProperty + 225
frame #6: 0x07f9bd1d MediaToolbox`FigPlaybackBossGetDuration + 165
frame #7: 0x07f9f75a MediaToolbox`FigPlaybackBossSetTimeWithRange + 192
frame #8: 0x07f66bef MediaToolbox`itemfig_rebuildRenderPipelinesAndBoss + 10196
frame #9: 0x07f63f01 MediaToolbox`playerfig_prepareWorkingItem2 + 117
frame #10: 0x07f5bdb9 MediaToolbox`playerfig_prepareWorkingItem + 88
frame #11: 0x07f6c536 MediaToolbox`itemfig_assetPropertyBatchLoaded_prepareWorkingItem + 125
frame #12: 0x01bc8758 CoreMedia`figDeferredNotificationRun + 69
frame #13: 0x01de4376 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
frame #14: 0x01de3e06 CoreFoundation`__CFRunLoopDoTimer + 534
frame #15: 0x01dcba82 CoreFoundation`__CFRunLoopRun + 1810
frame #16: 0x01dcaf44 CoreFoundation`CFRunLoopRunSpecific + 276
frame #17: 0x01dcae1b CoreFoundation`CFRunLoopRunInMode + 123
frame #18: 0x02afb7e3 GraphicsServices`GSEventRunModal + 88
frame #19: 0x02afb668 GraphicsServices`GSEventRun + 104
frame #20: 0x00330ffc UIKit`UIApplicationMain + 1211
frame #21: 0x00002a7d FMA`main(argc=1, argv=0xbffff3f0) + 141 at main.m:16
Has anyone had this error and does anyone know how I might go about fixing it?
I am trying to integrate RevMobAds into my iOS application. It is crashing on the very first line,
[RevMobAds startSessionWithAppID:#"myAppID"];
How to solve this issue? I followed the instructions given here: http://sdk.revmob.com/ios.html. I am using the SDK 5.6.0. Please let me know. The following is the crash log.
* thread #1: tid = 0x1f03, 0x029c109f libobjc.A.dylib`objc_msgSend + 19, stop reason = EXC_BAD_ACCESS (code=2, address=0x0)
frame #0: 0x029c109f libobjc.A.dylib`objc_msgSend + 19
frame #1: 0x029acb2e libobjc.A.dylib`objc_setProperty_non_gc + 62
frame #2: 0x029acd0d libobjc.A.dylib`objc_setProperty + 47
frame #3: 0x0016cbb6 MyApp`-[RevMobHttpClient setOnSuccess:] + 63 at RevMobHttpClient.h:9
frame #4: 0x0016c621 MyApp`-[RevMobHttpClient post:toUrl:onSuccess:onFailure:] + 56 at RevMobHttpClient.m:112
frame #5: 0x0016be43 MyApp`+[RevMobHttpClient post:toUrl:onSuccess:onFailure:] + 195 at RevMobHttpClient.m:45
frame #6: 0x001645d4 MyApp`-[RevMobSessionStarter start] + 203 at RevMobSessionStarter.m:42
frame #7: 0x00161bfb MyApp`+[RevMobSessionManager startSessionWithAppID:delegate:testingMode:sdkName:sdkVersion:] + 467 at RevMobSessionManager.m:145
frame #8: 0x0015ce99 MyApp`+[RevMobAds startSessionWithAppID:delegate:testingMode:sdkName:sdkVersion:] + 145 at RevMobAds.m:111
frame #9: 0x0015cf08 MyApp`+[RevMobAds startSessionWithAppID:] + 75 at RevMobAds.m:126
frame #10: 0x00002b5f MyApp`-[MyAppAppDelegate application:didFinishLaunchingWithOptions:] + 111 at MyAppAppDelegate.m:26
frame #11: 0x00b3f7b7 UIKit`-[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 266
frame #12: 0x00b3fda7 UIKit`-[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1248
frame #13: 0x00b40fab UIKit`-[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 805
frame #14: 0x00b52315 UIKit`-[UIApplication handleEvent:withNewEvent:] + 1022
frame #15: 0x00b5324b UIKit`-[UIApplication sendEvent:] + 85
frame #16: 0x00b44cf8 UIKit`_UIApplicationHandleEvent + 9874
frame #17: 0x02eb8df9 GraphicsServices`_PurpleEventCallback + 339
frame #18: 0x02eb8ad0 GraphicsServices`PurpleEventCallback + 46
frame #19: 0x02efdbf5 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
frame #20: 0x02efd962 CoreFoundation`__CFRunLoopDoSource1 + 146
frame #21: 0x02f2ebb6 CoreFoundation`__CFRunLoopRun + 2118
frame #22: 0x02f2df44 CoreFoundation`CFRunLoopRunSpecific + 276
frame #23: 0x02f2de1b CoreFoundation`CFRunLoopRunInMode + 123
frame #24: 0x00b407da UIKit`-[UIApplication _run] + 774
frame #25: 0x00b4265c UIKit`UIApplicationMain + 1211
frame #26: 0x00002abd MyApp`main + 125 at main.m:14
Thanks.
I am not sure the exact issue. The project in which I tried integrate the SDK was created in an older version of SDK. I created new project in new Xcode, integrated the SDK and it worked fine. Thank you everyone.