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
crash in capacity overflow
on SequentialReader in vec alloc
#252
Comments
Open questions
I'm not familiar with the code (yet) so have these investigations as next steps... if folks know what's going on, or pointers/suggestions, do comment here :) |
Do you know anything new? |
@harryhaaren To answer your questions...
In the drop of This reading is done with an allocated The I guess because the other reader could be used later again, the I've provided a fix above, you could try to test it under your conditions. You might also be interested in #232 to stop OOM possibility in headers. Next to this I've not found any cause why there should be a |
Replaced the
fn drop(&mut self) {
if self.size == 0 {
return;
}
let mut buf = &mut [0u8; 256][..];
if self.size < 256 {
buf = &mut buf[..self.size];
} |
Thanks!
Aha; I've ported the site to Hyper, using Tokio etc now. Bigger picture, the goal of the codebase is to learn "hands on" rust networking in the real-world, so porting from threaded -> async was always a learning-goal. Thanks for the responses; and building the library, it was a pleasure to use and get "raw" HTTP with Rust! Regards, -Harry |
If the requests are ok most of the time, then a 256 byte array should be faster. test stack_buf_128 ... bench: 2,520,140 ns/iter (+/- 175,758) test stack_buf_192 ... bench: 2,429,559 ns/iter (+/- 145,934) test stack_buf_256 ... bench: 2,368,500 ns/iter (+/- 77,421) test stack_buf_384 ... bench: 5,179,250 ns/iter (+/- 171,965) test stack_buf_512 ... bench: 5,457,417 ns/iter (+/- 219,768) test vec_128 ... bench: 10,220,704 ns/iter (+/- 317,712) test vec_192 ... bench: 10,855,938 ns/iter (+/- 407,135) test vec_256 ... bench: 10,921,623 ns/iter (+/- 782,854) test vec_384 ... bench: 10,206,575 ns/iter (+/- 363,215) test vec_512 ... bench: 10,810,583 ns/iter (+/- 255,277) test vec_stack_buf_128 ... bench: 6,190,262 ns/iter (+/- 172,463) test vec_stack_buf_192 ... bench: 7,972,014 ns/iter (+/- 279,520) test vec_stack_buf_256 ... bench: 6,722,798 ns/iter (+/- 308,850) test vec_stack_buf_384 ... bench: 6,945,378 ns/iter (+/- 289,744) test vec_stack_buf_512 ... bench: 6,915,483 ns/iter (+/- 301,180)
Hi All,
I'm seeing a crashing issue after a few days of serving pages successfully. I'm not sure what the incoming request is (if there is one specific one is also unkown..) it seems like an out-of-memory "OOM" type issue, but the
capacity-overflow
error, which also seems to occur when.collect()
is called on an infinite iterator (user-lang bug report & related discussion).A similar issue seems to have occurred in
rust-analyzer
at some point but I'm not sure if/how that solution applies to thetiny-http
codebase.I've added a
std::env::set_var()
call to set theRUST_BACKTRACE=full
for the program, which gives the below stack-trace for indicating where things are going wrong (as suggested in the discussion here)Thoughts or input appreciated; this is for a toy website but I'd like to understand/fix it.
The text was updated successfully, but these errors were encountered: