-
Notifications
You must be signed in to change notification settings - Fork 601
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 + rr + libGLX __glDispatchInit prevent applications from starting #2746
Comments
Can you run with |
here's the log file |
the message If I then
|
Are you sure the tracee isn't busy waiting or something? The rr log doesn't show a futex call or anything just before the hang. What does /proc//status show for the tracee when it hangs |
well yes, it is busy within the futex, that's what the CPU profile shows - it's apparently repeatedly getting woken up and then tries to lock it again - it's on-cpu and burning one core. But that only happens when I try to use rr on a binary compiled with asan - not when I just run it as-is, or when I leave out either asan or rr or both :) Here's the
|
To make this more clear:
|
Ok, I misunderstood and thought this was a deadlock. |
If you Is it possible to |
|
Thanks. It's definitely the dynamic linker getting confused somehow (and then looping forever) |
Does running If not, try |
|
So we get
and then later
Which seems like a guaranteed recipe for sadness. This might be related to #2329 (comment). What version of ASAN are you using? |
I'm using the one provided by GCC v10.2.0, the SO version of libasan is 6.0.0 |
Any update here? What version of rr was that, and is it still reproducible with master? |
Hm I just updated
So... it doesn't hang anymore, but it doesn't work either. I'm now on |
That seems like an explicit check, what happens if you LD_PRELOAD the asan library before recording?
? |
Same problem:
|
Just to check: what does |
I also tested this:
|
Last check: bash # clean environment that can be closed afterwards
export LD_PRELOAD=/usr/lib/libasan.so.6
rr record ./a.out
exit |
Still no dice:
|
OK, but It looks like Lines 2067 to 2083 in 779040e
Lines 2192 to 2204 in 779040e
If you feel lucky you could run this through gdb and check what the issue is: LD_PRELOAD=/usr/lib/libasan.so.6 gdb --args rr record ./a.out
b RecordSession.cc:2069
b RecordSession.cc:2194
c
# and now stepping and inspecting the conditional stepping |
... actually it is obviously intended to work without LD_PRELOAD as the |
Hello, this PR #2892 contains patch 5a7d3dd that fixes it, if applied on top of current tip. A workaround might be to record with |
@milianw: That PR got merged now. So I guess this issue should now be again back to the pthread_mutex hang with current rr tip? |
with current rr master and GCC 11.1 and accompanying sanitizers, everything works as expected now many thanks! |
To reproduce:
according to perf, this is what happens:
I guess there's something fishy going on with asan and rr both trying to intercept pthread_mutex_lock here. Oddly enough, a simpler application with a normal mutex seems to work. So I guess it's also important that the mutex is locked from a global static that's called from dl_init in a library?
The text was updated successfully, but these errors were encountered: