# HG changeset patch # User gromero # Date 1553114629 14400 # Wed Mar 20 16:43:49 2019 -0400 # Node ID 56cc904f7ccc62847efd32054fc7a1318290633d # Parent 564043cbe13841c7605e52533f2bf743a59ea35b 8221175: Fix bad function case for controlled JVM crash on PPC64 big-endian Reviewed-by: diff --git a/src/hotspot/share/utilities/vmError.cpp b/src/hotspot/share/utilities/vmError.cpp --- a/src/hotspot/share/utilities/vmError.cpp +++ b/src/hotspot/share/utilities/vmError.cpp @@ -1725,7 +1725,14 @@ const char* const eol = os::line_separator(); const char* const msg = "this message should be truncated during formatting"; char * const dataPtr = NULL; // bad data pointer - const void (*funcPtr)(void) = (const void(*)()) 0xF; // bad function pointer + const void (*funcPtr)(void); // bad function pointer + +#if defined(PPC64) && !defined(ABI_ELFv2) + unsigned long function_descriptor[] = { 0xF /* function pointer */, 0x0, 0x0 }; + funcPtr = (const void(*)()) &function_descriptor; +#else + funcPtr = (const void(*)()) 0xF; +#endif // Keep this in sync with test/hotspot/jtreg/runtime/ErrorHandling/ErrorHandler.java // which tests cases 1 thru 13.