[Fix #149] DTFJ/OpenJ9 system dumps: mark all alive threads as GC roots - #150
Merged
Conversation
…s as GC roots Signed-off-by: Kevin Grigorenko <kevin.grigorenko@us.ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pending eclipse-openj9/openj9#23137
There were a bunch of different ways to solve this. I chose the most surgical and conservative: Iterate through all threads and remember any that are
JavaThread.STATE_ALIVE. Then, when processing the GC roots of theJavaRuntime, if we find a thread there, ignore the GC root reachability (in one example dump demonstrating this issue,WEAK), and set the reachability toREACHABILITY_STRONGand the type of root toTHREAD_OBJ. No other significant changes although the diff shows a lot due to spacing changes because sometry/catchblocks and initialization had to be moved around to make the most surgical change. All local tests pass. This change only impacts DTFJ and OpenJ9 system dumps, so I'll commit directly but open to feedback.Fixes #149