Skip to content

fix: close races in MediaReader.getInfo and WebRtc.createPeer - #406

Merged
devopvoid merged 1 commit into
mainfrom
fix/close-races
Oct 21, 2026
Merged

devopvoid merged 1 commit into
mainfrom
fix/close-races

Conversation

@devopvoid

Copy link
Copy Markdown
Owner
  • MediaReader.getInfo() now holds the same monitor as close(), which may run on any thread. Before, it could use a native reader that close() had just freed (SIGSEGV).
  • WebRtc.createPeer() registers the peer before checking the runtime again, so a closing runtime either closes the peer before freeing the factory or is seen and refused.
  • PeerImpl.open() no longer creates a connection for a peer that is already closed, and ends its wait once the runtime has stopped its threads instead of hanging on a dropped task.

MediaReader.getInfo now holds the same monitor as close, which may run on
any thread; before, it could use a reader close had just freed (SIGSEGV).

createPeer registers the peer before checking the runtime again, so a
closing runtime either closes it before freeing the factory or is seen.
open skips creating the connection once the peer is closed, and ends its
wait when the runtime has stopped its threads and dropped the task.
@devopvoid
devopvoid merged commit 7bbf69b into main Oct 21, 2026
14 checks passed
@devopvoid
devopvoid deleted the fix/close-races branch October 21, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant