Closed harbu closed 3 years ago
Update: problem could be on our side as well, as the source of the error is our code. Maybe our logging method is thread unsafe?
cout << now() << logId << " DataChannel " << peerId << " LOW buffer " << dc->bufferedAmount()<< endl;
The complete code of our onBufferedAmountLow callback where the crash happens is
dc->onBufferedAmountLow([obj = this, logId = this->logId, peerId = this->peerId, dc= this->dc] ()
{
obj->paused = false;
cout << now() << logId << " DataChannel " << peerId << " LOW buffer " << dc->bufferedAmount()<< endl;
});
I wonder if we are using the closure correctly..
It looks like there is indeed an issue with the log line itself. Is the captured dc
set at this point? this->dc
it assigned only later line 93.
Well spotted! Apparently we followed the typescript version too faithfully, without noticing that a C++ smart pointer works quite differently compared to a Javascript reference.
Hello!
First of all, thanks for great library and project!
I'm reporting an issue we discovered while investigating #354 (potentially related to this).
For context: we've been studying the issue of connection speeds decreasing over time, originally via the node-datachannel library https://github.com/murat-dogan/node-datachannel/issues/32 as our main project is written in JavaScript.
We rebuilt our Node.js "issue reproduce project" in C++ to understand if the issue occurs also in C++ clients. While working on this, we noticed that when running connections for a long period of time, a segfault can occur. The following is a stack trace retrieved with gdb from a core dump:
Wondering if this could provide some insight into #354 or whether this is a separate issue altogether.
For context, we built libdatachannel under
Ubuntu 20.04.2 LTS
with flagsI can provide more details on how to reproduce this if necessary. Shortly put: we forked this repo to implement our C++-based example: https://github.com/streamr-dev/libdatachannel/tree/master/examples/multi-node-benchmark but reused our nodejs-based signaling server.