Live data from Hacker News

We found a bug in the hyper HTTP library

blog.cloudflare.com

61–70 of 97 posts

Re: We found a bug in the hyper HTTP library

#62
post #43

Earlier quoted context omitted.

I said ‘flagged’, not ‘fixed’ :) You can always write the wrong code if you want it enough. But hopefully a warning would have prompted someone to think harder about this flow.

But "let _ =" is already an explicit suppression of a must-use warning. Where does this arms race of "no, I really know what I am doing, compiler" versus "no, this really looks like a mistake, programmer" end?

I do feel like Rust did enough to allow software engineers and their managers to make an explicit choice here.

Re: We found a bug in the hyper HTTP library

#63
post #27

This would have been flagged by Clippy lints `let_underscore_untyped` or `let_underscore_must_use`, which sadly are not enabled by default.

Ehh, easy fix #[allow(clippy::let_underscore_untyped,clippy::let_underscore_must_use)] let _ = self.poll_flush(cx)?;

And this is why you should warn on `clippy::allow_attributes_without_reason` in your projects.

Re: We found a bug in the hyper HTTP library

#64
post #61

Would using Rust have prevented this?

No. Anyone expecting that hasn't read No Silver Bullet essay.

Actually I suspect that Rust is a Silver Bullet in that sense. That essay seems to be a case where people know of the essay but haven't read it. Normally in English a "Silver Bullet" is something much bigger, a panacea or cure all which entirely solves a problem but in his essay Brooks is talking about order-of-magnitude improvements, and that looks a lot like Rust.

Brooks was expecting such "Silver Bullet" improvements as often as every few decades, we're arguably overdue significantly. He cites Ada as an example of where such an improvement might come from, well, Rust isn't Ada but a lot of the same ideas about correctness are present.

Google reports order of magnitude changes from their Rust work for example.

Re: We found a bug in the hyper HTTP library

#65

Earlier quoted context omitted.

That's not even a bug. That's how TCP works. If you keep sending data to a socket the other side has closed, you get RST.

what is RST?

Connection "reset": https://en.wikipedia.org/wiki/Transmission_Control_Protocol#...

Re: We found a bug in the hyper HTTP library

#66
post #61

Earlier quoted context omitted.

No. Anyone expecting that hasn't read No Silver Bullet essay.

Actually I suspect that Rust is a Silver Bullet in that sense. That essay seems to be a case where people know of the essay but haven't read it. Normally in English a "Silver Bullet" is something much bigger, a panacea or cure all which entirely solves a problem but in his essay Brooks is talking about order-of-magnitude improvements, and that looks a lot like Rust. Brooks was expecting such "Silver Bullet" improveme…

Order of magnitude more complexity.

Re: We found a bug in the hyper HTTP library

#67

Earlier quoted context omitted.

Ehh, easy fix #[allow(clippy::let_underscore_untyped,clippy::let_underscore_must_use)] let _ = self.poll_flush(cx)?;

Yeah, but you must know about them and the possible bug first in order to allow them...

Not really. If I'm using a linter, I go and configure the strictest possible ruleset, and only disable rules when justified on a need-by-need basis. It's just a matter of discipline.

Re: We found a bug in the hyper HTTP library

#70
post #57

Earlier quoted context omitted.

Or just by not writing let _ =

All recurrent people problems are system problems.

As seen by the fact that forcing the programmer to write let _ = to silence the warning did not fix the bug.

You know what might've solved this though? Using threads instead of async

Post reply on HN