JDK-6584008 : jvmtiStringPrimitiveCallback should not be invoked when string value is null
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: hs24.2,7u25,8u60
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2007-07-23
  • Updated: 2016-02-09
  • Resolved: 2015-01-16
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 7 JDK 8 JDK 9
7u101Fixed 8u60Fixed 9 b49Fixed
Related Reports
Relates :  
Description
One of the profiler vendors reports a crash when they enable the jvmtiStringPrimitiveCallback implementation. From the description it appears that the heap iteration (IterateThroughHeap) encounters a partially constructed java.lang.String. That is, the value field is null. The invoke_string_value_callback function doesn't check for this case and so will crash.

Comments
Sergei, please, look on test.
09-01-2015

These two files reproduce this bug, and can produce a HotSpot crash fairly quickly.
09-01-2015

On 13/12/2014 5:06 AM, David Chan wrote:> Hi, > > I do not have an account with openjdk bug tracker, but ran into what > looks like the bug mentioned here: > > * https://bugs.openjdk.java.net/browse/JDK-6584008 > > I'm hoping to leave feedback that it occurred on Java 7: > > # A fatal error has been detected by the Java Runtime Environment: > > # > > # SIGSEGV (0xb) at pc=0x00007f88fd18f84b, pid=25705, > tid=140225870702336 > > # > > # JRE version: 7.0_25-b15 > > # Java VM: Java HotSpot(TM) 64-Bit Server VM (23.25-b01 mixed mode > linux-amd64 compressed oops) > > # Problematic frame: > > # V [libjvm.so+0x63784b] invoke_string_value_callback(int > (*)(long, long, long*, unsigned short const*, int, void*), > CallbackWrapper*, oopDesc*, void*)+0x11b > > Current thread (0x00007f88f831d800): VMThread [stack: > 0x00007f88e1262000,0x00007f88e1363000] [id=25725] > > siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), > si_addr=0x000000000000000c > > > Stack: [0x00007f88e1262000,0x00007f88e1363000], > sp=0x00007f88e13619a0, free space=1022k > Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, > C=native code) > V [libjvm.so+0x63784b] invoke_string_value_callback(int (*)(long, > long, long*, unsigned short const*, int, void*), CallbackWrapper*, > oopDesc*, void*)+0x11b > V [libjvm.so+0x639496] > IterateThroughHeapObjectClosure::do_object(oopDesc*)+0x476 > V [libjvm.so+0x708964] > MutableSpace::object_iterate(ObjectClosure*)+0x74 > V [libjvm.so+0x7a5a50] PSYoungGen::object_iterate(ObjectClosure*)+0x20 > V [libjvm.so+0x75d008] > ParallelScavengeHeap::object_iterate(ObjectClosure*)+0x18 > V [libjvm.so+0x63a363] VM_HeapIterateOperation::doit()+0x43 > V [libjvm.so+0x8aac8c] VM_Operation::evaluate()+0x4c > V [libjvm.so+0x8a96a0] > VMThread::evaluate_operation(VM_Operation*)+0x80 > V [libjvm.so+0x8a9c26] VMThread::loop()+0x1e6 > V [libjvm.so+0x8aa2c0] VMThread::run()+0x70 > V [libjvm.so+0x744270] java_start(Thread*)+0x100 > >
13-12-2014

This issue needs to be reproduced first. I'm not sure it still exists as there were many changes in Strings area since this was reported.
07-08-2013

EVALUATION This needs to be fixed in the current release so that it will go to the 6u as well.
23-07-2007