RFR (M) #5 CR 8003985: Support @Contended annotation

Staffan Larsen staffan.larsen at oracle.com
Tue Jan 15 12:47:15 PST 2013


The the specific launcher is only available if you build just hotspot (which I think most hotspot developers still do).

If you run the jstack launcher from the jdk bin directory you have to run with the -F flag to use the SA version of jstack. Normally it uses code in Hotspot to do deadlock detection and  print stacktraces.

/Staffan


On 15 jan 2013, at 20:27, Aleksey Shipilev <aleksey.shipilev at oracle.com> wrote:

> And so I built the fresh trunk of hotspot-rt.
> 
> The path Staffan mentions appears to be some specific launcher, and I
> don't have that as the part of my regular build with new build system.
> Hence I assumed running jstack from the built JDK would render the same
> effect, since it goes through the same deadlock detection code?
> 
> Suspecting this has something to do with cross-version JDK, picked
> another victim:
> 
> $ java -version
> java version "1.7.0_12-ea"
> Java(TM) SE Runtime Environment (build 1.7.0_12-ea-b04)
> Java HotSpot(TM) 64-Bit Server VM (build 24.0-b26, mixed mode)
> 
> ...and:
> 
> hotspot-rt-HEAD jstack'ing jdk7u12: OK
> hotspot-rt-HEAD jstack'ing hotspot-rt-HEAD: OK
> jdk7u12 jstack'ing jdk7u12: OK
> jdk7u12 jstack'ing hotspot-rt-HEAD: OK
> 
> ...hence everything seems to be fine. Staffan, can you clean your build
> and make the test again? Or, can you publish more thorough steps to
> reproduce?
> 
> -Aleksey.
> 
> On 01/15/2013 10:52 PM, Aleksey Shipilev wrote:
>> Sorry to hear it. Looking.
>> Is this a part of regular test suite (which I had missed to run)?
>> 
>> -Aleksey.
>> 
>> On 01/15/2013 10:43 PM, Staffan Larsen wrote:
>>> This change seems to have broken deadlock detection in SA. Here is the exception that I get:
>>> 
>>> java.lang.RuntimeException: should not reach here
>>>        at sun.jvm.hotspot.oops.InstanceKlass.getFieldOffset(InstanceKlass.java:327)
>>> 
>>> I haven't yet dug into the details. To reproduce, start any Java program, then run:
>>> 
>>>> sudo build/linux/linux_amd64_compiler2/jvmg/hotspot -cp build/linux/linux_amd64_compiler2/generated/sa-jdi.jar sun.jvm.hotspot.tools.JStack <pid of the program>
>>> 
>>> Using java runtime at: /home/staffan/java/8latest/jre
>>> Attaching to process ID 28487, please wait...
>>> Debugger attached successfully.
>>> Server compiler detected.
>>> JVM version is 25.0-b15-internal-jvmg
>>> Deadlock Detection:
>>> 
>>> java.lang.RuntimeException: should not reach here
>>>        at sun.jvm.hotspot.oops.InstanceKlass.getFieldOffset(InstanceKlass.java:327)
>>>        at sun.jvm.hotspot.oops.Field.<init>(Field.java:47)
>>>        at sun.jvm.hotspot.oops.OopField.<init>(OopField.java:42)
>>>        at sun.jvm.hotspot.oops.InstanceKlass.newField(InstanceKlass.java:915)
>>>        at sun.jvm.hotspot.oops.InstanceKlass.findLocalField(InstanceKlass.java:628)
>>>        at sun.jvm.hotspot.oops.InstanceKlass.findField(InstanceKlass.java:665)
>>>        at sun.jvm.hotspot.oops.InstanceKlass.findField(InstanceKlass.java:689)
>>>        at sun.jvm.hotspot.oops.OopUtilities.initThreadFields(OopUtilities.java:220)
>>>        at sun.jvm.hotspot.oops.OopUtilities.threadOopGetParkBlocker(OopUtilities.java:292)
>>>        at sun.jvm.hotspot.runtime.JavaThread.getCurrentParkBlocker(JavaThread.java:385)
>>>        at sun.jvm.hotspot.runtime.DeadlockDetector.print(DeadlockDetector.java:82)
>>>        at sun.jvm.hotspot.runtime.DeadlockDetector.print(DeadlockDetector.java:39)
>>>        at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:52)
>>>        at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:45)
>>>        at sun.jvm.hotspot.tools.JStack.run(JStack.java:60)
>>>        at sun.jvm.hotspot.tools.Tool.start(Tool.java:221)
>>>        at sun.jvm.hotspot.tools.JStack.main(JStack.java:86)
>>> Can't print deadlocks:should not reach here
>> 
> 



More information about the hotspot-dev mailing list