JDK-8139150 : ClassVerifier frees exception message while it's still in use
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8,9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-10-08
  • Updated: 2016-01-14
  • Resolved: 2015-10-09
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 8 JDK 9
8u72Fixed 9 b89Fixed
Description
While testing the CompactStrings implementation, I encountered weird crashes in java_lang_String::create_from_str(const char* utf8_str) that were due to 'utf8_str' containing garbage. 

V  [libjvm.so+0x1160d00]  VMError::report_and_die()+0x160
V  [libjvm.so+0x83276f]  report_should_not_reach_here(char const*, int)+0x6f
V  [libjvm.so+0xae52df]  java_lang_String::create_from_str(char const*, Thread*)+0x28f
V  [libjvm.so+0x901ab5]  Exceptions::new_exception(Thread*, Symbol*, char const*, Handle, Handle, Handle, Exceptions::ExceptionMsgToUtf8Mode)+0x225
V  [libjvm.so+0x9021ab]  Exceptions::_throw_msg(Thread*, char const*, int, Symbol*, char const*)+0x12b
V  [libjvm.so+0x1142e5b]  Verifier::verify(instanceKlassHandle, Verifier::Mode, bool, Thread*)+0xa9b

It turned out that the problem is in the ClassVerifier freeing the exception message while it's still in use.
Comments
ILW = Crash due to deallocated memory, only if class verification fails and even then only spurious, no workaround = HLH = P2
08-10-2015