JDK-6317397 : Hard hangs in concurrent code on Solaris and Linux
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 5.0u12,5.0u11,5.0u8,6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux,solaris,solaris_10
  • CPU: generic,x86
  • Submitted: 2005-08-30
  • Updated: 2012-10-08
  • Resolved: 2005-09-22
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.
Other JDK 6
5.0u15Fixed 6 b53Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
The following program intermittently hangs when run.
The hang is "hard", ^C or a simple kill has no effect.
Apparently only "kill -9" has any effect on the moribund process.

-----------------------------------------------------------------
import java.util.concurrent.*;

public class Bug {

    public static void main(String[] args) throws Throwable {
	final int threadCount = 10;
	ThreadPoolExecutor tpe = new ThreadPoolExecutor
	    (threadCount, threadCount,
	     30, TimeUnit.MILLISECONDS,
	     new ArrayBlockingQueue<Runnable>(2*threadCount));
	for (int i = 0; i < threadCount; i++)
	    tpe.submit(new Runnable() { public void run() {}});
	tpe.shutdown();
    }
}
-----------------------------------------------------------------

perl -e 'for ($i = 0;; $i++) { print STDERR "$i "; system("/u/martin/ws/mustang/build/solaris-sparc/j2sdk-image/bin/java Bug"); do {print STDERR "$1\n"; exit 1} if $? != 0; }'
-----------------------------------------------------------------

When the above is run repeatedly  (substitute your own mustang binaries)
it eventually hangs forever, only on Solaris.  I tried substituting
the binaries from the pending hotspot integration for b50, and they greatly
reduce the rate of occurrence of the problem, but it persists.
Instead of occurring once in app. 30 times, it occurs once in app. 100 times.

Hangs have been observed on both solaris-sparc and solaris-i586,
both Solaris 9 and Solaris 10.

Comments
EVALUATION The parker is trying to do a park() but has been caught in the safepoint check and so blocks on the Threads_lock. Safepoint check is moved to a point before we acquire the parker mutex.
16-10-2007

EVALUATION none available.
22-09-2005