-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Segfault with stack overflow and nested exception handlers #28577
Comments
Segfault on stack overflow on mac is a known issue, I think. |
This is unrelated to the mac issue. It's sort of unclear though what is the correct thing to do if the user code tries this hard to break exception handling (the handler of the stack overflow also overflows the stack). The only thing that could be done better without a very different exception handling mechanism AFAICT is to detect this and give a better error message before quitting instead of a segfault... |
We discussed something similar in #25523. This seems a classic recursive function which floods each stack page. Putting a guard page that returns a
With this patch, Julia freezes with the example code, instead of segfaulting. |
It looks like the I guess if we did that, we'd potentially be able to fix this. Depends on whether we can ensure enough stack space to at least cleanly restore the next outer error handler?
Right. Though I would have though that would also result in a new SEGV -> signal handler And hence peeling off one frame each time until the handler runs correctly. Obviously I'm missing something or we wouldn't be seeing this problem. |
Oh yeah I didn't noticed that. Well function attributes are not documented very well, anyway it seems that LLVM guarantees that for if a function with the I will continue to check on that. |
…aLang#40068) Supported platforms are currently X86, PowerPC, and SystemZ. Fixes JuliaLang#25523 Fixes JuliaLang#36170 Closes JuliaLang#28577 Closes JuliaLang#30892
…aLang#40068) Supported platforms are currently X86, PowerPC, and SystemZ. Fixes JuliaLang#25523 Fixes JuliaLang#36170 Closes JuliaLang#28577 Closes JuliaLang#30892
…aLang#40068) Supported platforms are currently X86, PowerPC, and SystemZ. Fixes JuliaLang#25523 Fixes JuliaLang#36170 Closes JuliaLang#28577 Closes JuliaLang#30892
The following recursively nested exception handling causes a segfault on linux x86_64, with both julia 0.6 and julia 1.0. This seems to happen at the boundary of a stack overflow, as it's fine for all
n < 27542
on my system, and seems to segfault above that.This could be related to #17109, though running the first example code from that issue works fine for me.
To be clear, I didn't find this in real code - it's an intentional stress test for a WIP fix for #19979.
The text was updated successfully, but these errors were encountered: