Hi,
I updated my device and toolchains to ios11 and xcode 9 recently, and I found a crash issue in device debug mode which means the app can successfully run in simulator and release mode on the device, but will crash when i use debug mode on device.
The app will crash after invoke addMapLayer() method of a AGSMapView class, and there's no valuable information in the debug stack except one line :
Thread 1: EXC_BAD_ACCESS (code=2, address=0x197f5b2a8)
I believe it could be a threading problem in runtime 10.2.5. I tried to make a sample demo that only contains a few lines of code that only load a web map or a local tiled layer in a single-view app, and the crash issue is still there.
It would be good if someone can help me check the problem to make sure if it is a bug in runtime 10.2.5, and I also would like to know if ESRI will release a update to the runtime 10.2.5 to fix it.
Thanks.
Is there a stack trace? If you type "bt" in the console when it crashes, does it give you a stack trace?
thanks
Hi Ryan,
Thanks for your reply. I use xcode 9 and swift 4.0, and here are the stack trace information of my app:
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x197f5b2a8)
frame #0: 0x00000001845e5ba0 libsystem_platform.dylib`_platform_memmove + 208
frame #1: 0x0000000197f5b2ec SceneKit`SCNGetPerformanceStatistics + 68
frame #2: 0x0000000102522064 libglInterpose.dylib`__clang_call_terminate + 24572
frame #3: 0x000000010251ede8 libglInterpose.dylib`__clang_call_terminate + 11648
frame #4: 0x00000001027033ec libglInterpose.dylib`__clang_call_terminate + 1995652
frame #5: 0x0000000102700f08 libglInterpose.dylib`__clang_call_terminate + 1986208
frame #6: 0x0000000100ba9ab0 TestArcGIS`-[AGSMapRenderer drawRequested] + 592
frame #7: 0x0000000100ba94a4 TestArcGIS`-[AGSMapRenderer pulse:] + 308
frame #8: 0x00000001035b83f8 GPUToolsCore`__clang_call_terminate + 35748
frame #9: 0x000000018888efd4 QuartzCore`CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 672
frame #10: 0x0000000184c2e30c IOKit`IODispatchCalloutFromCFMessage + 392
frame #11: 0x0000000184952080 CoreFoundation`__CFMachPortPerform + 188
frame #12: 0x000000018496c9dc CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
frame #13: 0x000000018496c0e0 CoreFoundation`__CFRunLoopDoSource1 + 440
frame #14: 0x0000000184969bb4 CoreFoundation`__CFRunLoopRun + 2196
frame #15: 0x000000018488a2d8 CoreFoundation`CFRunLoopRunSpecific + 436
frame #16: 0x000000018671bf84 GraphicsServices`GSEventRunModal + 100
frame #17: 0x000000018de36880 UIKit`UIApplicationMain + 208
* frame #18: 0x0000000100ba0cec TestArcGIS`main at AppDelegate.swift:12
frame #19: 0x00000001843ae56c libdyld.dylib`start + 4
(lldb)
The tested code is quite simple, the application crashed when i connect an 12-inch iPad pro then build and run the application in debug mode. The code of the viewcontroller are listed as follow:
import UIKit
import ArcGIS
class ViewController: UIViewController {
@IBOutlet weak var mapView: AGSMapView!
override func viewDidLoad() {
super.viewDidLoad()
let url = NSURL(string: "http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer")
let tiledLayer = AGSTiledMapServiceLayer(url: url! as URL)
self.mapView.addMapLayer(tiledLayer, withName: "Basemap Tiled Layer")
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
Hello Ryan,
I tested another program which is more complicated, and the crash issue occurs in the same line. The stack information is here:
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x197f5b2a8)
frame #0: 0x00000001845e5ba0 libsystem_platform.dylib`_platform_memmove + 208
frame #1: 0x0000000197f5b2ec SceneKit`SCNGetPerformanceStatistics + 68
frame #2: 0x000000010242e064 libglInterpose.dylib`__clang_call_terminate + 24572
frame #3: 0x000000010242ade8 libglInterpose.dylib`__clang_call_terminate + 11648
frame #4: 0x000000010260f3ec libglInterpose.dylib`__clang_call_terminate + 1995652
frame #5: 0x000000010260cf08 libglInterpose.dylib`__clang_call_terminate + 1986208
frame #6: 0x0000000100960c50 QingDaoOverviewSystem`-[AGSMapRenderer drawRequested] + 592
frame #7: 0x0000000100960644 QingDaoOverviewSystem`-[AGSMapRenderer pulse:] + 308
frame #8: 0x00000001036c83f8 GPUToolsCore`__clang_call_terminate + 35748
frame #9: 0x000000018888efd4 QuartzCore`CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 672
frame #10: 0x0000000184c2e30c IOKit`IODispatchCalloutFromCFMessage + 392
frame #11: 0x0000000184952080 CoreFoundation`__CFMachPortPerform + 188
frame #12: 0x000000018496c9dc CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
frame #13: 0x000000018496c0e0 CoreFoundation`__CFRunLoopDoSource1 + 440
frame #14: 0x0000000184969bb4 CoreFoundation`__CFRunLoopRun + 2196
frame #15: 0x000000018488a2d8 CoreFoundation`CFRunLoopRunSpecific + 436
frame #16: 0x000000018671bf84 GraphicsServices`GSEventRunModal + 100
frame #17: 0x000000018de36880 UIKit`UIApplicationMain + 208
* frame #18: 0x00000001008f6a54 QingDaoOverviewSystem`main at AppDelegate.swift:12
frame #19: 0x00000001843ae56c libdyld.dylib`start + 4
(lldb)
It would be great if you can test the APIs. The application runs normally in simulator and release mode on the device. And there's no problem when i use ios10.
Thanks.