-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash when using inside a worker #129
Comments
|
HI @murat-dogan, I'm not using Docker. I have a module which loads a worker:
Then inside that worker, I load and use node-datachannel to try a connection with 2 peers through a turn server
Same code works fine outside a worker. |
@murat-dogan I think it could come from how callbacks are scheduled. Possibly it tries to execute the callback of the worker on the main event loop. |
@paullouisageneau Normally V8 engine provides isolated environment for all worker_threads as I know. We are still using old
Could you please check it? Test env;
|
Hi @murat-dogan, sorry, are you expecting a test from my side ? If yes, I will do it quickly |
Hi |
@paullouisageneau Could you please check #131 ? @oanguenot |
@murat-dogan Sorry I didn't have time to check the issue, I'm looking into #131 |
Hi @oanguenot , Did you have any chance to test v0.4.0? |
I am closing this as well. |
Using Node LTS (v16.17.0), I tried to load and execute node-datachannel into a Node worker_threads.
It seems to start correctly, but I have the following error:
FATAL ERROR: HandleScope::HandleScope Entering the V8 API without proper locking in place
Here is the complete logs captured from the worker
2022-08-30 16:54:08.968 DEBUG [1837469] [rtc::impl::Init::doInit@120] Global initialization
2022-08-30 16:54:09.103 DEBUG [1837472] [rtc::impl::Certificate::Generate@223] Generating certificate (OpenSSL)
2022-08-30 16:54:09.103 VERB [1837469] [rtc::impl::PeerConnection::PeerConnection@59] Creating PeerConnection
2022-08-30 16:54:09.104 VERB [1837469] [rtc::impl::PeerConnection::PeerConnection@59] Creating PeerConnection
2022-08-30 16:54:09.104 DEBUG [1837471] [rtc::impl::Certificate::Generate@223] Generating certificate (OpenSSL)
2022-08-30 16:54:09.110 VERB [1837469] [rtc::PeerConnection::setLocalDescription@87] Setting local description, type=unspec
2022-08-30 16:54:09.110 VERB [1837469] [rtc::impl::PeerConnection::initIceTransport@146] Starting ICE transport
2022-08-30 16:54:09.110 DEBUG [1837469] [rtc::impl::IceTransport::IceTransport@58] Initializing ICE transport (libjuice)
2022-08-30 16:54:09.110 VERB [1837472] [rtc::impl::Certificate::Generate@239] Generating ECDSA P-256 key pair
2022-08-30 16:54:09.110 VERB [1837471] [rtc::impl::Certificate::Generate@239] Generating ECDSA P-256 key pair
2022-08-30 16:54:09.116 VERB [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Creating agent
2022-08-30 16:54:09.122 VERB [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Using random() for random bytes
2022-08-30 16:54:09.123 VERB [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Created local description: ufrag="8/1y", pwd="Kw0ONnHlyyU1b1uwWg26ky"
2022-08-30 16:54:09.123 VERB [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Generated local SDP description: a=ice-ufrag:8/1y
a=ice-pwd:Kw0ONnHlyyU1b1uwWg26ky
a=ice-options:ice2,trickle
2022-08-30 16:54:09.123 VERB [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Assuming controlling mode
2022-08-30 16:54:09.123 DEBUG [1837469] [rtc::impl::PeerConnection::processLocalDescription@948] Adding application to local description, mid="0"
2022-08-30 16:54:09.136 VERB [1837469] [rtc::impl::PeerConnection::processLocalDescription@964] Issuing local description: v=0
o=rtc 2003054121 0 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0
a=msid-semantic:WMS *
a=setup:actpass
a=ice-ufrag:8/1y
a=ice-pwd:Kw0ONnHlyyU1b1uwWg26ky
a=ice-options:ice2,trickle
a=fingerprint:sha-256 FF:A9:2B:12:56:01:DC:F1:8D:02:49:C1:3F:48:06:64:A9:8B:46:4B:ED:FB:86:E6:DB:5E:0C:B2:FF:A0:64:3F
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 0.0.0.0
a=mid:0
a=sendrecv
a=sctp-port:5000
a=max-message-size:262144
2022-08-30 16:54:09.136 INFO [1837469] [rtc::impl::PeerConnection::changeSignalingState@1182] Changed signaling state to have-local-offer
2022-08-30 16:54:09.136 INFO [1837469] [rtc::impl::PeerConnection::changeGatheringState@1169] Changed gathering state to in-progress
2022-08-30 16:54:09.136 VERB [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Gathering candidates
2022-08-30 16:54:09.136 VERB [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Creating connections registry
2022-08-30 16:54:09.136 VERB [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Starting connections thread
2022-08-30 16:54:09.136 VERB [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Creating connection
FATAL ERROR: HandleScope::HandleScope Entering the V8 API without proper locking in place
1: 0x1058f5205 node::Abort() (.cold.1) [/Users/oan/.volta/tools/image/node/16.17.0/bin/node]
2: 0x1045f64d9 node::Abort() [/Users/oan/.volta/tools/image/node/16.17.0/bin/node]
3: 0x1045f664f node::OnFatalError(char const*, char const*) [/Users/oan/.volta/tools/image/node/16.17.0/bin/node]
4: 0x10476bbc1 v8::HandleScope::HandleScope(v8::Isolate*) [/Users/oan/.volta/tools/image/node/16.17.0/bin/node]
2022-08-30 16:54:09.153 VERB [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: UDP socket bound to any:57999
2022-08-30 16:54:09.154 VERB [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Interrupting connections thread
2022-08-30 16:54:09.154 INFO [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Changing state to gathering
2022-08-30 16:54:09.154 VERB [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Adding 1 local host candidates
2022-08-30 16:54:09.154 VERB [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Gathered host candidate: a=candidate:1 1 UDP 2122317823 10.64.4.254 57999 typ host
2022-08-30 16:54:09.154 VERB [1837469] [rtc::Candidate::parse@100] Parsing candidate: 1 1 UDP 2122317823 xx.xx.xx.xx 57999 typ host
2022-08-30 16:54:09.154 VERB [1837469] [rtc::impl::PeerConnection::processLocalCandidate@1003] Issuing local candidate: a=candidate:1 1 UDP 2122317823 xx.xx.xx.xx 57999 typ host
2022-08-30 16:54:09.154 VERB [1837469] [rtc::Candidate::resolve@144] Resolving candidate (mode=simple): xx.xx.xx.xx 57999
2022-08-30 16:54:09.154 VERB [1837469] [rtc::Candidate::resolve@179] Resolved candidate: xx.xx.xx.xx 57999
2022-08-30 16:54:09.154 INFO [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Changing state to connecting
2022-08-30 16:54:09.154 INFO [1837469] [rtc::impl::PeerConnection::changeState@1151] Changed state to connecting
2022-08-30 16:54:09.154 VERB [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Interrupting connections thread
2022-08-30 16:54:09.154 VERB [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Resolving servers synchronously
2022-08-30 16:54:09.154 VERB [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Updating gathering status
2022-08-30 16:54:09.154 INFO [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Candidate gathering done
2022-08-30 16:54:09.154 INFO [1837469] [rtc::impl::PeerConnection::changeGatheringState@1169] Changed gathering state to complete
2022-08-30 16:54:09.154 VERB [1837469] [rtc::impl::IceTransport::LogCallback@354] juice: Interrupting connections thread
5: 0x1045b3888 napi_open_handle_scope [/Users/oan/.volta/tools/image/node/16.17.0/bin/node]
2022-08-30 16:54:09.155 VERB [1837481] [rtc::impl::IceTransport::LogCallback@354] juice: Entering poll on 1 sockets for 0 ms
2022-08-30 16:54:09.155 VERB [1837481] [rtc::impl::IceTransport::LogCallback@354] juice: Leaving poll
2022-08-30 16:54:09.161 VERB [1837481] [rtc::impl::IceTransport::LogCallback@354] juice: Bookkeeping...
6: 0x111a21623 ThreadSafeCallback::Impl::async_callback() [/Users/oan/github/QuickCafeClient/node_modules/node-datachannel/build/Release/node_datachannel.node]
2022-08-30 16:54:09.164 VERB [1837481] [rtc::impl::IceTransport::LogCallback@354] juice: Entering poll on 1 sockets for 9998 ms
7: 0x111a214ce ThreadSafeCallback::Impl::static_async_callback(uv_async_s*) [/Users/oan/github/QuickCafeClient/node_modules/node-datachannel/build/Release/node_datachannel.node]
8: 0x104fb9aeb uv__async_io [/Users/oan/.volta/tools/image/node/16.17.0/bin/node]
9: 0x104fcd8bb uv__io_poll [/Users/oan/.volta/tools/image/node/16.17.0/bin/node]
10: 0x104fba071 uv_run [/Users/oan/.volta/tools/image/node/16.17.0/bin/node]
11: 0x10452a733 node::SpinEventLoop(node::Environment*) [/Users/oan/.volta/tools/image/node/16.17.0/bin/node]
12: 0x104635c51 node::NodeMainInstance::Run(int*, node::Environment*) [/Users/oan/.volta/tools/image/node/16.17.0/bin/node]
13: 0x1046358d3 node::NodeMainInstance::Run() [/Users/oan/.volta/tools/image/node/16.17.0/bin/node]
14: 0x1045c3bd2 node::Start(int, char**) [/Users/oan/.volta/tools/image/node/16.17.0/bin/node]
15: 0x1191b24fe
Not use of the support of node-datachannel into a Node worker thread.
The text was updated successfully, but these errors were encountered: