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
ld64.lld.darwinnew unwind info is incorrect #47733
Comments
assigned to @int3 |
This is not a subtle bug after all. Exceptions just don't work at all: % cat throw.cc Works fine with ld64. |
ObjC exceptions also don't work: % cat throw.m (Also fine with ld64.) |
Yeah, the |
I see some LSDA / personality stuff landed. Is this expected to work now, or not yet? |
The simple examples work, but the CallWithEHFrameTest still fails. To be precise, when linking, we hit the "too many personalities for compact unwind to encode" error. Just to see what would happen, I turned that error into a warning, and then ran the resulting binary -- CatchExceptionHigher passes, but CatchExceptionLower fails. So we're not quite there yet. |
Figured it out :) https://reviews.llvm.org/D97245 |
Extended Description
…or at least subtly different from ld64.
Repro:
Download https://drive.google.com/file/d/1Gjrg4bQCv3uD9Ucqt4ZtroHrz5v0iCJX/view?resourcekey=0-f53UMW57gtrPlSis2sTjKg and unzip it
~/src/llvm-project/out/gn/bin/ld64.lld.darwinnew @response.txt
./base_unittests --gtest_filter='Exception'
Expected: All 3 tests pass
Actual: CallWithEHFrameTest.CatchExceptionHigher crashes.
If you remove --color-diagnostics from response.txt and link with regular
ld
, it passes.The source of the test is here: https://source.chromium.org/chromium/chromium/src/+/master:base/mac/call_with_eh_frame_unittest.mm;l=25?q=CatchExceptionHigher&ss=chromium
The implementation of CallWithEHFrame is here: https://source.chromium.org/chromium/chromium/src/+/master:base/mac/call_with_eh_frame_asm.S;bpv=1;bpt=0 It's assembly with a custom personality routine, so it's possible things are wrong in the code -- but it's been working for 5 years and it works with ld64. https://codereview.chromium.org/1212093002 has the motivation for that code.
The text was updated successfully, but these errors were encountered: