On Fri, 24 Sep 2021 13:13:39 GMT, Lin Zang <lz...@openjdk.org> wrote:

> The root cause for crash in ZGC is that the JNIHandles are processed before 
> object iteration. And ZGC would update the JNIHandles at object iteration 
> with read barrier. So the crash is cause by accessing the invalid address 
> which can be dummy info after zgc, and hence crash.
> 
> The lock rank issue can be fixed because the related mutexes are acquired in 
> safepoint. so the safepoint_check_required could be safepoint_check_always.
> 
> The Epsilon issue is caused by wrong _num_dumper_thread calculated when the 
> gang==NULL.

src/hotspot/share/services/heapDumper.cpp line 751:

> 749:   static void before_work() {
> 750:     assert(_lock == NULL, "ParDumpWriter lock must be initialized only 
> once");
> 751:     _lock = new (std::nothrow) PaddedMonitor(Mutex::leaf, 
> "ParallelHProfWriter_lock", Mutex::_safepoint_check_always);

If you change these locks to _safepoint_check_always, you have to acquire them 
without the Mutex::_no_safepoint_check flags so I don't know why you don't get 
that assert.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5681

Reply via email to