-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
ASAN mode hangs on arm64 macOS #58503
Comments
Maybe related google/sanitizers#1331 google/sanitizers#703 google/sanitizers#379 On my Ubuntu ARM it does not hang, just slow: ASAN_OPTIONS=detect_leaks=0 time ./a.out ASAN_OPTIONS=detect_leaks=1 time ./a.out FYI @kstoimenov |
Thanks @vitalybuka for looking into this. I am not familiar with the issues linked, which are all quite old (?). Two follow up comments:
RE slow vs hang (ctrl+c for second test)
RE commits
|
Just curious: anything I can help? I rebuild the HEAD (from last Thursday) and still face the same issue. Thanks! |
I did bisect by compiling all commits from scratch (clean state for all commits) and identified 39db491957dcf095936d81bed89c2b4edae2a1e7 is the root cause for the problem I faced. Full list
This is the best I can help so far. @happyCoder92 and @vitalybuka Can you help? Thanks |
Thank you. With this info, issues mentioned above are likely irrelevant. Could you please try to: Also can you print, just in case, sp and callers_sp just before: |
Certainly, this is the diff based on commit 39db491 (not HEAD). Please see the output attached after that. I did not see the output related to the
This is the output
|
Is any difference with: -ptrace |
not familiar with this flag, how to pass it?
|
Sorry for typo, I meant to write -pthread |
Can you make sure it gets past |
@vitalybuka In Experiment 2 (with more printf inserted), seems it hangs at
Experiment 1
Output
Experiment 2With more clues available(I wish I can debug more to help but am new to codebase, sorry), then I added more printf to the code inside the
Output
|
We need to be careful after LockStuffAndStopTheWorld, Printf may dead lock and confuse. |
Thanks for the heads up. Do you have an example how to use Die? I can change the code and try again. |
@yln @kubamracek @danliew-apple Do you know someone who can take a look why apparently benign 39db491 breaks LSAN on OSX? |
From the log above "Milestone 2" is not reached at all. |
Got it @vitalybuka I removed majority of the Printf and narrowed down to this one
|
Could I ask for the output of " |
Thanks @kubamracek Here is the output of the hung process
|
Turns out SuspendedThreadsListMac::GetRegistersAndSP was accidentally overwriting other stack variables, and somehow that bug didn't trip on anything serious until Vitaly's recent change. https://reviews.llvm.org/D137292. |
Thanks for the quick fix! |
Thanks! |
@kubamracek just curious: has your fix got merged? if no, any ETA? Thanks |
Just merged. |
I sync to head and recompile LLVM every week.
Roughly, noticed this problem since last week on master branch. I tried to sync to head today and recompile. Hit the same issue
Repro is quite easy
main.c
clang -lm -std=c11 -fsanitize=address -g main.c # hang ASAN_OPTIONS=detect_leaks=1 ./a.out
clang -lm -std=c11 -fsanitize=address -g main.c # ok ./a.out
The text was updated successfully, but these errors were encountered: