JDK-8251383 : Disable Event::log from linux_mprotect when processing the assertion poison page
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11,12,13,14,15,16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • Submitted: 2020-08-11
  • Updated: 2020-08-17
  • Resolved: 2020-08-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16 b11Fixed
Related Reports
Relates :  
Description
When the assertion poison page is enabled (Linux only and on by default) the signal handler will call os::protect_memory to change the page protection bits. That will call linux_mprotect which will call 

Events::log(NULL, "Protecting memory [" INTPTR_FORMAT "," INTPTR_FORMAT "] with protection modes %x", p2i(bottom), p2i(bottom+size), prot);

Event logging in turn can use Mutexes and other VM facilities - all of which are now being executed in a signal handling context (which is inherently unsafe). It also means that there cannot be any other failing assertions on that path as you will re-trigger the poison page pagefault. Hence, as happened to me, a failing assertion in the mutex code triggers this problem.

The issue can be worked-around by setting -XX:-ShowRegistersOnAssert (once you realise what is happening).

The simple fix is to skip the logging if the faulting address is the poison page address.

This only affects debug builds of course.
Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/5f7ee46d2e1d User: dholmes Date: 2020-08-12 00:06:58 +0000
12-08-2020

ILW = MLM = P4
11-08-2020