Skip to content
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

Swap tracing buffers for blocked threads #297

merged 3 commits into from Jun 3, 2019


2 participants
Copy link

commented May 28, 2019

The forced swapping of buffers deadlocks when it encounters threads that are blocked in Java synchronization mechanisms.

This should be handled explicitly, by marking the threads, I think.

However, for the moment, we can actually check whether the thread is parked, i.e., blocked.
Unclear whether this includes all threads though.

@daumayr what do you think of this change?

smarr added some commits May 28, 2019

Swap tracing buffer for blocked threads
This is a best effort for threads blocked in Java synchronization mechanisms.

We may still miss other threads causing a deadlock.
So, it’s a work around, and should be managed explicitly instead.

Signed-off-by: Stefan Marr <>
Name TraceWorkerThread
Signed-off-by: Stefan Marr <>
Updated VSCode build tasks to version 2.0
Signed-off-by: Stefan Marr <>

@smarr smarr added the bug label May 28, 2019

@smarr smarr added this to the v0.7.0 milestone May 28, 2019

@smarr smarr self-assigned this May 28, 2019


This comment has been minimized.

Copy link

commented Jun 3, 2019

Changes look good, was this a problem with breakpoint suspension?


This comment has been minimized.

Copy link
Owner Author

commented Jun 3, 2019

Yes, when hitting a breakpoint, we force-swap the buffers, to be able to update the visualization, and then that thread waits for the buffers to be swapped, which does not happen for threads blocked in java synchronization -> deadlock. Or well, probably a livelock actually (because the loop still goes over all threads again and again.

Took me a while to realize that.

@smarr smarr merged commit d92e50e into dev Jun 3, 2019

4 checks passed

ci/gitlab/ Pipeline passed on GitLab
continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed
coverage/coveralls Coverage remained the same at 76.582%

@smarr smarr deleted the swap-tracing-buffers-for-blocked-threads branch Jun 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.