Repository navigation
fix: close races in MediaReader.getInfo and WebRtc.createPeer - #406
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MediaReader.getInfo()now holds the same monitor asclose(), which may run on any thread. Before, it could use a native reader thatclose()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.