Closed Rex-xingjl closed 8 months ago
FATAL ERROR: /Users/Rex/GitLab/OpenSource/node-swift/example/node_modules/node-swift/Sources/NodeAPI/NodeActor.swift:49 There is no target NodeAsyncQueue associated with this Task
1: 0x10fc4ef68 node::Buffer::New(v8::Isolate*, char*, unsigned long) [/Users/Rex/GitLab/MyApp/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
2: 0x10fc4f05c node::OnFatalError(char const*, char const*) [/Users/Rex/GitLab/MyApp/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
3: 0x10fc4ef80 node::OnFatalError(char const*, char const*) [/Users/Rex/GitLab/MyApp/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
4: 0x10fc1332c napi_open_callback_scope [/Users/Rex/GitLab/MyApp/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
5: 0x101e2b120 $s7NodeAPI14nodeFatalError_4file4lines5NeverOSS_s12StaticStringVSutFAFSRys5UInt8VGXEfU_AFSRys4Int8VGXEfU_ [/Users/Rex/GitLab/MyApp/libNodeAPI.dylib]
6: 0x101e2acd0 $s7NodeAPI14nodeFatalError_4file4lines5NeverOSS_s12StaticStringVSutF [/Users/Rex/GitLab/MyApp/libNodeAPI.dylib]
7: 0x101e078fc $s7NodeAPI0A8Executor33_966FF45FD4F1A9C026C3CF1C68879B06LLC7enqueueyyScJF [/Users/Rex/GitLab/MyApp/libNodeAPI.dylib]
8: 0x101e07b60 $s7NodeAPI0A8Executor33_966FF45FD4F1A9C026C3CF1C68879B06LLCScFAAScF7enqueueyys3JobVnFTW [/Users/Rex/GitLab/MyApp/libNodeAPI.dylib]
9: 0x101e07b18 $s7NodeAPI0A8Executor33_966FF45FD4F1A9C026C3CF1C68879B06LLCScfAAScf7enqueueyys0C3JobVnFTW [/Users/Rex/GitLab/MyApp/libNodeAPI.dylib]
10: 0x22ce2aa30 _swift_task_enqueueOnExecutor [/usr/lib/swift/libswift_Concurrency.dylib]
11: 0x22ce68e3c swift::AsyncTask::flagAsAndEnqueueOnExecutor(swift::ExecutorRef) [/usr/lib/swift/libswift_Concurrency.dylib]
12: 0x22ce674dc swift_task_switchImpl(swift::AsyncContext*, void (swift::AsyncContext* swift_async_context) swiftasynccall*, swift::ExecutorRef) [/usr/lib/swift/libswift_Concurrency.dylib]
13: 0x22ce65dbc swift::runJobInEstablishedExecutorContext(swift::Job*) [/usr/lib/swift/libswift_Concurrency.dylib]
14: 0x22ce66fb4 swift_job_runImpl(swift::Job*, swift::ExecutorRef) [/usr/lib/swift/libswift_Concurrency.dylib]
15: 0x18ba6a1f4 _dispatch_root_queue_drain [/usr/lib/system/libdispatch.dylib]
16: 0x18ba6aa04 _dispatch_worker_thread2 [/usr/lib/system/libdispatch.dylib]
17: 0x18bc060d8 _pthread_wqthread [/usr/lib/system/libsystem_pthread.dylib]
18: 0x18bc04e30 start_wqthread [/usr/lib/system/libsystem_pthread.dylib]
/Users/Rex/GitLab/MyApp/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron exited with signal SIGABRT
I have fixed it myself
I encountered a crash issue while developing the Mac version with electronjs. The crash occurs when I pass a method named ‘foo’ from JavaScript to Swift. Within objectA, I can call ‘foo’ normally. However, when I set objectA as the exportedObject in XPCService and transfer it to another process, calling the protocol method of objectA to invoke ‘foo’ leads to a crash.