Skip to content

Commit 713fbeb

Browse files
author
Markus Grönlund
committed
8278987: RunThese24H.java failed with EXCEPTION_ACCESS_VIOLATION in __write_sample_info__
Reviewed-by: jbachorik
1 parent 7341439 commit 713fbeb

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ static void prepare_for_resolution() {
202202

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

208208
class StackTraceBlobInstaller {
@@ -249,7 +249,7 @@ void StackTraceBlobInstaller::install(ObjectSample* sample) {
249249
writer.write_type(TYPE_STACKTRACE);
250250
writer.write_count(1);
251251
ObjectSampleCheckpoint::write_stacktrace(stack_trace, writer);
252-
blob = writer.move();
252+
blob = writer.copy();
253253
_cache.put(sample, blob);
254254
sample->set_stacktrace(blob);
255255
}
@@ -278,7 +278,7 @@ void ObjectSampleCheckpoint::on_rotation(const ObjectSampler* sampler) {
278278
}
279279

280280
static bool is_klass_unloaded(traceid klass_id) {
281-
assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
281+
assert(ClassLoaderDataGraph_lock->owned_by_self(), "invariant");
282282
return JfrKlassUnloading::is_unloaded(klass_id);
283283
}
284284

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

0 commit comments

Comments
 (0)