United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6987703 iCMS: Intermittent hang with gc/gctests/CallGC/CallGC01 and +ExplicitGCInvokesConcurrent
JDK-6987703 : iCMS: Intermittent hang with gc/gctests/CallGC/CallGC01 and +ExplicitGCInvokesConcurrent

Details
Type:
Bug
Submit Date:
2010-09-27
Status:
Closed
Updated Date:
2012-02-01
Project Name:
JDK
Resolved Date:
2011-04-25
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs21 (b05)

Related Reports
Backport:

Sub Tasks

Description
The nightly test:

gc/gctests/CallGC/CallGC01

is failing intermittently by hanging and timing out.

Links to the failure are:

http://sqeweb.sfbay.sun.com/nfs/results/vm/gtee/JDK7/NIGHTLY/VM/2010-09-22/GC_Baseline-Xinc/vm/linux-i586/client/mixed/linux-i586_vm_client_mixed_vm.gc.testlist/analysis.html

and:

http://sqeweb.sfbay.sun.com/nfs/results/vm/gtee/JDK7/NIGHTLY/VM/2010-09-22/GC_Baseline-Xinc/vm/linux-i586/client/mixed/linux-i586_vm_client_mixed_vm.gc.testlist/ResultDir/CallGC01/

Machine: tq-win2k-dev
VM Arch: linux-i586 (Client VM).

The test seems to be hanging in one run out of 3 - so it's fairly reproducible.

The flags used to run the test include +ExplicitGCInvokesConcurrent. With this flag, calls to System.gc() perform a young collection and initiate a concurrent cycle. The thread that is making the call to System.gc() waits until the concurrent cycle completes. Looking at the stack traces of the various threads it looks like the issue might be associated with this flag.

I'm attaching the rerun.sh script just in case the links above end up being archived.

                                    

Comments
EVALUATION

When using iCMS+ExplicitGCInvokesConcurrent, while a system.gc() request is
pending, we "disable_icms" -- in other words, we temporarily discontinue
incrementality, so that a CMS collection can proceed to completion
even if there is no allocation to act as a trigger for iCMS initiation.

In this case, the enable_icms() and disable_icms() interfaces which had
been used to affect this incrementality enabling and disabling are not
adequate for this use because multiple concurrent invocations can destructively
interfere, leaving a thread starnded with its system.gc() request stuck
in limbo.

The fix would be to make the enable/disable interfaces counting interfaces
so they do not lose any control events because of inteference.
                                     
2011-03-12
WORK AROUND

Don't use -XX:+CMSIncrementalMode and -XX:+ExplicitGCInvokesConcurrent together,
or avoid calling System.gc() concurrently from two different mutator threads.
                                     
2011-03-12
SUGGESTED FIX

As in eval, make disable_/enable_icms() count; the following fixes are under test:-

http://javaweb.us.oracle.com/~ysr/neeraja/export/ysr/icms_hang/webrev/
                                     
2011-03-13
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/a181f3a124dd
                                     
2011-03-15
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/a181f3a124dd
                                     
2011-03-21
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/a181f3a124dd
                                     
2011-03-25



Hardware and Software, Engineered to Work Together