Skip to content

Avoid triggering a segfault due to a read/close race - #25

Open
matthewd wants to merge 2 commits into
shokai:masterfrom
matthewd:close-race
Open

matthewd wants to merge 2 commits into
shokai:masterfrom
matthewd:close-race

Conversation

@matthewd

@matthewd matthewd commented Oct 6, 2016

Copy link
Copy Markdown

A well-timed pair of threads can trigger a segfault if they call close and read on the same IO at the same time.

It's easy to avoid that with a tiny rearrangement: we can just make sure we shut down the read thread before we close the socket.

No new test, because it's not that easy to trigger on demand.

Kill the read thread, and wait for it to die, before we close the
socket.
@unasuke

unasuke commented Dec 30, 2021

Copy link
Copy Markdown
Contributor

@matthewd This repository was moved ruby-jp/websocket-client-simple. If you still need this, make pull request or issue to ruby-jp/websocket-client-simple again, thx.

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.

2 participants