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

Vladimir Kozlov vladimir.kozlov at oracle.com
Tue Aug 28 19:51:26 UTC 2018


Hi Lutz,

Thank you for looking on this. Changes are fine but I think you introduce a new function to fold 
these set of checks since they become so similar.  I am not shere your concern about 
os::is_readable_pointer() expense. Both places you fixed are not performance critical.

Thanks,
Vladimir

On 8/27/18 5:30 AM, Schmidt, Lutz wrote:
> 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