SIGTRAP: BUG IN CLIENT OF LIBPLATFORM: Trying to recursively lock an os_unfair_lock Queue 305: com.facebook.react.RNBackgroundFetchQueue
Your Environment
- Plugin version: 4.1.10
- Platform: iOS
- OS version: 17.6.1
- Device manufacturer / model: iPhone 14 Pro
- React Native version (
react-native -v): 0.75.2
Expected Behavior
No crashes
Actual Behavior
A crash in the library
Steps to Reproduce
Unfortunately unsure, as this was captured in the wild via Instabug. Stack trace below.
Context
Every ~2 hours or so, I fetch some podcast RSS feeds
Debug logs
Thread 27 Queue 305: com.facebook.react.RNBackgroundFetchQueue (serial) [Crashed]:
0 libsystem_platform.dylib 0x1f97e01c4 _os_unfair_lock_recursive_abort + 36
1 libsystem_platform.dylib 0x1f97dd55c _os_unfair_lock_lock_slow + 319
2 BackgroundTasks 0x219172034 -[BGTask dealloc] + 39
3 libsystem_blocks.dylib 0x1f988cfc4 _Block_object_dispose + 255
4 libsystem_blocks.dylib 0x1f988d1b0 _call_dispose_helpers_excp + 47
5 libsystem_blocks.dylib 0x1f988d164 _Block_release + 251
6 BackgroundTasks 0x219171d4c -[BGTask _unsafe_setTaskCompletedWithSuccess:afterDelay:] + 55
7 BackgroundTasks 0x219171fbc -[BGTask _setTaskCompletedWithSuccess:actionsIfNotAlreadyCompleted:] + 111
8 Superphonic 0x102e04294 -[TSBackgroundFetch finish:] + 555
9 Superphonic 0x102c98a44 -[RNBackgroundFetch finish:] (RNBackgroundFetch.m:119)
10 CoreFoundation 0x19cde1814 __invoking___ + 147
11 CoreFoundation 0x19cde0860 -[NSInvocation invoke] + 427
12 CoreFoundation 0x19ce571dc -[NSInvocation invokeWithTarget:] + 63
13 Superphonic 0x102d625cc -[RCTModuleMethod invokeWithBridge:module:arguments:] (RCTModuleMethod.mm:584)
14 Superphonic 0x102d64620 facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&, int, (anonymous namespace)::SchedulingContext) (RCTNativeModule.mm:196)
15 Superphonic 0x102d64270 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke (RCTNativeModule.mm:104)
16 libdispatch.dylib 0x1a4ce913c _dispatch_call_block_and_release + 31
17 libdispatch.dylib 0x1a4ceadd4 _dispatch_client_callout + 19
18 libdispatch.dylib 0x1a4cf2400 _dispatch_lane_serial_drain + 747
19 libdispatch.dylib 0x1a4cf2f30 _dispatch_lane_invoke + 379
20 libdispatch.dylib 0x1a4cfdcb4 _dispatch_root_queue_drain_deferred_wlh + 287
21 libdispatch.dylib 0x1a4cfd528 _dispatch_workloop_worker_thread + 403
22 libsystem_pthread.dylib 0x1f9894934 _pthread_wqthread + 287
23 libsystem_pthread.dylib 0x1f98910cc start_wqthread + 7
Is it chronic or is this just a one-off?
This issue is stale because it has been open for 30 days with no activity.
So far, @christocracy, it's a one-off. But I wouldn't weight that overly much because my app has perhaps only six daily active users.
This issue is stale because it has been open for 30 days with no activity.
LMK if I can provide any other information to make progress on this...
Unless you can provide reproductions steps, I’m not thinking at all about this.
I guess I see the practicality of that, since there's not an easy way to get this to happen. It's just a bit too bad that hard-to-reproduce things then pretty much stay unfixed in the open source community.
I'll close.
This plug-in has existed for over 10 years. I know when things are chronic when I get a flood of bug reports. I’m not hearing about this. You could be doing something weird in your own application code to cause this.
The same compiled native libs are used not only with react native, but Cordova, capacitor and Flutter. There are many thousands of users.