-
Notifications
You must be signed in to change notification settings - Fork 22
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 when using RefCell with large array #128
Comments
This appears to be a stack overflow. Replacing As for your observations about these different types, my guess is that, even without |
So the RefCell is probably being allocated on the stack and not in the data region of the executable? |
Yes, my understanding is that the |
Interesting, I see a similar issue here (rust-lang/rust#99111), although this did the same thing for normal arrays too. Thanks for your help! |
I was experimenting with the root server example and ran into an issue when using a large array within a RefCell.
A minimal example can be seen below
which produces the following output:
Examining the mentioned address doesn't reveal anything obvious. Using a smaller array (10_000) inside the RefCell stops it from crashing. Changing the code to use a raw array ([i32; 100_000]) instead of a RefCell also fixes the problem, and its size can be further increased to 1_000_000 without any issues. The problem also occurs when using a Cell instead of a RefCell, but does not occur when using the custom struct below.
The text was updated successfully, but these errors were encountered: