-
Notifications
You must be signed in to change notification settings - Fork 11.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
[rtsan] Restrict arches and disable android #98268
[rtsan] Restrict arches and disable android #98268
Conversation
I am signing off for the night here in a sec, back on tomorrow morning to monitor for more failures and issues. If someone has a better idea than "disable all architectures" it seems like everything is working on all these archs, except for powerpc is failing to discover gtests. I don't know if we should go conservative (disable everything) or if we have a more precise solution to this problem. This review is the "big hammer" |
Alright, I think there is still something fishy going on. There are some errors coming to my inbox that look like this:
Anyone have any bright ideas as to why on some systems these tests would be non-discoverable? Digging into it now, but open to any theories Here is a representative build showing the problem: |
Is there any better way of troubleshooting issues like this? (on less common archs, different OS's that I don't commonly have access to). The approach of "submit something, and see what blows up, then respond ASAP to fix it" is more reactive than proactive. Any advice appreciated, I apologize for the newbie mistakes, still getting my sea legs under me in LLVM world. |
Alright, I cannot reproduce on my ubuntu docker image, nor my MacOS laptop. Any guidance appreciated on how to more reasonably reproduce and test changes. (Or any specific theories on why gtest discovery may be grumpy on some systems) I have brought the other RTSan codeowner @davidtrevelyan up to speed on everything going on. I am traveling for the next few days, so I'll have spotty availability. Please ping both of us on an issue if you want it to be visible as soon as possible. Thank you all, especially @vitalybuka for your patience hanging in there through these growing pains. |
LGTM |
1 Failure so far from the build bot. CC @davidtrevelyan , I'm disappearing for my trip very soon
|
I'm trying to stabilize one of my bots (https://lab.llvm.org/buildbot/#/builders/174) and while testing the ToT offline, I am seeing this test fail as well on it. It was previously failing last night until the RTSAN feature was disabled. The failures since then are unrelated MemProfiler tests that are failing that I am trying to get fixed, but just wanted to give you a heads up that I am also seeing the failure on my bot. |
I see the failure as well in my private builders (aarch64-ubuntu and x86_64-ubuntu). |
If someone has a reproducible way to get it, and can propose a fix we would be eternally grateful! We have yet to see it on our local builds. |
My bot is a fairly standard Ubuntu 20.04 x86_64 machine. Do you have a similarly setup machine? Running the cmake and build commands might work to try and reproduce the issue. |
Hi @cjappl - would you be able to revert this change while digging into it? We are seeing this error on our x64/arm64 clang builders as well: |
Taking a quick look at my bot, trying to run the unittest binary immediately results in a segfault:
This seems to explain why we see this output. From llvm/utils/lit/lit/formats/googletest.py, there is this comment on line 126:
|
I haven't actually bisected, but I suppose this caused this new bustage when building compiler-rt for Windows targets:
|
Sorry, RTLSanCommon is mine and unrelated. Should be fixed unready |
Reverted. Could anyone show me the command line of linking the unittest with |
Many thanks @chapuni for your help on this. My link command was generated by cmake and is as follows (I added the extra flags you suggested manually at the end): cd /host/build_ubuntu/projects/compiler-rt/lib/rtsan/tests && ../../../../../bin/clang++ RtsanNoInstTestObjects.rtsan_preinit.cpp.aarch64.o RtsanNoInstTestObjects.rtsan_test_context.cpp.aarch64.o RtsanNoInstTestObjects.rtsan_test_main.cpp.aarch64.o RtsanNoInstTestObjects.gtest-all.cc.aarch64.o RtsanNoInstTestObjects.gmock-all.cc.aarch64.o /host/build_ubuntu/projects/compiler-rt/lib/rtsan/tests/libRTRtsanTest.aarch64.a -o /host/build_ubuntu/projects/compiler-rt/lib/rtsan/tests/./Rtsan-aarch64-NoInstTest -resource-dir=/host/build_ubuntu/./lib/../lib/clang/19 -Wl,-rpath,/host/build_ubuntu/./lib/../lib/clang/19/lib/aarch64-unknown-linux-gnu -lstdc++ -no-pie -ldl -lrt -lm -pthread -march=armv8-a -v -Wl,-v I get the following output: clang version 19.0.0git
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /host/build_ubuntu/bin
Found candidate GCC installation: /usr/lib/gcc/aarch64-linux-gnu/13
Selected GCC installation: /usr/lib/gcc/aarch64-linux-gnu/13
Candidate multilib: .;@m64
Selected multilib: .;@m64
"/usr/bin/ld" -EL -z relro --hash-style=gnu --eh-frame-hdr -m aarch64linux -dynamic-linker /lib/ld-linux-aarch64.so.1 -o /host/build_ubuntu/projects/compiler-rt/lib/rtsan/tests/./Rtsan-aarch64-NoInstTest /lib/aarch64-linux-gnu/crt1.o /lib/aarch64-linux-gnu/crti.o /usr/lib/gcc/aarch64-linux-gnu/13/crtbegin.o -L/host/build_ubuntu/./lib/../lib/clang/19/lib/aarch64-unknown-linux-gnu -L/usr/lib/gcc/aarch64-linux-gnu/13 -L/lib/aarch64-linux-gnu -L/usr/lib/aarch64-linux-gnu -L/lib -L/usr/lib RtsanNoInstTestObjects.rtsan_preinit.cpp.aarch64.o RtsanNoInstTestObjects.rtsan_test_context.cpp.aarch64.o RtsanNoInstTestObjects.rtsan_test_main.cpp.aarch64.o RtsanNoInstTestObjects.gtest-all.cc.aarch64.o RtsanNoInstTestObjects.gmock-all.cc.aarch64.o /host/build_ubuntu/projects/compiler-rt/lib/rtsan/tests/libRTRtsanTest.aarch64.a -rpath /host/build_ubuntu/./lib/../lib/clang/19/lib/aarch64-unknown-linux-gnu -lstdc++ -ldl -lrt -lm -v -lstdc++ -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc /usr/lib/gcc/aarch64-linux-gnu/13/crtend.o /lib/aarch64-linux-gnu/crtn.o
GNU ld (GNU Binutils for Ubuntu) 2.42 and the |
A quick update:
Has anyone seen this sort of thing before? Here's my backtrace for reference:
|
@cjappl and I have drafted a fix for this, see above! Seems like |
Follow on to llvm#92460 (reporting old android builds failing) and llvm#98264 (powerpc failing to discover gtests). Getting back to stability by getting back down to a very basic set of supported arches and OS's. In the future if there is demand we can build it back up. Especially when I understand how to test these systems, or have people who want to do the work on them. --------- Co-authored-by: David Trevelyan <david.trevelyan@gmail.com>
Still fails after llvm#98268
…it to avoid segfault in dlsym (#98679) Follows #98268 with a fix for a segfault during preinit on `ubuntu:20.04` environments. Previously, `rtsan` was not handling the situation where `dlsym` calls `calloc` during the interceptors initialization, resulting in a call to a function at a null address. @cjappl and I took inspiration from the solution in `nsan`, but we re-used the sanitizer internal allocator instead of our own static buffer. This PR also re-enables the existing non-instrumented `rtsan` tests for `x86_64` and `arm64` architectures. --------- Co-authored-by: Chris Apple <cja-private@pm.me>
…it to avoid segfault in dlsym (llvm#98679) Follows llvm#98268 with a fix for a segfault during preinit on `ubuntu:20.04` environments. Previously, `rtsan` was not handling the situation where `dlsym` calls `calloc` during the interceptors initialization, resulting in a call to a function at a null address. @cjappl and I took inspiration from the solution in `nsan`, but we re-used the sanitizer internal allocator instead of our own static buffer. This PR also re-enables the existing non-instrumented `rtsan` tests for `x86_64` and `arm64` architectures. --------- Co-authored-by: Chris Apple <cja-private@pm.me>
…it to avoid segfault in dlsym (#98679) Summary: Follows #98268 with a fix for a segfault during preinit on `ubuntu:20.04` environments. Previously, `rtsan` was not handling the situation where `dlsym` calls `calloc` during the interceptors initialization, resulting in a call to a function at a null address. @cjappl and I took inspiration from the solution in `nsan`, but we re-used the sanitizer internal allocator instead of our own static buffer. This PR also re-enables the existing non-instrumented `rtsan` tests for `x86_64` and `arm64` architectures. --------- Co-authored-by: Chris Apple <cja-private@pm.me> Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60251347
Follow on to #92460 (reporting old android builds failing) and #98264 (powerpc failing to discover gtests).
Getting back to stability by getting back down to a very basic set of supported arches and OS's. In the future if there is demand we can build it back up. Especially when I understand how to test these systems, or have people who want to do the work on them.