RFR(S) 8209950: SIGBUS in CodeHeapState::print_names()

Schmidt, Lutz lutz.schmidt at sap.com
Mon Aug 27 12:30:45 UTC 2018


Dear all, 

may I please request reviews for my change? It hardens code which iterates over all nmethods in the code cache, e.g. by CodeCache::nmethods_do(). The bug refers to an issue in share/code/codeHeapState.cpp, but the same code exists in share/runtime/sharedRuntime.cpp. SIGBUS/SIGSEGV errors have been observed recently for both locations. Holding the CodeCache_lock while iterating, as asserted by CodeCache::nmethods_do(), does not help. 

The solution is to check yet another pointer for NULL and accessibility before actually using it. Not-NULL but invalid pointers have been observed. That makes accessibility checks necessary. The calls to os::is_readable_pointer() are potentially expensive (if they fail), but the alternative would be a SIGBUS/SIGSEGV.

This fix extends JDK-8209588 for the sharedRuntime.cpp part. As noted there, it may have impact as far back as jdk9 (for sharedRuntime.cpp). 

Bug:    https://bugs.openjdk.java.net/browse/JDK-8209950 
Webrev: http://cr.openjdk.java.net/~lucy/webrevs/8209950.00/ 

Thank you, 
Lutz




More information about the hotspot-compiler-dev mailing list