-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
runtime error regardless of stack size in spawn_stack #11696
Comments
Are you replacing |
I replace |
This is because we implement a "red zone" of stack at then end of a green thread's stack, and the red zone has size 20K. The thread is considered to have overflowed its stack once it enters the red zone. Obviously it's bad that the entire stack is considered the red zone. I'm nominating this because I think this warrants discussion about what to do in this situation. The red zone allows Decisions, decisions... |
our documentation regarding minimum stack sizes and the relationship of requested stack size versus the actual allocated stack size may need some help. But more importantly, the bug described here does not quite match up with the diagnosis acrichto provided. Need to do a little more investigation. Not accepting for milestone for now. |
assigning P-low. |
This was fixed by b02b5cd, and has tests checked in. The original code in the gist actually failed for reasons unrelated to stack size. When attempting to block on a channel, a local task is required (and none was found), triggering the assertion. |
…, r=xFrednet [`iter_without_into_iter`]: fix papercuts in suggestion and restrict linting to exported types See rust-lang#11692 for more context. tldr: the lint `iter_without_into_iter` has suggestions that don't compile, which imo isn't that problematic because it does have the appropriate `Applicability` that tells external tools that it shouldn't be auto-applied. However there were some obvious "errors" in the suggestion that really should've been included in my initial PR adding the lint, which is fixed by this PR: - `IntoIterator::into_iter` needs a `self` argument. - `IntoIterator::Iter` associated type doesn't exist. This should've just been `Item`. This still doesn't make it machine applicable, and the remaining things are imho quite non-trivial to implement, as I've explained in rust-lang/rust-clippy#11692 (comment). I personally think it's fine to leave it there and let the user change the remaining errors when copy-pasting the suggestion (e.g. errors caused by lifetimes that were permitted in fn return-position but are not in associated types). This is how many of our other lint suggestions already work. Also, we now restrict linting to only exported types. This required moving basically all of the tests around since they were previously in the `main` function. Same for `into_iter_without_iter`. The git diff is a bit useless here... changelog: [`iter_without_into_iter`]: fix papercuts in suggestion and restrict linting to exported types (cc `@lopopolo,` figured I should mention you since you created the issue)
This program triggers runtime error regardless of StackSize (16kB is lowest possible on pthreads):
https://gist.github.com/8533006
"fatal runtime error: assertion failed: !ptr.is_null()" + easter egg
I tried with stack sizes from 16kB up to 128MB, and all fail in same assertion.
When I replace "std::rt::thread::Thread::spawn_stack(StackSize)" with "spawn" runtime error is not triggered.
The text was updated successfully, but these errors were encountered: