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
merged 3 commits into from
Jun 3, 2019

Conversation

smarr
Copy link
Owner

@smarr smarr 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 3 commits May 28, 2019 23:17
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 <git@stefan-marr.de>
Signed-off-by: Stefan Marr <git@stefan-marr.de>
Signed-off-by: Stefan Marr <git@stefan-marr.de>
@smarr smarr added the bug Fixes an issue, incorrect implementation 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
@daumayr
Copy link
Contributor

daumayr commented Jun 3, 2019

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

@smarr
Copy link
Owner Author

smarr 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
@smarr smarr deleted the swap-tracing-buffers-for-blocked-threads branch June 3, 2019 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes an issue, incorrect implementation
Projects
No open projects
MetaConc
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

2 participants