Crashes in production with name `EXC_BAD_ACCESS`
See original GitHub issueOur app has for a long time experienced frequent crashes in production that display the fairly ambiguous name EXC_BAD_ACCESS
or similar.
Although the crashing thread almost never references Mapbox, a lot of evidence seems to point to the library being the culprit. Looking at the other threads, there are a lot of references to Mapbox, in particular the mbgl::resourceURL
calls. This is consistent with what we consider one of the most crash-prone parts of the app, displaying images on the map. At any given time there may be dozens of SymbolLayer
instances displayed on the map, typically but not always referencing a locally bundled image as the style.iconImage
value, along these lines:
Example component setup
```
<View key={id}>
<MapboxGL.Images
images={{ [localImageKey]: localImage }}
/>
<MapboxGL.ShapeSource id={id} shape={feature} onPress={onPress}>
<MapboxGL.SymbolLayer
id={`symbol${id}`}
style={{
iconImage: localImageKey,
}}
/>
</MapboxGL.ShapeSource>
</View>
```
My best guess is that this happens on both iOS and Android, but the error logs we get on Android are much less detailed, so it’s hard to tell.
Full iOS crash log
```
OS Version: iOS 14.5.1 (18E212)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: BUS_NOOP at 0x0000000100003ef0
Crashed Thread: 12
Application Specific Information:
Exception 1, Code 16112, Subcode 8 >
Attempted to dereference garbage pointer 0x100003ef0.
Thread 12 Crashed:
0 JavaScriptCore 0x322e29ae4 JSC::ExecutableToCodeBlockEdge::visitChildren
1 JavaScriptCore 0x322e29994 JSC::ExecutableToCodeBlockEdge::visitChildren
2 JavaScriptCore 0x32319dda8 JSC::SlotVisitor::drain::lambda::operator()
3 JavaScriptCore 0x32319b1dc JSC::SlotVisitor::drain
4 JavaScriptCore 0x32319bb84 JSC::SlotVisitor::drainFromShared
5 JavaScriptCore 0x32317922c WTF::SharedTaskFunctor<T>::run
6 JavaScriptCore 0x3238f612c WTF::ParallelHelperClient::runTask
7 JavaScriptCore 0x3238f6fc0 WTF::ParallelHelperPool::Thread::work
8 JavaScriptCore 0x3238c472c WTF::Detail::CallableWrapper<T>::call
9 JavaScriptCore 0x32391bc58 WTF::Thread::entryPoint
10 JavaScriptCore 0x32391e414 WTF::wtfThreadEntryPoint
11 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 0
0 libsystem_kernel.dylib 0x36c1bde7c __ulock_wait
1 libdispatch.dylib 0x30f9cb1c8 _dlock_wait
2 libdispatch.dylib 0x30f9cb570 _dispatch_group_wait_slow
3 AppleMetalGLRenderer 0x3a80704b0 GLDContextRec::flushContextInternal
4 GLEngine 0x377da9e00 gliPresentViewES_Exec
5 OpenGLES 0x377e86cac -[EAGLContext presentRenderbuffer:]
6 GLKit 0x37561f208 -[GLKView _display:]
7 QuartzCore 0x3167e3e90 -[CALayer display]
8 QuartzCore 0x3167f4b50 CA::Layer::layout_and_display_if_needed
9 QuartzCore 0x316736ca4 CA::Context::commit_transaction
10 QuartzCore 0x316762eb4 CA::Transaction::commit
11 QuartzCore 0x3167641e0 CA::Transaction::observer_callback
12 CoreFoundation 0x31004443c __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
13 CoreFoundation 0x31003e560 __CFRunLoopDoObservers
14 CoreFoundation 0x31003eb0c __CFRunLoopRun
15 CoreFoundation 0x31003e1bc CFRunLoopRunSpecific
16 GraphicsServices 0x33eca7730 GSEventRunModal
17 UIKitCore 0x3149ec7e0 -[UIApplication _run]
18 UIKitCore 0x3149f2050 UIApplicationMain
19 TruckMap 0x2028d5920 <redacted>
20 libdyld.dylib 0x30fa51cf4 start
Thread 1 name: com.apple.uikit.eventfetch-thread
0 libsystem_kernel.dylib 0x36c1984fc mach_msg_trap
1 libsystem_kernel.dylib 0x36c197880 mach_msg
2 CoreFoundation 0x310044d0c __CFRunLoopServiceMachPort
3 CoreFoundation 0x31003ebac __CFRunLoopRun
4 CoreFoundation 0x31003e1bc CFRunLoopRunSpecific
5 Foundation 0x312693fa8 -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
6 Foundation 0x312693e74 -[NSRunLoop(NSRunLoop) runUntilDate:]
7 UIKitCore 0x314aa1388 -[UIEventFetcher threadMain]
8 Foundation 0x3128052f8 __NSThread__start__
9 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 2 name: com.facebook.react.JavaScript
0 libsystem_kernel.dylib 0x36c1984fc mach_msg_trap
1 libsystem_kernel.dylib 0x36c197880 mach_msg
2 CoreFoundation 0x310044d0c __CFRunLoopServiceMachPort
3 CoreFoundation 0x31003ebac __CFRunLoopRun
4 CoreFoundation 0x31003e1bc CFRunLoopRunSpecific
5 TruckMap 0x2029438e4 facebook::react::JSIExecutor::defaultTimeoutInvoker
6 Foundation 0x3128052f8 __NSThread__start__
7 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 3 name: JavaScriptCore bmalloc scavenger
0 libsystem_kernel.dylib 0x36c1bd0cc __psynch_cvwait
1 libsystem_pthread.dylib 0x3a762b430 _pthread_cond_wait
2 libc++.1.dylib 0x3397dff94 std::__1::condition_variable::__do_timed_wait
3 JavaScriptCore 0x323971358 bmalloc::Scavenger::threadRunLoop
4 JavaScriptCore 0x323970e0c bmalloc::Scavenger::threadEntryPoint
5 JavaScriptCore 0x323972324 std::__1::__thread_proxy<T>
6 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 4 name: com.mapbox.mbgl.AssetFileSource
0 libsystem_kernel.dylib 0x36c1984fc mach_msg_trap
1 libsystem_kernel.dylib 0x36c197880 mach_msg
2 CoreFoundation 0x310044d0c __CFRunLoopServiceMachPort
3 CoreFoundation 0x31003ebac __CFRunLoopRun
4 CoreFoundation 0x31003e1bc CFRunLoopRunSpecific
5 CoreFoundation 0x31003f2a8 CFRunLoopRun
6 Mapbox 0x102e700c0 mbgl::resourceURL
7 Mapbox 0x102e6fec4 mbgl::resourceURL
8 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 5 name: com.mapbox.mbgl.OnlineFileSource
0 libsystem_kernel.dylib 0x36c1984fc mach_msg_trap
1 libsystem_kernel.dylib 0x36c197880 mach_msg
2 CoreFoundation 0x310044d0c __CFRunLoopServiceMachPort
3 CoreFoundation 0x31003ebac __CFRunLoopRun
4 CoreFoundation 0x31003e1bc CFRunLoopRunSpecific
5 CoreFoundation 0x31003f2a8 CFRunLoopRun
6 Mapbox 0x102ea1a00 mbgl::resourceURL
7 Mapbox 0x102ea1878 mbgl::resourceURL
8 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 6 name: com.mapbox.mbgl.MultiDatabaseFileSource
0 libsystem_kernel.dylib 0x36c1984fc mach_msg_trap
1 libsystem_kernel.dylib 0x36c197880 mach_msg
2 CoreFoundation 0x310044d0c __CFRunLoopServiceMachPort
3 CoreFoundation 0x31003ebac __CFRunLoopRun
4 CoreFoundation 0x31003e1bc CFRunLoopRunSpecific
5 CoreFoundation 0x31003f2a8 CFRunLoopRun
6 Mapbox 0x103003ab4 mbgl::resourceURL
7 Mapbox 0x1030039ac mbgl::resourceURL
8 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 7 name: com.mapbox.mbgl.LocalFileSource
0 libsystem_kernel.dylib 0x36c1984fc mach_msg_trap
1 libsystem_kernel.dylib 0x36c197880 mach_msg
2 CoreFoundation 0x310044d0c __CFRunLoopServiceMachPort
3 CoreFoundation 0x31003ebac __CFRunLoopRun
4 CoreFoundation 0x31003e1bc CFRunLoopRunSpecific
5 CoreFoundation 0x31003f2a8 CFRunLoopRun
6 Mapbox 0x102e7da68 mbgl::resourceURL
7 Mapbox 0x102e7d8c8 mbgl::resourceURL
8 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 8 name: com.mapbox.mbgl.ResourceLoaderThread
0 libsystem_kernel.dylib 0x36c1984fc mach_msg_trap
1 libsystem_kernel.dylib 0x36c197880 mach_msg
2 CoreFoundation 0x310044d0c __CFRunLoopServiceMachPort
3 CoreFoundation 0x31003ebac __CFRunLoopRun
4 CoreFoundation 0x31003e1bc CFRunLoopRunSpecific
5 CoreFoundation 0x31003f2a8 CFRunLoopRun
6 Mapbox 0x102e82c44 mbgl::resourceURL
7 Mapbox 0x102e82aec mbgl::resourceURL
8 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 9 name: Heap Helper Thread
0 JavaScriptCore 0x323596eec JSC::JSFinalObject::visitChildren
1 JavaScriptCore 0x323596ebc JSC::JSFinalObject::visitChildren
2 JavaScriptCore 0x32319dd58 JSC::SlotVisitor::drain::lambda::operator()
3 JavaScriptCore 0x32319b1dc JSC::SlotVisitor::drain
4 JavaScriptCore 0x32319bb84 JSC::SlotVisitor::drainFromShared
5 JavaScriptCore 0x32317922c WTF::SharedTaskFunctor<T>::run
6 JavaScriptCore 0x3238f612c WTF::ParallelHelperClient::runTask
7 JavaScriptCore 0x3238f6fc0 WTF::ParallelHelperPool::Thread::work
8 JavaScriptCore 0x3238c472c WTF::Detail::CallableWrapper<T>::call
9 JavaScriptCore 0x32391bc58 WTF::Thread::entryPoint
10 JavaScriptCore 0x32391e414 WTF::wtfThreadEntryPoint
11 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 10 name: Heap Helper Thread
0 JavaScriptCore 0x323596f24 JSC::JSFinalObject::visitChildren
1 JavaScriptCore 0x32319dd58 [inlined] JSC::SlotVisitor::drain::lambda::operator()
2 JavaScriptCore 0x32319dd58 JSC::SlotVisitor::drain::lambda::operator()
3 JavaScriptCore 0x32319b1dc JSC::SlotVisitor::drain
4 JavaScriptCore 0x32319bb84 JSC::SlotVisitor::drainFromShared
5 JavaScriptCore 0x32317922c WTF::SharedTaskFunctor<T>::run
6 JavaScriptCore 0x3238f612c WTF::ParallelHelperClient::runTask
7 JavaScriptCore 0x3238f6fc0 WTF::ParallelHelperPool::Thread::work
8 JavaScriptCore 0x3238c472c WTF::Detail::CallableWrapper<T>::call
9 JavaScriptCore 0x32391bc58 WTF::Thread::entryPoint
10 JavaScriptCore 0x32391e414 WTF::wtfThreadEntryPoint
11 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 11 name: Heap Helper Thread
0 JavaScriptCore 0x323596d30 JSC::JSFinalObject::visitChildren
1 JavaScriptCore 0x323597010 JSC::JSFinalObject::visitChildren
2 JavaScriptCore 0x32319dd58 JSC::SlotVisitor::drain::lambda::operator()
3 JavaScriptCore 0x32319b1dc JSC::SlotVisitor::drain
4 JavaScriptCore 0x32319bb84 JSC::SlotVisitor::drainFromShared
5 JavaScriptCore 0x32317922c WTF::SharedTaskFunctor<T>::run
6 JavaScriptCore 0x3238f612c WTF::ParallelHelperClient::runTask
7 JavaScriptCore 0x3238f6fc0 WTF::ParallelHelperPool::Thread::work
8 JavaScriptCore 0x3238c472c WTF::Detail::CallableWrapper<T>::call
9 JavaScriptCore 0x32391bc58 WTF::Thread::entryPoint
10 JavaScriptCore 0x32391e414 WTF::wtfThreadEntryPoint
11 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 12 name: Heap Helper Thread Crashed:
0 JavaScriptCore 0x322e29ae4 JSC::ExecutableToCodeBlockEdge::visitChildren
1 JavaScriptCore 0x322e29994 JSC::ExecutableToCodeBlockEdge::visitChildren
2 JavaScriptCore 0x32319dda8 JSC::SlotVisitor::drain::lambda::operator()
3 JavaScriptCore 0x32319b1dc JSC::SlotVisitor::drain
4 JavaScriptCore 0x32319bb84 JSC::SlotVisitor::drainFromShared
5 JavaScriptCore 0x32317922c WTF::SharedTaskFunctor<T>::run
6 JavaScriptCore 0x3238f612c WTF::ParallelHelperClient::runTask
7 JavaScriptCore 0x3238f6fc0 WTF::ParallelHelperPool::Thread::work
8 JavaScriptCore 0x3238c472c WTF::Detail::CallableWrapper<T>::call
9 JavaScriptCore 0x32391bc58 WTF::Thread::entryPoint
10 JavaScriptCore 0x32391e414 WTF::wtfThreadEntryPoint
11 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 13 name: Heap Helper Thread
0 JavaScriptCore 0x3235b1c34 JSC::JSObject::visitButterflyImpl::lambda::operator()
1 JavaScriptCore 0x3235b1c70 JSC::JSObject::visitButterflyImpl::lambda::operator()
2 JavaScriptCore 0x323596ebc JSC::JSFinalObject::visitChildren
3 JavaScriptCore 0x32319dd58 JSC::SlotVisitor::drain::lambda::operator()
4 JavaScriptCore 0x32319b1dc JSC::SlotVisitor::drain
5 JavaScriptCore 0x32319bb84 JSC::SlotVisitor::drainFromShared
6 JavaScriptCore 0x32317922c WTF::SharedTaskFunctor<T>::run
7 JavaScriptCore 0x3238f612c WTF::ParallelHelperClient::runTask
8 JavaScriptCore 0x3238f6fc0 WTF::ParallelHelperPool::Thread::work
9 JavaScriptCore 0x3238c472c WTF::Detail::CallableWrapper<T>::call
10 JavaScriptCore 0x32391bc58 WTF::Thread::entryPoint
11 JavaScriptCore 0x32391e414 WTF::wtfThreadEntryPoint
12 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 14 name: AVAudioSession Notify Thread
0 libsystem_kernel.dylib 0x36c1984fc mach_msg_trap
1 libsystem_kernel.dylib 0x36c197880 mach_msg
2 CoreFoundation 0x310044d0c __CFRunLoopServiceMachPort
3 CoreFoundation 0x31003ebac __CFRunLoopRun
4 CoreFoundation 0x31003e1bc CFRunLoopRunSpecific
5 AudioSession 0x31f5c6f1c GenericRunLoopThread::Entry
6 AudioSession 0x31f5c90d4 CAPThread::Entry
7 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 15 name: com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib 0x36c1984fc mach_msg_trap
1 libsystem_kernel.dylib 0x36c197880 mach_msg
2 CoreFoundation 0x310044d0c __CFRunLoopServiceMachPort
3 CoreFoundation 0x31003ebac __CFRunLoopRun
4 CoreFoundation 0x31003e1bc CFRunLoopRunSpecific
5 CFNetwork 0x3110414b4 _CFURLStorageSessionCopyCache
6 Foundation 0x3128052f8 __NSThread__start__
7 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 16 name: com.squareup.SocketRocket.NetworkThread
0 libsystem_kernel.dylib 0x36c1984fc mach_msg_trap
1 libsystem_kernel.dylib 0x36c197880 mach_msg
2 CoreFoundation 0x310044d0c __CFRunLoopServiceMachPort
3 CoreFoundation 0x31003ebac __CFRunLoopRun
4 CoreFoundation 0x31003e1bc CFRunLoopRunSpecific
5 Foundation 0x312693fa8 -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
6 TruckMap 0x20297f26c facebook::react::JSIExecutor::defaultTimeoutInvoker
7 Foundation 0x3128052f8 __NSThread__start__
8 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 17
0 libsystem_kernel.dylib 0x36c1bd734 __semwait_signal
1 libsystem_c.dylib 0x32287aa30 nanosleep
2 libsystem_c.dylib 0x32287a814 sleep
3 TruckMap 0x202a299bc facebook::react::JSIExecutor::defaultTimeoutInvoker
4 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 18 name: SentryCrash Exception Handler (Secondary)
0 libsystem_kernel.dylib 0x36c1984fc mach_msg_trap
1 libsystem_kernel.dylib 0x36c197880 mach_msg
2 TruckMap 0x202a35dc4 __cxa_throw
3 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 20 name: JSC Heap Collector Thread
0 libsystem_kernel.dylib 0x36c1bd0cc __psynch_cvwait
1 libsystem_pthread.dylib 0x3a762b430 _pthread_cond_wait
2 JavaScriptCore 0x3238f7d84 WTF::ParkingLot::parkConditionallyImpl
3 JavaScriptCore 0x3231338a4 WTF::Condition::waitUntil<T>
4 JavaScriptCore 0x32319bfd0 JSC::SlotVisitor::waitForTermination
5 JavaScriptCore 0x32317268c JSC::Heap::runConcurrentPhase
6 JavaScriptCore 0x323171440 JSC::Heap::runCurrentPhase
7 JavaScriptCore 0x323176cbc JSC::Heap::HeapThread::work
8 JavaScriptCore 0x3238c472c WTF::Detail::CallableWrapper<T>::call
9 JavaScriptCore 0x32391bc58 WTF::Thread::entryPoint
10 JavaScriptCore 0x32391e414 WTF::wtfThreadEntryPoint
11 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 21 name: com.mapbox.mbgl.Worker 1
0 libsystem_kernel.dylib 0x36c1bd0cc __psynch_cvwait
1 libsystem_pthread.dylib 0x3a762b430 _pthread_cond_wait
2 libc++.1.dylib 0x3397dfef8 std::__1::condition_variable::wait
3 Mapbox 0x1031be204 mbgl::resourceURL
4 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 22 name: com.mapbox.mbgl.Worker 2
0 libsystem_kernel.dylib 0x36c1bd0cc __psynch_cvwait
1 libsystem_pthread.dylib 0x3a762b430 _pthread_cond_wait
2 libc++.1.dylib 0x3397dfef8 std::__1::condition_variable::wait
3 Mapbox 0x1031be204 mbgl::resourceURL
4 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 23 name: com.mapbox.mbgl.Worker 3
0 libsystem_kernel.dylib 0x36c1bd0cc __psynch_cvwait
1 libsystem_pthread.dylib 0x3a762b430 _pthread_cond_wait
2 libc++.1.dylib 0x3397dfef8 std::__1::condition_variable::wait
3 Mapbox 0x1031be204 mbgl::resourceURL
4 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 24 name: com.mapbox.mbgl.Worker 4
0 libsystem_kernel.dylib 0x36c1bd0cc __psynch_cvwait
1 libsystem_pthread.dylib 0x3a762b430 _pthread_cond_wait
2 libc++.1.dylib 0x3397dfef8 std::__1::condition_variable::wait
3 Mapbox 0x1031be204 mbgl::resourceURL
4 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 25 name: com.mapbox.mbgl.Worker 1
0 libsystem_kernel.dylib 0x36c1bd0cc __psynch_cvwait
1 libsystem_pthread.dylib 0x3a762b430 _pthread_cond_wait
2 libc++.1.dylib 0x3397dfef8 std::__1::condition_variable::wait
3 Mapbox 0x1031be204 mbgl::resourceURL
4 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 26 name: com.mapbox.mbgl.Worker 1
0 libsystem_kernel.dylib 0x36c1bd0cc __psynch_cvwait
1 libsystem_pthread.dylib 0x3a762b430 _pthread_cond_wait
2 libc++.1.dylib 0x3397dfef8 std::__1::condition_variable::wait
3 Mapbox 0x1031be204 mbgl::resourceURL
4 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 27 name: com.mapbox.mbgl.Worker 1
0 libsystem_kernel.dylib 0x36c1bd0cc __psynch_cvwait
1 libsystem_pthread.dylib 0x3a762b430 _pthread_cond_wait
2 libc++.1.dylib 0x3397dfef8 std::__1::condition_variable::wait
3 Mapbox 0x1031be204 mbgl::resourceURL
4 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 28 name: com.mapbox.mbgl.Worker 1
0 libsystem_kernel.dylib 0x36c1bd0cc __psynch_cvwait
1 libsystem_pthread.dylib 0x3a762b430 _pthread_cond_wait
2 libc++.1.dylib 0x3397dfef8 std::__1::condition_variable::wait
3 Mapbox 0x1031be204 mbgl::resourceURL
4 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 29 name: com.mapbox.mbgl.Worker 1
0 libsystem_kernel.dylib 0x36c1bd0cc __psynch_cvwait
1 libsystem_pthread.dylib 0x3a762b430 _pthread_cond_wait
2 libc++.1.dylib 0x3397dfef8 std::__1::condition_variable::wait
3 Mapbox 0x1031be204 mbgl::resourceURL
4 libsystem_pthread.dylib 0x3a7627bfc _pthread_start
Thread 30
0 libsystem_kernel.dylib 0x36c1be0a4 __workq_kernreturn
1 libsystem_pthread.dylib 0x3a76297ec _pthread_wqthread
Thread 31
0 libsystem_kernel.dylib 0x36c1be0a4 __workq_kernreturn
1 libsystem_pthread.dylib 0x3a76297ec _pthread_wqthread
Thread 32
0 libsystem_pthread.dylib 0x3a7630744 start_wqthread
Thread 33
0 libsystem_kernel.dylib 0x36c1984fc mach_msg_trap
1 libsystem_kernel.dylib 0x36c197880 mach_msg
2 IOKit 0x325f219f0 io_connect_method
3 IOKit 0x325ea7a0c IOConnectCallMethod
4 IOGPU 0x38ae2b8a0 IOGPUCommandQueueSubmitCommandBuffers
5 IOGPU 0x38ae1ff1c -[IOGPUMetalCommandQueue _submitCommandBuffers:count:]
6 IOGPU 0x38ae1fbdc -[IOGPUMetalCommandQueue submitCommandBuffers:count:]
7 Metal 0x33c590a2c -[_MTLCommandQueue _submitAvailableCommandBuffers]
8 libdispatch.dylib 0x30f9ca7e8 _dispatch_client_callout
9 libdispatch.dylib 0x30f9cdcc0 _dispatch_continuation_pop
10 libdispatch.dylib 0x30f9e04b4 _dispatch_source_invoke
11 libdispatch.dylib 0x30f9d1e98 _dispatch_lane_serial_drain
12 libdispatch.dylib 0x30f9d2bcc _dispatch_lane_invoke
13 libdispatch.dylib 0x30f9dd488 _dispatch_workloop_worker_thread
14 libsystem_pthread.dylib 0x3a76297a0 _pthread_wqthread
EOF
```
Full Android crash log
```
OS Version: Android 11 (RP1A.200720.012.N986USQS2DUBB)
Report Version: 104
Exception Type: Unknown (SIGSEGV)
Application Specific Information:
Segfault
Thread 0 Crashed:
0 libjsc.so 0x7a16c6b504 bmalloc::Heap::allocateSmallChunk
1 libjsc.so 0x7a16c6b5b4 bmalloc::Heap::allocateSmallPage
2 libjsc.so 0x7a16c6bb70 bmalloc::Heap::allocateSmallBumpRangesByObject
3 libjsc.so 0x7a16c68194 bmalloc::Allocator::refillAllocatorSlowCase
4 libjsc.so 0x7a16c68310 bmalloc::Allocator::allocateLogSizeClass
5 libjsc.so 0x7a16bd390c Gigacage::tryAlignedMalloc
6 libjsc.so 0x7a167afb1c JSC::MarkedBlock::tryCreate
7 libjsc.so 0x7a16797760 JSC::BlockDirectory::tryAllocateBlock
8 libjsc.so 0x7a167adcbc JSC::LocalAllocator::allocateSlowCase
9 libjsc.so 0x7a169dc3ac slow_path_create_lexical_environment
10 <unknown> 0x7a03fb03bc <unknown>
EOF
```
EDIT: I actually was able to get a stack trace from a crash on the iOS simulator, which I believe is the same issue:
iOS simulator stack trace (crashing thread only)
```
Mapbox was compiled with optimization - stepping may behave oddly; variables may not be available.
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
frame #0: 0x0000000169bc4b46
frame #1: 0x0000000152731067
frame #2: 0x000000015851cb6f GLEngine`gleFlushAtomicFunc + 15
frame #3: 0x0000000158566577 GLEngine`glDrawElements_IMM_ES2Exec + 939
frame #4: 0x000000011166fc4a Mapbox`mbgl::gl::Context::draw(mbgl::gfx::DrawMode const&, unsigned long, unsigned long) + 138
frame #5: 0x00000001116ca010 Mapbox`mbgl::gl::Program<mbgl::FillProgram>::draw(mbgl::gfx::Context&, mbgl::gfx::RenderPass&, mbgl::gfx::DrawMode const&, mbgl::gfx::DepthMode const&, mbgl::gfx::StencilMode const&, mbgl::gfx::ColorMode const&, mbgl::gfx::CullFaceMode const&, mbgl::gfx::UniformValues<mbgl::TypeList<mbgl::uniforms::matrix, mbgl::uniforms::world, mbgl::InterpolationUniform<mbgl::attributes::color>, mbgl::InterpolationUniform<mbgl::attributes::opacity>, mbgl::InterpolationUniform<mbgl::attributes::outline_color>, mbgl::InterpolationUniform<mbgl::attributes::pattern_to>, mbgl::InterpolationUniform<mbgl::attributes::pattern_from>, mbgl::InterpolationUniform<mbgl::attributes::pixel_ratio_to>, mbgl::InterpolationUniform<mbgl::attributes::pixel_ratio_from>, mbgl::uniforms::color, mbgl::uniforms::opacity, mbgl::uniforms::outline_color, mbgl::uniforms::pattern_to, mbgl::uniforms::pattern_from, mbgl::uniforms::pixel_ratio_to, mbgl::uniforms::pixel_ratio_from> > const&, mbgl::gfx::DrawScope&, mbgl::gfx::AttributeBindings<mbgl::TypeList<mbgl::attributes::pos, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::color>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::opacity>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::outline_color>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pixel_ratio_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pixel_ratio_from> > > const&, mbgl::gfx::TextureBindings<mbgl::TypeList<> > const&, mbgl::gfx::IndexBuffer const&, unsigned long, unsigned long) + 624
frame #6: 0x0000000111731636 Mapbox`void mbgl::Program<mbgl::FillProgram, (mbgl::gfx::PrimitiveType)2, mbgl::TypeList<mbgl::attributes::pos>, mbgl::TypeList<mbgl::uniforms::matrix, mbgl::uniforms::world>, mbgl::TypeList<>, mbgl::style::FillPaintProperties, mbgl::TypeList<> >::draw<mbgl::gfx::Triangles>(mbgl::gfx::Context&, mbgl::gfx::RenderPass&, mbgl::gfx::Triangles const&, mbgl::gfx::DepthMode const&, mbgl::gfx::StencilMode const&, mbgl::gfx::ColorMode const&, mbgl::gfx::CullFaceMode const&, mbgl::gfx::IndexBuffer const&, std::__1::vector<mbgl::Segment, std::__1::allocator<mbgl::Segment> > const&, mbgl::gfx::UniformValues<mbgl::TypeList<mbgl::uniforms::matrix, mbgl::uniforms::world, mbgl::InterpolationUniform<mbgl::attributes::color>, mbgl::InterpolationUniform<mbgl::attributes::opacity>, mbgl::InterpolationUniform<mbgl::attributes::outline_color>, mbgl::InterpolationUniform<mbgl::attributes::pattern_to>, mbgl::InterpolationUniform<mbgl::attributes::pattern_from>, mbgl::InterpolationUniform<mbgl::attributes::pixel_ratio_to>, mbgl::InterpolationUniform<mbgl::attributes::pixel_ratio_from>, mbgl::uniforms::color, mbgl::uniforms::opacity, mbgl::uniforms::outline_color, mbgl::uniforms::pattern_to, mbgl::uniforms::pattern_from, mbgl::uniforms::pixel_ratio_to, mbgl::uniforms::pixel_ratio_from> > const&, mbgl::gfx::AttributeBindings<mbgl::TypeList<mbgl::attributes::pos, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::color>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::opacity>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::outline_color>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pixel_ratio_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pixel_ratio_from> > > const&, mbgl::gfx::TextureBindings<mbgl::TypeList<> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 230
frame #7: 0x000000011172ea42 Mapbox`mbgl::RenderFillLayer::render(mbgl::PaintParameters&) + 1058
frame #8: 0x00000001117859db Mapbox`mbgl::Renderer::Impl::render(mbgl::RenderTree const&) + 2635
frame #9: 0x0000000111783cf3 Mapbox`mbgl::Renderer::render(std::__1::shared_ptr<mbgl::UpdateParameters> const&) + 51
* frame #10: 0x0000000111a5b681 Mapbox`-[MGLMapView renderSync] [inlined] MGLRenderFrontend::render(this=0x0000600007bd0ec0) at MGLRendererFrontend.h:57:19 [opt]
frame #11: 0x0000000111a5b63d Mapbox`-[MGLMapView renderSync](self=0x00007f8454d4d600, _cmd=<unavailable>) at MGLMapView.mm:1128 [opt]
frame #12: 0x0000000111a10457 Mapbox`-[MGLMapViewImplDelegate glkView:drawInRect:] [inlined] MGLMapViewImpl::render(this=<unavailable>) at MGLMapView+Impl.mm:18:5 [opt]
frame #13: 0x0000000111a10438 Mapbox`-[MGLMapViewImplDelegate glkView:drawInRect:](self=<unavailable>, _cmd=<unavailable>, view=<unavailable>, rect=(origin = (x = 0, y = 0), size = (width = 390, height = 844))) at MGLMapView+OpenGL.mm:30 [opt]
frame #14: 0x000000011f52d326 GLKit`-[GLKView _display:] + 275
frame #15: 0x00000001120508cf QuartzCore`-[CALayer display] + 187
frame #16: 0x0000000112064def QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 477
frame #17: 0x0000000111f9ef26 QuartzCore`CA::Context::commit_transaction(CA::Transaction*, double, double*) + 656
frame #18: 0x0000000111fd63b9 QuartzCore`CA::Transaction::commit() + 713
frame #19: 0x0000000111fd751f QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 79
frame #20: 0x0000000113b8fd31 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
frame #21: 0x0000000113b8a542 CoreFoundation`__CFRunLoopDoObservers + 541
frame #22: 0x0000000113b8aaf5 CoreFoundation`__CFRunLoopRun + 1129
frame #23: 0x0000000113b8a1a7 CoreFoundation`CFRunLoopRunSpecific + 567
frame #24: 0x00000001178c8d85 GraphicsServices`GSEventRunModal + 139
frame #25: 0x0000000120e734df UIKitCore`-[UIApplication _run] + 912
frame #26: 0x0000000120e7839c UIKitCore`UIApplicationMain + 101
frame #27: 0x0000000105000550 TruckMap`main(argc=1, argv=0x000000030fbc6c28) at main.m:7:12
frame #28: 0x000000011634cbbd libdyld.dylib`start + 1
frame #29: 0x000000011634cbbd libdyld.dylib`start + 1
```
Obviously, based on this information, it’ll be very hard for somebody to provide a useful answer, but I’m trying to work my way towards some possible solutions. I would post in mapbox-gl-native or mapbox-gl-native-ios, but I’m hindered by the fact that I can’t reproduce this reliably during testing, and I’m not sure at which level of the stack this is happening.
Does anyone have any ideas of where I could begin?
Current setup (although this problem has been around for a long time, across many different versions):
RNMBGL: 8.2.0-beta2 (current master)
React Native: 0.63.4
Issue Analytics
- State:
- Created 2 years ago
- Reactions:13
- Comments:7 (4 by maintainers)
Top GitHub Comments
That, and even switching to another open sourced flavor of mapbox!
Check the installation guide for details
I’m seeing a similar (?) issue with
@react-native-mapbox-gl/maps
v8.2.1 and MapBox SDK 5.9.0 for iOS. Although I haven’t tried a different SDK version yet (is that even possible?), one thing I noticed might be helpful to get to the ground of this: My crash happens only when the app is in the background. The app itself is still running, receiving location updates, but the display is fully turned off. That’s when suddenly the app crashes with somewhat consistency… It doesn’t happen for me when the screen is on.This leads me to the suspicion that there might be a callback fired into the
@react-native-mapbox-gl/maps
package even if no display/surface/view/whatever is available for rendering anymore. Maybe something as simple as checking fornull
in the appropriate place?