-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Huge stack arrays cause stack overflow with segmentation fault #40862
Comments
Well this is very unfortunate. But how does this affect boxed values like |
In debug mode, the array is still built on the stack, then moved to the In release mode, I think this will sometimes correctly avoid the stack allocation. In the mean time, you are encouraged to use fn main() {
vec![0u8; 1 << 24].into_boxed_slice();
} |
From a relevant Stack Overflow question:
|
I believe this has since been fixed now that stack probes are implemented, so closing. |
I noticed a 4MB stack allocated buffer within a thread causes the thread to panic.
In the main it takes 8MB to crash on amd64: Run on play
The strange part is, even when I box it, it still segfaults: Run on Play
Am I using the Box wrong? Why does it SEGV at all? In my understanding allocating 8MB at once is not such a big deal anymore.
The text was updated successfully, but these errors were encountered: