-
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
Medium Array of Vecs cloned causes stack overflow but doesn't provide any details #111733
Comments
What is your The code as-written doesn't stack overflow on Linux, bumping the buffer size up to |
The backtrace to the crash:
The crash is here (I bumped the array size to 50000):
I think a large fraction of the problem here is that
I suspect the rest of the memory overhead comes from the fact that this I don't know how to solve this well. But I feel like it should be possible to write a |
I did make this better back in 52df055#diff-b83fad8dc170d433a4e4aaa27de41f508c1ec8e854326fe815d779e70338080a, but it still needs things like #111551 before it'll be properly better -- see specifically https://github.com/rust-lang/rust/pull/111551/files#diff-b83fad8dc170d433a4e4aaa27de41f508c1ec8e854326fe815d779e70338080a showing that letting LLVM get rid of another array-sized temporary. |
So IMO the fact that this crashes at all is already covered better elsewhere, and this is really just a diagnostic request. @rustbot label -T-libs |
One problem here is that it needs to return it. At the ABI level, for an array this long that'll be a pointer, which is great, but there's no way in the Rust code to get that pointer, so there's no way for the Rust code to write to it directly. Thus getting this to not use extra stack space fundamentally depends on either
|
Sure. |
I'm on windows |
#107634 landed for 1.69, so definitely check if it's better after an update -- in 1.68.2 it had an extra step of going through |
When I updated graded to |
Code
Current output
Desired output
Rationale and extra context
No response
Other cases
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: