Skip to content

Commit

Permalink
8278987: RunThese24H.java failed with EXCEPTION_ACCESS_VIOLATION in _…
Browse files Browse the repository at this point in the history
…_write_sample_info__

Backport-of: 713fbeb050a8f79d3a662106125c3f14f3952741
  • Loading branch information
Jaroslav Bachorik committed Jan 6, 2022
1 parent e54e3c4 commit 5ea822c
Showing 1 changed file with 3 additions and 9 deletions.
Expand Up @@ -202,7 +202,7 @@ static void prepare_for_resolution() {

static bool stack_trace_precondition(const ObjectSample* sample) {
assert(sample != NULL, "invariant");
return sample->has_stack_trace_id() && !sample->is_dead() && !sample->stacktrace().valid();
return sample->has_stack_trace_id() && !sample->is_dead();
}

class StackTraceBlobInstaller {
Expand Down Expand Up @@ -249,7 +249,7 @@ void StackTraceBlobInstaller::install(ObjectSample* sample) {
writer.write_type(TYPE_STACKTRACE);
writer.write_count(1);
ObjectSampleCheckpoint::write_stacktrace(stack_trace, writer);
blob = writer.move();
blob = writer.copy();
_cache.put(sample, blob);
sample->set_stacktrace(blob);
}
Expand Down Expand Up @@ -278,7 +278,7 @@ void ObjectSampleCheckpoint::on_rotation(const ObjectSampler* sampler) {
}

static bool is_klass_unloaded(traceid klass_id) {
assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
assert(ClassLoaderDataGraph_lock->owned_by_self(), "invariant");
return JfrKlassUnloading::is_unloaded(klass_id);
}

Expand Down Expand Up @@ -381,12 +381,6 @@ void ObjectSampleCheckpoint::write(const ObjectSampler* sampler, EdgeStore* edge
assert(sampler != NULL, "invariant");
assert(edge_store != NULL, "invariant");
assert(thread != NULL, "invariant");
{
// First install stacktrace blobs for the most recently added candidates.
MutexLocker lock(SafepointSynchronize::is_at_safepoint() ? nullptr : ClassLoaderDataGraph_lock);
// the lock is needed to ensure the unload lists do not grow in the middle of inspection.
install_stack_traces(sampler);
}
write_sample_blobs(sampler, emit_all, thread);
// write reference chains
if (!edge_store->is_empty()) {
Expand Down

1 comment on commit 5ea822c

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.