-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Race condition causes segfault in librustuv when using libgreen with stream reading #15231
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
Comments
I have acquired a backtrace by attaching gdb to a running process rather than running the process from gdb to begin with (why this works I have no idea)
|
After debugging with visual studio I figured out the exact line causing the segfault. At https://github.com/rust-lang/rust/blob/master/src/librustuv/stream.rs#L253 it is |
It appears even sending packets to the connection causes it to die. Has anyone even tested libgreen on Windows with TCP? |
I have determined the cause of the bug to be a race condition. Specifically every time I open up a connection, |
To further expand, |
Yes, no commit gets pushed to master unless it passes all tests on windows, and that includes many networking tests. Do you have a small test case which reproduces this bug? It's likely that there's just some different callback-invoking behavior on windows than on unix that was accidentally not dealt with. |
Here is a minimal code example: https://gist.github.com/retep998/224bfb130448e086df76 |
When cloning a stream, the data is already guaranteed to be in a consistent state, so there's no need to perform a zeroing. This prevents segfaults as seen in rust-lang#15231 Closes rust-lang#15231
…e-2, r=lowr internal: Migrate more assists to use the structured snippet API Continuing from rust-lang#14979 Migrates the following assists: - `generate_derive` - `wrap_return_type_in_result` - `generate_delegate_methods` As a bonus, `generate_delegate_methods` now generates the function and impl block at the correct indentation 🎉.
…e-3, r=lowr internal: Migrate assists to the structured snippet API, part 3 Continuing from rust-lang#15231 Migrates the following assists: - `add_missing_match_arms` - `fix_visibility` - `promote_local_to_const` The `add_missing_match_arms` changes are best reviewed commit-by-commit since they're relatively big changes compared to the rest of the commits.
When using libgreen on Windows (verified not to occur with libnative) when I'm reading from a TcpStream and the remote host closes the stream (specifically I'm closing the client by pressing ctrl + c), the server silently terminates with no error messages. It appears SIGSEGV is being called.
The code I was writing which caused this issue can be found here: https://github.com/NoLifeDev/NoLifePony/tree/c26be99492403c734718d37ed91d0546ec190785
Using Windows 8.1 x64 with latest Rust nightly.
Attempts to backtrace using gdb have failed: https://gist.github.com/retep998/e820aea8f019b29660fe
The text was updated successfully, but these errors were encountered: