Comments (7)
Oh i thought it was precisely the case that was fixed by this :D anyway thank you
from libdatachannel.
Looks like this happens when recvfrom fails inside agent_run, making it exit the loop and destroy the agent
from libdatachannel.
Good catch, it seems that it's not even a race condition, I actually forgot the test in libjuice when the thread terminates to destroy the agent only if its destruction has been requested. For some reason the connectivity test doesn't crash.
from libdatachannel.
Maybe you also need to release the agent mutex?
from libdatachannel.
i ended up doing this to fix it:
if (len < 0) {
JLOG_ERROR("recvfrom failed, errno=%d", sockerrno);
agent->thread_started = false;
pthread_mutex_unlock(&agent->mutex);
agent_change_state(agent, JUICE_STATE_DISCONNECTED);
return;
//break;
}
from libdatachannel.
Maybe you also need to release the agent mutex?
Oh, yes indeed. Your solution works except in the edge case where destruction is requested, and at the same moment recvfrom fails.
from libdatachannel.
FYI, I took the opportunity to add a proper thread interruption mechanism to libjuice, which allows to join the thread on destruction: paullouisageneau/libjuice@dd3a537
from libdatachannel.
Related Issues (20)
- Websocket::Open crash HOT 3
- Error in build node-datachannel for webtorrent-cli HOT 2
- ABI issue when linking HOT 2
- RtpPacketizationConfig not properly initialized HOT 2
- setLocalDescription's Init parameter may not work. HOT 3
- The push function of the sendQueue in DataChannel will trigger wait and can not be awaked. HOT 3
- Client xxx not found HOT 2
- WebSocket::path() returns nullopt when state is Connecting HOT 2
- Mixed up dynamic and static libjuice dependencies HOT 1
- Source directory requires read/write filesystem during build HOT 3
- C API lacking proper closure support HOT 4
- Lost connectivity after successful connection HOT 7
- WebSocketServer not stopping properly HOT 2
- How to troubleshoot when the onGatheringStateChange function returns very slowly? HOT 1
- Websocket disconnect HOT 2
- Trouble connecting via TURN server HOT 1
- Does libdatachannel support to compile in pure C Linux system(for some embedded device no support C++17)? HOT 3
- rtc::PeerConnection::close() causes the application to crash when called multiple times HOT 1
- Unable to retrieve negotiated media details HOT 2
- crash HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libdatachannel.