-
Notifications
You must be signed in to change notification settings - Fork 13.3k
SIGILL Illegal instrucion on Vec::reserve(2^32+1) #19426
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
Comments
CC me |
Rust handles out-of-memory by aborting like this. |
Oh yeah, I guess you would need like 16-32 gigs of ram in a 64-bit machine on most OSes to successfully complete that reserve (which asks for an 8GB array)? |
It will work if you enable full overcommit, but not by default on Linux. |
It asks for 4GB+1B. A malloc in C of 4GB+1B works perfectly fine, cause it is just a request for memory to the kernel and not an actual usage of this memory. to the best of my knowledge in C on Linux one would have to write at each allocated page to actual consume those 4GB+1B. |
@payload If you want 4GB + 1B use reserve_exact. reserve rounds allocations for amortization. |
Admittedly, we could maybe make Also note that Rust uses its own instance of jemalloc, and not the system allocator. |
Linux supports full overcommit and virtual memory accounting but doesn't use either by default. It defaults to overcommit with heuristics returning allocation errors in some cases. |
on 64bit machine, compiled for 64bit. test case:
likely related: #18726
The text was updated successfully, but these errors were encountered: