JDK-8155522 : corrupted C heap with -XX:+UseSHA on TestUseSHA1IntrinsicsOptionOnUnsupportedCPU
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P2
  • Status: Resolved
  • Resolution: Duplicate
  • OS: windows
  • CPU: x86
  • Submitted: 2016-04-27
  • Updated: 2016-06-15
  • Resolved: 2016-06-15
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 9
9Resolved
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Description
Test prints message "Java HotSpot(TM) Server VM warning: SHA instructions are not available on this CPU" (I think as expected), but then crashes with:

C heap has been corrupted (time: 1 allocations)
corrupted block near address 0x6e8828, length 48
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=c:/jprt/T/P1/135841.ppunegov/s/hotspot/src/os/windows/vm/os_windows.cpp:5253
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (c:/jprt/T/P1/135841.ppunegov/s/hotspot/src/os/windows/vm/os_windows.cpp:5253), pid=21476, tid=32124
#  fatal error: corrupted C heap
#
# JRE version: Java(TM) SE Runtime Environment (9.0) (fastdebug build 9-internal+0-2016-04-26-135841.ppunegov.8155092)
# Java VM: Java HotSpot(TM) Server VM (fastdebug 9-internal+0-2016-04-26-135841.ppunegov.8155092, mixed mode, tiered, g1 gc, windows-x86)
# Core dump will be written. Default location: C:\\local\\aurora\\sandbox\\results\\workDir\\compiler\\intrinsics\\sha\\cli\\TestUseSHA1IntrinsicsOptionOnUnsupportedCPU\\hs_err_pid21476.mdmp

Comments
From Aurora history, this test failed with "corrupted C heap" only once. This suggest that it's more likely a bug in os::check_heap. I'm closing this as a duplicate of JDK-8148813 - Windows os::check_heap needs more information
15-06-2016

Vladimir looked this over and didn't see the compiler involved. From my read of the code I agree. So this is possible duplicate of bug JDK-8147481, which was resolved as "not an issue".
03-05-2016

OK, this is the stack trace of the failure - it's just VM thread calling os:check_heap() on thread exit (for debug builds). So the error (if any) occurred earlier. One suggestion is to verify the code path around the error message "Server VM warning: SHA instructions are not available on this CPU". KERNELBASE.dll!_CompareStringW@24() Unknown dbghelp.dll!NtWin32LiveSystemProvider::EnumHandleObjectInfo(unsigned __int64,unsigned short const *,unsigned long,unsigned long *,void *,unsigned long,unsigned long *) Unknown dbghelp.dll!GenWriteHandleData(struct _MINIDUMP_STATE *,struct _INTERNAL_PROCESS *,struct _MINIDUMP_STREAM_INFO *) Unknown 3f9df5a8() Unknown [Frames below may be incorrect and/or missing] > jvm.dll!os::abort(bool dump_core=true, void * siginfo=0x00000000, const void * context=0x00000000) Line 1078 C++ jvm.dll!VMError::report_and_die(int id=-536870912, const char * message=0x71d5c2f8, const char * detail_fmt=0x71e1ad5c, char * detail_args=0x3f9df9e4, Thread * thread=0x3f75ac00, unsigned char * pc=0x00000000, void * siginfo=0x00000000, void * context=0x00000000, const char * filename=0x71e18d90, int lineno=5253, unsigned int size=0) Line 1332 C++ jvm.dll!VMError::report_and_die(Thread * thread=0x3f75ac00, const char * filename=0x71e18d90, int lineno=5253, const char * message=0x71d5c2f8, const char * detail_fmt=0x71e1ad5c, char * detail_args=0x3f9df9e4) Line 1103 C++ jvm.dll!report_fatal(const char * file=0x71e18d90, int line=5253, const char * detail_fmt=0x71e1ad5c, ...) Line 236 C++ jvm.dll!os::check_heap(bool force=false) Line 5253 C++ jvm.dll!VMThread::run() Line 289 C++ jvm.dll!java_start(Thread * thread=0x3f75ac00) Line 448 C++ msvcr120.dll!_callthreadstartex() Line 376 C msvcr120.dll!_threadstartex(void * ptd=0x3f74d180) Line 354 C kernel32.dll!@BaseThreadInitThunk@12() Unknown ntdll.dll!___RtlUserThreadStart@8() Unknown ntdll.dll!__RtlUserThreadStart@8() Unknown
28-04-2016

I'm trying to get the stack trace decoded, having some difficulties, but making progress. I think the failure is intermittent. The test IS trying to use SHA1 on a machine without the instruction. So it's conceivable that there's a memory basher in the code path printing the error message. Or it could be the issue Ioi saw.
28-04-2016

Corrupted C heap errors on Windows can be a false positive. For example, see JDK-8147481 where Ioi perform investigation of this problem and made a conclusion that this is likely a Windows internal bug in HeapWalk/HeapValidate.
27-04-2016

See JDK-8155192. But current problem is something else - hs_err file shows that CPU does not have SHA or AVX2 instructions. So SHA is really not supported by that CPU. Have to decode call stack. Can you reproduce it? Can you print calls stack?
27-04-2016