Skip to content

Commit

Permalink
8276333: jdk/jfr/event/oldobject/TestLargeRootSet.java failed "assert…
Browse files Browse the repository at this point in the history
…(!contains(edge->reference())) failed: invariant"

Reviewed-by: egahlin
  • Loading branch information
Markus Grönlund committed Mar 8, 2022
1 parent e607287 commit 65ca0a5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
19 changes: 9 additions & 10 deletions src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,23 @@ void DFSClosure::closure_impl(UnifiedOopRef reference, const oop pointee) {
if (GranularTimer::is_finished()) {
return;
}

if (_depth == 0 && _ignore_root_set) {
// Root set is already marked, but we want
// to continue, so skip is_marked check.
assert(_mark_bits->is_marked(pointee), "invariant");
} else {
_reference_stack[_depth] = reference;
} else {
if (_mark_bits->is_marked(pointee)) {
return;
}
_mark_bits->mark_obj(pointee);
_reference_stack[_depth] = reference;
// is the pointee a sample object?
if (pointee->mark().is_marked()) {
add_chain();
}
}
_reference_stack[_depth] = reference;
_mark_bits->mark_obj(pointee);
assert(_mark_bits->is_marked(pointee), "invariant");

// is the pointee a sample object?
if (pointee->mark().is_marked()) {
add_chain();
}

assert(_max_depth >= 1, "invariant");
if (_depth < _max_depth - 1) {
_depth++;
Expand Down
15 changes: 13 additions & 2 deletions src/hotspot/share/jfr/leakprofiler/chains/edgeStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,15 @@ static int leak_context_edge_idx(const ObjectSample* sample) {
}

bool EdgeStore::has_leak_context(const ObjectSample* sample) const {
return leak_context_edge_idx(sample) != 0;
const int idx = leak_context_edge_idx(sample);
if (idx == 0) {
return false;
}
assert(idx > 0, "invariant");
assert(_leak_context_edges != nullptr, "invariant");
assert(idx < _leak_context_edges->length(), "invariant");
assert(_leak_context_edges->at(idx) != nullptr, "invariant");
return true;
}

const StoredEdge* EdgeStore::get(const ObjectSample* sample) const {
Expand All @@ -243,7 +251,10 @@ const StoredEdge* EdgeStore::get(const ObjectSample* sample) const {
assert(SafepointSynchronize::is_at_safepoint(), "invariant");
const int idx = leak_context_edge_idx(sample);
if (idx > 0) {
return _leak_context_edges->at(idx);
assert(idx < _leak_context_edges->length(), "invariant");
const StoredEdge* const edge =_leak_context_edges->at(idx);
assert(edge != nullptr, "invariant");
return edge;
}
}
return get(UnifiedOopRef::encode_in_native(sample->object_addr()));
Expand Down
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,6 @@ jdk/jfr/event/compiler/TestCodeSweeper.java 8225209 generic-
jdk/jfr/event/os/TestThreadContextSwitches.java 8247776 windows-all
jdk/jfr/startupargs/TestStartName.java 8214685 windows-x64
jdk/jfr/startupargs/TestStartDuration.java 8214685 windows-x64
jdk/jfr/event/oldobject/TestLargeRootSet.java 8276333 generic-x64
jdk/jfr/api/consumer/recordingstream/TestOnEvent.java 8255404 linux-x64
jdk/jfr/jvm/TestWaste.java 8282427 generic-all

Expand Down

3 comments on commit 65ca0a5

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rkennke
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev pr/1600

@openjdk
Copy link

@openjdk openjdk bot commented on 65ca0a5 Jul 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rkennke Could not automatically backport 65ca0a57 to openjdk/jdk17u-dev due to conflicts in the following files:

  • test/jdk/ProblemList.txt

Please fetch the appropriate branch/commit and manually resolve these conflicts by using the following commands in your personal fork of openjdk/jdk17u-dev. Note: these commands are just some suggestions and you can use other equivalent commands you know.

# Fetch the up-to-date version of the target branch
$ git fetch --no-tags https://git.openjdk.org/jdk17u-dev.git pr/1600:pr/1600

# Check out the target branch and create your own branch to backport
$ git checkout pr/1600
$ git checkout -b rkennke-backport-65ca0a57

# Fetch the commit you want to backport
$ git fetch --no-tags https://git.openjdk.org/jdk.git 65ca0a5776df229ee91f420585ca1e8f91e489c6

# Backport the commit
$ git cherry-pick --no-commit 65ca0a5776df229ee91f420585ca1e8f91e489c6
# Resolve conflicts now

# Commit the files you have modified
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport 65ca0a5776df229ee91f420585ca1e8f91e489c6'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk17u-dev with the title Backport 65ca0a5776df229ee91f420585ca1e8f91e489c6.

Please sign in to comment.