-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Cannot catch exceptions on Apple M1 #7541
Comments
This reminds me of https://sft.its.cern.ch/jira/browse/ROOT-8544 and https://sft.its.cern.ch/jira/browse/ROOT-8523 which is the end where fixed by a7b0b3e. Most likely the way the interpreter sets up the stack frames does not match the expectation of the exception handler (usually implemented in (g)libc). It is very plausible to be a problem similar to the one leading to the "can not reallocate code" errors. So I see two plausible path forward: (a) fix the reallocate code error and hopefully it also fix this (b) installed a debug version of (g)libc and trace/debug the exception handlers handling of this case ... |
Ugh, this one might become tricky, even LLVM upstream is unable to handle exceptions during JIT: I tested the most basic int main() {
try {
throw 1;
} catch (...) { }
} compiled with
It could be that Apple changed something about their exception handling ABI for |
I am not too surprised. it is the same code (+/- a few things ;)).
That is what it was last time (in JIT code the instructions space being allocated in an unexpected order). |
True, but I had hoped that it was fixed in current trunk and it was just a matter of finding and backporting a change or two to make it work. Anyway my investigations aren't going anywhere right now, so I've filed a bug at https://bugs.llvm.org/show_bug.cgi?id=49692 |
Bad news for us, from Lang on https://bugs.llvm.org/show_bug.cgi?id=49692 :
I guess disabling exceptions for M1 isn't an option either. But we could prevent the cling |
As llvm JIT cannot catch exceptions on Apple M1 (see root-project#7541) cling should throw less. This is a hack to reduce the impact a bit.
As llvm JIT cannot catch exceptions on Apple M1 (see #7541) cling should throw less. This is a hack to reduce the impact a bit.
As llvm JIT cannot catch exceptions on Apple M1 (see root-project#7541) cling should throw less. This is a hack to reduce the impact a bit. (cherry picked from commit f7a3eeb)
As llvm JIT cannot catch exceptions on Apple M1 (see root-project/root#7541) cling should throw less. This is a hack to reduce the impact a bit.
As ROOT cannot catch JITted exceptions on Apple Silicon (see the bug report root-project#7541 for context), some tests are currently failing there due to the use of exceptions in the compatibility code for RDataSource. Implement this with a boolean flag and a pattern inspired by errno.
As ROOT cannot catch JITted exceptions on Apple Silicon (see the bug report root-project#7541 for context), some tests are currently failing there due to the use of exceptions in the compatibility code for RDataSource. Implement this with a boolean flag and a pattern inspired by errno.
As ROOT cannot catch JITted exceptions on Apple Silicon (see the bug report #7541 for context), some tests are currently failing there due to the use of exceptions in the compatibility code for RDataSource. Implement this with a boolean flag and a pattern inspired by errno.
After LLVM switched from Bugzilla to GitHub issues, here is the link to the migrated issue: llvm/llvm-project#49036 |
See root-project#7541 for details. Closes root-project#7744
See root-project/root#7541 for details. Closes #7744
See root-project#7541 for details. Closes root-project#7744
See root-project#7541 for details. Closes root-project#10548
See root-project#7541 for details. Closes root-project#10548
@msneubauer ran some tests on OSX 13 and it seems this issue is fixed. Thanks a lot, Mark! Here is what he ran:
This is based on a source build of the root_v6.26.06.source.tar.gz tarball. |
Hm, this is surprising because fixing |
Our best chance is @msneubauer I think. |
$ cat test_exceptions.C $ root.exe -l -b -q -e '.x test_exceptions.C' got here |
Awesome, @hahnjo can we close this as resolved now? |
Possibly for now. Though I wouldn't be too surprised if it breaks again on a future LLVM upgrade (maybe even llvm13) due to the missing things in LLVM and what Lang wrote in the upstream issue... |
Before we close this I'd like to see the roottest / gtest tests re-enabled that were disabled because of this issue. I cannot find a registry of the changes we did because of this; do we need to grep for |
This recent roottest failure looks related to this issue https://lcgapp-services.cern.ch/root-jenkins/job/roottest-pullrequests-build/13090/testReport/projectroot.roottest.python/regression/roottest_python_regression_regression/ (it's a test that was never run before, I am resurrecting it, and that's why the failure was triggered only now) |
@hahnjo, @vepadulano, what's the status here? This looks like one of these issues that might have been resolved by the recent LLVM upgrade |
I just built a fresh version of |
I confirm it's still broken for llvm16 in root master. |
Are you using the |
Describe the bug
It's not possible to catch exceptions in the interactive
root
prompt on Apple Silicon, nor doesTRint
take care of uncaught exceptions.Expected behavior
The user should be able to catch exceptions, or at least the fallback handler should prevent process termination.
To Reproduce
The most simple examples are
and
(which should be handled in
TRint::HandleTermInput()
).Setup
ROOT 6.25/01 on
macphsft25
Additional context
Plenty:
Edit:
Same in 6.22/07, tested on
macphsft24
The text was updated successfully, but these errors were encountered: