-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
rustc: sane handling for failed memory allocation #46865
Comments
"sane" is a pretty vague term - you're going to have to be more specific. How would a "proper error" be issued? What would the form of that error be? |
Something like "out of memory while ...", maybe "failed to allocate more pages", etc. |
It's not going to segfault, it's going to SIGILL, and it'll print
|
I've observed segfaults w/o any further messages while compiling Servo, right after vsize reached 4G limit. |
You may want to look at core dumps to see where those segfaults are coming from. |
I'd like for it to panic but I suppose that may not be possible. I'm currently running on Windows where exceeding memory doesn't appear to do anything except print the message "fatal runtime error: allocator memory exhausted" and continue running until the OS kills it. I'm guessing this may be because SIGILL isn't a thing on Windows. Notably when spawning multiple threads with rayon I see the "fatal runtime error: allocator memory exhausted" message printed from each thread. The process does not appear to be stopped at the point of the failure so I am not sure how best to debug the issue. Edit: After looking at implementation it seems to boil down to |
Triage: these semantics are currently on purpose, and adjustments to them involve a bunch of various RFCs. I don't think keeping this open in addition to those is particularly useful, so closing. |
Some standard library collections have a Most methods like We also have an accepted RFC for having some unspecified mechanism to turn the process abort into a panic. This is tracked at #43596. It’s possible this will end up resolved as “you can call
As far as I know none of the above applies when |
There should be a sane handling of failed memory allocation (eg. when virtual memory exhausted),
at least issue a proper error, instead of just segfaulting.
The text was updated successfully, but these errors were encountered: