-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Avoid abseil containers with SeqManager compare functions #1369
Conversation
Fixes #1366 ### Details - As demonstrated in temporal PR #1368, standard C++ STD containers do not throw (even in debug mode) when using `Compare` functions in maps/sets that do not honor transitivity, i.e. `comp(a,b) && comp(b,c) -> comp(a,c)`. - So let's not use abseil containers in those cases. ### Bonus tracks - Dupicate CI actions in debug mode. - Make mediasoup Rust building honor `MEDIASOUP_BUILDTYPE` env variable if given. - Fix an amazing bug in `AudioLevelObserver.cpp` which failed to compile because it uses a `absl::btree_multimap` without including the `absl/container/btree_map.h` header (it didn't fail before due to some absl header included by yet anothe included file, etc).
UPDATE: Fixed here: 3b23846 OMG... https://github.com/versatica/mediasoup/actions/runs/8613704210/job/23605569292?pr=1369 I'm reproducing it in local:
console.info
console.error
console.error
|
UPDATE: Fixed here: 3b23846 Ok, here the coredump:
It is in WebRtcServer::~WebRtcServer()
{
MS_TRACE();
MS_DUMP_STD("------ 1");
this->shared->channelMessageRegistrator->UnregisterHandler(this->id);
MS_DUMP_STD("------ 2");
for (auto& item : this->udpSocketOrTcpServers)
{
delete item.udpSocket;
item.udpSocket = nullptr;
delete item.tcpServer;
item.tcpServer = nullptr;
}
this->udpSocketOrTcpServers.clear();
MS_DUMP_STD("------ 3");
for (auto* webRtcTransport : this->webRtcTransports)
{
MS_DUMP_STD("------ 3.1");
webRtcTransport->ListenServerClosed();
MS_DUMP_STD("------ 3.2");
}
MS_DUMP_STD("------ 4");
this->webRtcTransports.clear();
MS_DUMP_STD("------ 5");
}
|
UPDATE: Fixed here: 3b23846 Ok, I've added more logs and I see what it's happening:
|
I've fixed the bug here: 3b23846 |
# NOTE: In Windows this will build and test libmediasoupworker in release | ||
# mode twice since build.rs doesn't allow debug mode for Windows. | ||
- name: cargo test | ||
run: cargo test --verbose | ||
run: | | ||
cargo test --verbose | ||
cargo test --release --verbose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? cargo test
is debug build, how is building it twice helps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean that I wrote this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have absolutely no idea why that duplicate call was added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it just tests debug and release builds, but internal C++ library is only compiled in release mode. Now I get it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And is it ok or does it make sense? I don't remember anything about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, all good, sorry for the noise
Fixes #1366
Details
Compare
functions in maps/sets that do not honor transitivity, i.e.comp(a,b) && comp(b,c) -> comp(a,c)
.Bonus tracks
AudioLevelObserver.cpp
which failed to compile because it uses aabsl::btree_multimap
without including theabsl/container/btree_map.h
header (it didn't fail before due to some absl header included by yet anothe included file, etc).