-
Notifications
You must be signed in to change notification settings - Fork 568
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
detach is *very slow* if tool is heavyweight and spending a lot of time in C code #2036
Comments
It turns out this is not related to the trace buffer writes, at least for this test. The writes should exit with EINTR and an error message (b/c DR deliberately does not use SA_RESTART), which is not happening. The SIGUSR2s are arriving in dynamorio_syscall:
This implies it's a burst of new bb's on the thread exit path:
Later it's making bb's in start_thread+270. But why isn't it hitting the someone's-waiting-for-me spot in dispatch? Answer: b/c that code is ifdef WINDOWS!!!!!!!! After the fix we have just one failure to synch with each thread. |
Xref #95
I made a test of drmemtrace doing a bursty trace with 10 threads. 9 are
busy writing traces. The 1 thread trying to synch them ends up waiting 10+
seconds b/c they're spending all their time in the clean call writing to
disk which is not a safe spot to xl8.
Probably the only solution is to truncate the final buffer writes.
Plus, there may not be any automated way w/o tool cooperation.
DR has to be safe and not interrupt tool code it knows nothing about.
So maybe there should be a "detach" event and the tool sets a flag? Or a
DR API routine to query "am I detaching".
Then we make the tracer interrupt its writes (no SA_RESTART -- hmm DR is not passing that today: xref #1145) and not continue if detaching.
The text was updated successfully, but these errors were encountered: