crash qreader plugin: libc++abi.dylib: terminating with uncaught exception of type uThrowable: Uno.Exception

Version fuse and so

fuse v 1.5.0 and fuse v.1.6.0
mac sierra hight

What do I expect?

I have integrated the plugin https://github.com/zean00/fuse-qreader and run their example project https://github.com/zean00/fuse-qreader/tree/master/Example . I expect to plugin scan work correctly.

What’s going on?

The build ios version crash Randomly if you scan more times. I think the problem can be caused by fuse itself but I’m not sure.
I have this exception:

libc++abi.dylib: terminating with uncaught exception of type uThrowable: Uno.Exception

Reproduce the issue

git clone git@github.com:zean00/fuse-qreader.git

open with fuse the folder example and run project on your device ios and repeat the scan more times. In the first five times you’ll probably notice the app crash.

ERROR IOS

2018-02-08 17:33:07.296964+0100 Example[388:38096] [DYMTLInitPlatform] platform initialization successful
2018-02-08 17:33:07.377033+0100 Example[388:37993] Metal GPU Frame Capture Enabled
2018-02-08 17:33:07.378021+0100 Example[388:37993] Metal API Validation Enabled
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication keyWindow]
PID: 388, TID: 38115, Thread name: (none), Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4   Example                             0x0000000102c80b2c _ZN1g11QreaderImpl11ScannerImplEv + 116
5   Example                             0x0000000102c80a74 _ZN1g11QreaderImpl4ScanEv + 68
6   Example                             0x0000000102c807b0 _ZN1g16Qreader__Scan_fnEP6uArrayPPNS_3Uno9Threading7Future1E + 20
7   Example                             0x0000000102c68d40 _ZN9uDelegate6InvokeE5uTRefPPvm + 216
8   Example                             0x0000000102c69060 _ZN9uDelegate6InvokeEmz + 176
9   Example                             0x0000000102d37f24 _ZN1g4Fuse9Scripting29NativePromise__ContextClosure13CreatePromiseEPNS1_7ContextEP6uArray + 156
10  Example                             0x0000000102d37e78 _ZN1g4Fuse9Scripting47NativePromise__ContextClosure__CreatePromise_fnEPNS1_29NativePromise__ContextClosureEPNS1_7ContextEP6uArrayPP7uObject + 20
11  Example                             0x0000000102c68d40 _ZN9uDelegate6InvokeE5uTRefPPvm + 216
12  Example                             0x0000000102c69060 _ZN9uDelegate6InvokeEmz + 176
13  Example                             0x0000000102d55248 _ZN1g4Fuse9Scripting14JavaScriptCore24Context__CallbackWrapper4CallEP6uArrayPPK13OpaqueJSValue + 72
14  Example                             0x0000000102d551f0 _ZN1g4Fuse9Scripting14JavaScriptCore33Context__CallbackWrapper__Call_fnEPNS2_24Context__CallbackWrapperEP6uArrayPPK13OpaqueJSValueSA_ + 20
15  Example                             0x0000000102c68d40 _ZN9uDelegate6InvokeE5uTRefPPvm + 216
16  Example                             0x0000000102c69060 _ZN9uDelegate6InvokeEmz + 176
17  Example                             0x0000000102d59598 _ZZN1g4Fuse9Scripting14JavaScriptCore10JSClassRef17CreateUnoCallbackEvEN3$_18__invokeEPK15OpaqueJSContextP13OpaqueJSValueS9_mPKPKS8_PSB_ + 124
18  JavaScriptCore                      0x0000000189319c1c <redacted> + 420
19  JavaScriptCore                      0x0000000188cbd464 <redacted> + 488
20  JavaScriptCore                      0x0000000189404444 <redacted> + 26996
21  JavaScriptCore                      0x00000001893fd900 <redacted> + 272
22  JavaScriptCore                      0x00000001892dc170 <redacted> + 184
23  JavaScriptCore                      0x0000000188cc1294 <redacted> + 400
24  JavaScriptCore                      0x0000000188f252e4 _ZN3JSC12profiledCallEPNS_9ExecStateENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 168
25  JavaScriptCore                      0x0000000188cc1044 JSObjectCallAsFunction + 392
26  Example                             0x0000000102d57ef0 _ZN1g4Fuse9Scripting14JavaScriptCore11JSObjectRef14CallAsFunctionEP13OpaqueJSValuePK15OpaqueJSContextS5_P6uArrayP9uDelegate + 56
27  Example                             0x0000000102d5789c _ZN1g4Fuse9Scripting14JavaScriptCore17Function__Call_fnEPNS2_8FunctionEPNS1_7ContextEP6uArrayPP7uObject + 116
28  Example                             0x0000000102d365d8 _ZN1g4Fuse9Scripting27FunctionMirror__CallClosure4CallEPNS1_7ContextE + 960
29  Example                             0x0000000102d52274 _ZN1g4Fuse9Scripting10JavaScript12ThreadWorker7RunOnceEPNS2_9JSContextE + 68
30  Example                             0x0000000102d52190 _ZN1g4Fuse9Scripting10JavaScript12ThreadWorker8RunInnerEPNS2_9JSContextE + 88
31  Example                             0x0000000102d51fcc _ZN1g4Fuse9Scripting10JavaScript12ThreadWorker3RunEv + 40
32  Example                             0x0000000102c749c8 _ZL13ThreadStartupPv + 68
33  libsystem_pthread.dylib             0x0000000181ee42b4 <redacted> + 308
34  libsystem_pthread.dylib             0x0000000181ee4180 <redacted> + 0
35  libsystem_pthread.dylib             0x0000000181ee2b74 thread_start + 4
2018-02-08 17:33:15.920122+0100 Example[388:38115] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication keyWindow]
PID: 388, TID: 38115, Thread name: (none), Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4   Example                             0x0000000102c80b2c _ZN1g11QreaderImpl11ScannerImplEv + 116
5   Example                             0x0000000102c80a74 _ZN1g11QreaderImpl4ScanEv + 68
6   Example                             0x0000000102c807b0 _ZN1g16Qreader__Scan_fnEP6uArrayPPNS_3Uno9Threading7Future1E + 20
7   Example                             0x0000000102c68d40 _ZN9uDelegate6InvokeE5uTRefPPvm + 216
8   Example                             0x0000000102c69060 _ZN9uDelegate6InvokeEmz + 176
9   Example                             0x0000000102d37f24 _ZN1g4Fuse9Scripting29NativePromise__ContextClosure13CreatePromiseEPNS1_7ContextEP6uArray + 156
10  Example                             0x0000000102d37e78 _ZN1g4Fuse9Scripting47NativePromise__ContextClosure__CreatePromise_fnEPNS1_29NativePromise__ContextClosureEPNS1_7ContextEP6uArrayPP7uObject + 20
11  Example                             0x0000000102c68d40 _ZN9uDelegate6InvokeE5uTRefPPvm + 216
12  Example                             0x0000000102c69060 _ZN9uDelegate6InvokeEmz + 176
13  Example                             0x0000000102d55248 _ZN1g4Fuse9Scripting14JavaScriptCore24Context__CallbackWrapper4CallEP6uArrayPPK13OpaqueJSValue + 72
14  Example                             0x0000000102d551f0 _ZN1g4Fuse9Scripting14JavaScriptCore33Context__CallbackWrapper__Call_fnEPNS2_24Context__CallbackWrapperEP6uArrayPPK13OpaqueJSValueSA_ + 20
15  Example                             0x0000000102c68d40 _ZN9uDelegate6InvokeE5uTRefPPvm + 216
16  Example                             0x0000000102c69060 _ZN9uDelegate6InvokeEmz + 176
17  Example                             0x0000000102d59598 _ZZN1g4Fuse9Scripting14JavaScriptCore10JSClassRef17CreateUnoCallbackEvEN3$_18__invokeEPK15OpaqueJSContextP13OpaqueJSValueS9_mPKPKS8_PSB_ + 124
18  JavaScriptCore                      0x0000000189319c1c <redacted> + 420
19  JavaScriptCore                      0x0000000188cbd464 <redacted> + 488
20  JavaScriptCore                      0x0000000189404444 <redacted> + 26996
21  JavaScriptCore                      0x00000001893fd900 <redacted> + 272
22  JavaScriptCore                      0x00000001892dc170 <redacted> + 184
23  JavaScriptCore                      0x0000000188cc1294 <redacted> + 400
24  JavaScriptCore                      0x0000000188f252e4 _ZN3JSC12profiledCallEPNS_9ExecStateENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 168
25  JavaScriptCore                      0x0000000188cc1044 JSObjectCallAsFunction + 392
26  Example                             0x0000000102d57ef0 _ZN1g4Fuse9Scripting14JavaScriptCore11JSObjectRef14CallAsFunctionEP13OpaqueJSValuePK15OpaqueJSContextS5_P6uArrayP9uDelegate + 56
27  Example                             0x0000000102d5789c _ZN1g4Fuse9Scripting14JavaScriptCore17Function__Call_fnEPNS2_8FunctionEPNS1_7ContextEP6uArrayPP7uObject + 116
28  Example                             0x0000000102d365d8 _ZN1g4Fuse9Scripting27FunctionMirror__CallClosure4CallEPNS1_7ContextE + 960
29  Example                             0x0000000102d52274 _ZN1g4Fuse9Scripting10JavaScript12ThreadWorker7RunOnceEPNS2_9JSContextE + 68
30  Example                             0x0000000102d52190 _ZN1g4Fuse9Scripting10JavaScript12ThreadWorker8RunInnerEPNS2_9JSContextE + 88
31  Example                             0x0000000102d51fcc _ZN1g4Fuse9Scripting10JavaScript12ThreadWorker3RunEv + 40
32  Example                             0x0000000102c749c8 _ZL13ThreadStartupPv + 68
33  libsystem_pthread.dylib             0x0000000181ee42b4 <redacted> + 308
34  libsystem_pthread.dylib             0x0000000181ee4180 <redacted> + 0
35  libsystem_pthread.dylib             0x0000000181ee2b74 thread_start + 4
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIWindow rootViewController]
PID: 388, TID: 38115, Thread name: (none), Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4   Example                             0x0000000102c80b44 _ZN1g11QreaderImpl11ScannerImplEv + 140
5   Example                             0x0000000102c80a74 _ZN1g11QreaderImpl4ScanEv + 68
6   Example                             0x0000000102c807b0 _ZN1g16Qreader__Scan_fnEP6uArrayPPNS_3Uno9Threading7Future1E + 20
7   Example                             0x0000000102c68d40 _ZN9uDelegate6InvokeE5uTRefPPvm + 216
8   Example                             0x0000000102c69060 _ZN9uDelegate6InvokeEmz + 176
9   Example                             0x0000000102d37f24 _ZN1g4Fuse9Scripting29NativePromise__ContextClosure13CreatePromiseEPNS1_7ContextEP6uArray + 156
10  Example                             0x0000000102d37e78 _ZN1g4Fuse9Scripting47NativePromise__ContextClosure__CreatePromise_fnEPNS1_29NativePromise__ContextClosureEPNS1_7ContextEP6uArrayPP7uObject + 20
11  Example                             0x0000000102c68d40 _ZN9uDelegate6InvokeE5uTRefPPvm + 216
12  Example                             0x0000000102c69060 _ZN9uDelegate6InvokeEmz + 176
13  Example                             0x0000000102d55248 _ZN1g4Fuse9Scripting14JavaScriptCore24Context__CallbackWrapper4CallEP6uArrayPPK13OpaqueJSValue + 72
14  Example                             0x0000000102d551f0 _ZN1g4Fuse9Scripting14JavaScriptCore33Context__CallbackWrapper__Call_fnEPNS2_24Context__CallbackWrapperEP6uArrayPPK13OpaqueJSValueSA_ + 20
15  Example                             0x0000000102c68d40 _ZN9uDelegate6InvokeE5uTRefPPvm + 216
16  Example                             0x0000000102c69060 _ZN9uDelegate6InvokeEmz + 176
17  Example                             0x0000000102d59598 _ZZN1g4Fuse9Scripting14JavaScriptCore10JSClassRef17CreateUnoCallbackEvEN3$_18__invokeEPK15OpaqueJSContextP13OpaqueJSValueS9_mPKPKS8_PSB_ + 124
18  JavaScriptCore                      0x0000000189319c1c <redacted> + 420
19  JavaScriptCore                      0x0000000188cbd464 <redacted> + 488
20  JavaScriptCore                      0x0000000189404444 <redacted> + 26996
21  JavaScriptCore                      0x00000001893fd900 <redacted> + 272
22  JavaScriptCore                      0x00000001892dc170 <redacted> + 184
23  JavaScriptCore                      0x0000000188cc1294 <redacted> + 400
24  JavaScriptCore                      0x0000000188f252e4 _ZN3JSC12profiledCallEPNS_9ExecStateENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 168
25  JavaScriptCore                      0x0000000188cc1044 JSObjectCallAsFunction + 392
26  Example                             0x0000000102d57ef0 _ZN1g4Fuse9Scripting14JavaScriptCore11JSObjectRef14CallAsFunctionEP13OpaqueJSValuePK15OpaqueJSContextS5_P6uArrayP9uDelegate + 56
27  Example                             0x0000000102d5789c _ZN1g4Fuse9Scripting14JavaScriptCore17Function__Call_fnEPNS2_8FunctionEPNS1_7ContextEP6uArrayPP7uObject + 116
28  Example                             0x0000000102d365d8 _ZN1g4Fuse9Scripting27FunctionMirror__CallClosure4CallEPNS1_7ContextE + 960
29  Example                             0x0000000102d52274 _ZN1g4Fuse9Scripting10JavaScript12ThreadWorker7RunOnceEPNS2_9JSContextE + 68
30  Example                             0x0000000102d52190 _ZN1g4Fuse9Scripting10JavaScript12ThreadWorker8RunInnerEPNS2_9JSContextE + 88
31  Example                             0x0000000102d51fcc _ZN1g4Fuse9Scripting10JavaScript12ThreadWorker3RunEv + 40
32  Example                             0x0000000102c749c8 _ZL13ThreadStartupPv + 68
33  libsystem_pthread.dylib             0x0000000181ee42b4 <redacted> + 308
34  libsystem_pthread.dylib             0x0000000181ee4180 <redacted> + 0
35  libsystem_pthread.dylib             0x0000000181ee2b74 thread_start + 4
2018-02-08 17:33:16.164121+0100 Example[388:38115] [reports] Main Thread Checker: UI API called on a background thread: -[UIWindow rootViewController]
PID: 388, TID: 38115, Thread name: (none), Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4   Example                             0x0000000102c80b44 _ZN1g11QreaderImpl11ScannerImplEv + 140
5   Example                             0x0000000102c80a74 _ZN1g11QreaderImpl4ScanEv + 68
6   Example                             0x0000000102c807b0 _ZN1g16Qreader__Scan_fnEP6uArrayPPNS_3Uno9Threading7Future1E + 20
7   Example                             0x0000000102c68d40 _ZN9uDelegate6InvokeE5uTRefPPvm + 216
8   Example                             0x0000000102c69060 _ZN9uDelegate6InvokeEmz + 176
9   Example                             0x0000000102d37f24 _ZN1g4Fuse9Scripting29NativePromise__ContextClosure13CreatePromiseEPNS1_7ContextEP6uArray + 156
10  Example                             0x0000000102d37e78 _ZN1g4Fuse9Scripting47NativePromise__ContextClosure__CreatePromise_fnEPNS1_29NativePromise__ContextClosureEPNS1_7ContextEP6uArrayPP7uObject + 20
11  Example                             0x0000000102c68d40 _ZN9uDelegate6InvokeE5uTRefPPvm + 216
12  Example                             0x0000000102c69060 _ZN9uDelegate6InvokeEmz + 176
13  Example                             0x0000000102d55248 _ZN1g4Fuse9Scripting14JavaScriptCore24Context__CallbackWrapper4CallEP6uArrayPPK13OpaqueJSValue + 72
14  Example                             0x0000000102d551f0 _ZN1g4Fuse9Scripting14JavaScriptCore33Context__CallbackWrapper__Call_fnEPNS2_24Context__CallbackWrapperEP6uArrayPPK13OpaqueJSValueSA_ + 20
15  Example                             0x0000000102c68d40 _ZN9uDelegate6InvokeE5uTRefPPvm + 216
16  Example                             0x0000000102c69060 _ZN9uDelegate6InvokeEmz + 176
17  Example                             0x0000000102d59598 _ZZN1g4Fuse9Scripting14JavaScriptCore10JSClassRef17CreateUnoCallbackEvEN3$_18__invokeEPK15OpaqueJSContextP13OpaqueJSValueS9_mPKPKS8_PSB_ + 124
18  JavaScriptCore                      0x0000000189319c1c <redacted> + 420
19  JavaScriptCore                      0x0000000188cbd464 <redacted> + 488
20  JavaScriptCore                      0x0000000189404444 <redacted> + 26996
21  JavaScriptCore                      0x00000001893fd900 <redacted> + 272
22  JavaScriptCore                      0x00000001892dc170 <redacted> + 184
23  JavaScriptCore                      0x0000000188cc1294 <redacted> + 400
24  JavaScriptCore                      0x0000000188f252e4 _ZN3JSC12profiledCallEPNS_9ExecStateENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 168
25  JavaScriptCore                      0x0000000188cc1044 JSObjectCallAsFunction + 392
26  Example                             0x0000000102d57ef0 _ZN1g4Fuse9Scripting14JavaScriptCore11JSObjectRef14CallAsFunctionEP13OpaqueJSValuePK15OpaqueJSContextS5_P6uArrayP9uDelegate + 56
27  Example                             0x0000000102d5789c _ZN1g4Fuse9Scripting14JavaScriptCore17Function__Call_fnEPNS2_8FunctionEPNS1_7ContextEP6uArrayPP7uObject + 116
28  Example                             0x0000000102d365d8 _ZN1g4Fuse9Scripting27FunctionMirror__CallClosure4CallEPNS1_7ContextE + 960
29  Example                             0x0000000102d52274 _ZN1g4Fuse9Scripting10JavaScript12ThreadWorker7RunOnceEPNS2_9JSContextE + 68
30  Example                             0x0000000102d52190 _ZN1g4Fuse9Scripting10JavaScript12ThreadWorker8RunInnerEPNS2_9JSContextE + 88
31  Example                             0x0000000102d51fcc _ZN1g4Fuse9Scripting10JavaScript12ThreadWorker3RunEv + 40
32  Example                             0x0000000102c749c8 _ZL13ThreadStartupPv + 68
33  libsystem_pthread.dylib             0x0000000181ee42b4 <redacted> + 308
34  libsystem_pthread.dylib             0x0000000181ee4180 <redacted> + 0
35  libsystem_pthread.dylib             0x0000000181ee2b74 thread_start + 4
2018-02-08 17:33:16.310964+0100 Example[388:38115] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2018-02-08 17:33:16.314020+0100 Example[388:38115] [MC] Reading from public effective user settings.
2018-02-08 17:33:17.030157+0100 Example[388:37993] [Common] _BSMachError: port 8c03; (os/kern) invalid capability (0x14) "Unable to insert COPY_SEND"
2018-02-08 17:33:17.030915+0100 Example[388:37993] [Common] _BSMachError: port 8c03; (os/kern) invalid capability (0x14) "Unable to insert COPY_SEND"
libc++abi.dylib: terminating with uncaught exception of type uThrowable: Uno.Exception
(lldb) 

The log at the bottom is not the cause of the crash, and it is not directly related to the crash you’re reporting above.

As you can see, the crash happens in a Future block, specifically when trying to resolve a promise. That leads us to a conclusion that the problem likely originates on this line.

I’d say it’s a problem in the library, not Fuse. Perhaps you could try to look up other Foreign code promise implementations, compare them to this and maybe even fix it.