Skip to content
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

RequestBuilder::send() can result in SIGPIPE #720

Closed
PeterSP opened this issue Jan 14, 2016 · 5 comments
Closed

RequestBuilder::send() can result in SIGPIPE #720

PeterSP opened this issue Jan 14, 2016 · 5 comments

Comments

@PeterSP
Copy link

PeterSP commented Jan 14, 2016

In a long-running process using hyper 0.6.14, inevitably after some hours of operation a SIGPIPE is received during hyper::net::HttpStream.Write::write calling net::tcp::TcpStream.Write::write calling send() from libc.

I'm under the impression this is an example of this sort of behavior, which could be fixed by catching the SIGPIPE.

Assuming I have the right idea, I would suggest either making sure not to send to closed sockets (which may not be easily possible), handling such SIGPIPEs in hyper, or adding documentation suggesting developers handle any SIGPIPEs which may come up while sending HTTP requests through hyper.

@seanmonstar
Copy link
Member

Do you have any more specific info, such as OS, if using child processes, or calling in to Rust from another language, or anything?

Rust specifically turns off SIGPIPE behavior here: https://github.com/rust-lang/rust/blob/master/src/libstd/sys/unix/mod.rs#L76

So I'd think that if something is occurring that skips that, it should probably be fixed in Rust itself.

@PeterSP
Copy link
Author

PeterSP commented Jan 15, 2016

$ uname -a
Linux [hostname] 4.0.4-301.fc22.x86_64 #1 SMP Thu May 21 13:10:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Using glibc 2.21

rustc version 1.3.0

Single process, run in gdb.

No other languages in the program (communicates over network with programs in other languages, but no other languages embedded in the program itself).

@seanmonstar
Copy link
Member

Hm, some superficial Googling suggests that even with signal(SIGPIPE, SIG_IGN), gdb will still notice the signal and exit? Example http://ahlamnote.blogspot.com/2006/12/gdb-ignore-sigpipe.html

@PeterSP
Copy link
Author

PeterSP commented Jan 15, 2016

Bizarre. Hopefully that'll "fix" the "problem."

@seanmonstar
Copy link
Member

I'm going to say that and SIGPIPE happening in Rust program that uses libstd is perhaps a bug in libstd.

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

No branches or pull requests

2 participants