Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
8234691: Potential double-free in ParallelSPCleanupTask constructor
Browse files Browse the repository at this point in the history
Prevent extraneous constructor call

Backport-of: f8f6984
  • Loading branch information
Olga Mikhaltsova authored and Yuri Nesterenko committed Mar 26, 2021
1 parent bda446b commit 9c3e6c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/hotspot/share/gc/shared/workgroup.hpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -323,6 +323,8 @@ class SubTasksDone: public CHeapObj<mtInternal> {
// Set all tasks to unclaimed.
void clear();

NONCOPYABLE(SubTasksDone);

public:
// Initializes "this" to a state in which there are "n" tasks to be
// processed, none of the which are originally claimed. The number of
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/safepoint.cpp
Expand Up @@ -561,7 +561,7 @@ class ParallelSPCleanupTask : public AbstractGangTask {
public:
ParallelSPCleanupTask(uint num_workers, DeflateMonitorCounters* counters) :
AbstractGangTask("Parallel Safepoint Cleanup"),
_subtasks(SubTasksDone(SafepointSynchronize::SAFEPOINT_CLEANUP_NUM_TASKS)),
_subtasks(SafepointSynchronize::SAFEPOINT_CLEANUP_NUM_TASKS),
_cleanup_threads_cl(ParallelSPCleanupThreadClosure(counters)),
_num_workers(num_workers),
_counters(counters) {}
Expand Down

1 comment on commit 9c3e6c0

@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.