Skip to content

fix: windows handles leak (x86_64) due to libstdc++ issue - #9

Merged
onebeastchris merged 1 commit into
opencollab-incubator:mainfrom
Skullians:fix/compiler-handle-leak
Nov 25, 2026
Merged

onebeastchris merged 1 commit into
opencollab-incubator:mainfrom
Skullians:fix/compiler-handle-leak

Conversation

@Skullians

@Skullians Skullians commented Nov 24, 2026 •

Copy link
Copy Markdown

Fixes GeyserMC/Geyser#6920.

moves the compiler for windows x86_64 building to clang64, this is explained in the commit diff, but I'll TL;DR here as well:

gcc + libstdc++ is apparently not competent enough to handle pthread destroys, so it doesn't actually destroy pthreads if a static initializer exists

This isn't an issue on linux, but when it comes to Windows' shittery, the objects (from what I can see this is an event as well as some semaphores?) don't get freed until destroyed, which creates a giant leak as the underlying pthread is never actually destroyed... wowzers!
had to hunt these down, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59807 and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107857 both describe this issue (one targets ::mutex and the other is the recursive variant lol)

alas, clang + libc++ on the other hand, doesn't have this issue

In regards to testing:
Was only able to reproduce original issue on windows with a Geyser Standalone instance, tested the leaks as well with a temporary test in the workflow on a separate branch:

(yes I cancelled the clang64 action as macos was making me impatient)
the aarch64 handling already used clangarm64 which is why it wasn't affected

@onebeastchris onebeastchris changed the title fix: windows handles leak (x86_64) due to libstdc++ incompetence fix: windows handles leak (x86_64) due to libstdc++ issue Nov 25, 2026
@onebeastchris

Copy link
Copy Markdown

Thanks!

@onebeastchris
onebeastchris merged commit b2c91de into opencollab-incubator:main Nov 25, 2026
onebeastchris added a commit to CloudburstMC/Network that referenced this pull request Nov 27, 2026
This brings in upstream improvements, mainly:

usrsctp changes:
- opencollab-incubator/usrsctp#1 (Restart T3-rtx on a new cumulative ack in the express SACK path)

libdatachannel:
- opencollab-incubator/libdatachannel#4 (Report the bytes in the SCTP association's own queues)
- opencollab-incubator/libdatachannel#5 (Make usrsctp's cwnd-based max burst a setting)
- opencollab-incubator/libdatachannel#6 (Pull in usrsctp changes)

libdatachannel-java:
- opencollab-incubator/libdatachannel-java#6 (Expose the bytes in the SCTP association's own queues and the send buffer that bounds them)
- opencollab-incubator/libdatachannel-java#7 (Expose usrsctp's cwnd-based max burst as a setting)
- opencollab-incubator/libdatachannel-java#8 (Sync jni/libdatachannel to latest fork update)
- opencollab-incubator/libdatachannel-java#9 (fix: windows handles leak (x86_64) due to libstdc++ issue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants