JDK-6725455 : (thread) TEST_BUG java/lang/Thread/StopBeforeStart,ThreadStateTest.java fail with -Xcomp
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 6u12,7
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic,solaris
  • CPU: generic
  • Submitted: 2008-07-14
  • Updated: 2011-02-22
  • Resolved: 2011-02-22
Related Reports
Duplicate :  
Description
During  HS14-b01/jdk7b31 PIT

java/lang/Thread/ThreadStateTest.java fails on solaris-sparcv9 with -server -Xcomp
----------System.out:(16/510)----------
Checking thread state NEW
Checking thread state RUNNABLE
Waiting myThread to go blocked.
  myThread is going to block.
Checking thread state BLOCKED
Waiting myThread to go waiting.
  myThread is going to wait.
Checking thread state WAITING
Waiting myThread to go timed waiting.
  myThread is going to timed wait.
Checking thread state TIMED_WAITING
Waiting myThread to go sleeping.
  myThread is going to sleep.
Checking thread state TIMED_WAITING
Waiting myThread to terminate.
Checking thread state RUNNABLE
----------System.err:(14/884)----------
java.lang.RuntimeException: MyThread expected to have TERMINATED but got RUNNABLE
	at ThreadStateTest.checkThreadState(ThreadStateTest.java:119)
	at ThreadStateTest.main(ThreadStateTest.java:96)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:623)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:674)


Similarly, java/lang/Thread/StopBeforeStart.java fails on Solaris-i586 with -client -Xcomp:
----------System.out:(0/0)----------
----------System.err:(15/894)----------
java.lang.RuntimeException: Runnable test: app thread did not terminate
	at StopBeforeStart.runit(StopBeforeStart.java:126)
	at StopBeforeStart.doit(StopBeforeStart.java:102)
	at StopBeforeStart.main(StopBeforeStart.java:94)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:623)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:674)

JavaTest Message: Test threw exception: java.lang.RuntimeException: Runnable test: app thread did not terminate
JavaTest Message: shutting down test

see comments for notes on how to reproduce these failures.

There may be a testbug due to some race condition or a thread state visibility issue,
but this is not obvious.

Comments
EVALUATION StopBeforeStart has specific issues, in that the semantics of stopping a non-started thread before starting it cannot be guaranteed with the fix in the VM for CR 6566340. StopBeforeStart is invalid since the integration of CR 6562203, and has been removed. ThreadStateTest would appear to have races in the test itself, and I would expect that Xcomp just exposes these. The test should be looked at to determine if the races can be elimated, or reduced to the point where they should not occur ( even with Xcomp ). CR 7021010 will be used to fix the test itself.
09-02-2011

EVALUATION The regression test suite was never designed to be a general purpose test suite. While jtreg supports arbitrary VM options (e.g. any "-X" or "-XX"), the test results produced when these options are provided may not be useful and in fact may be misleading. Depending on how a shell test was written, the options may not be passed in. If a test was designed (as this one was) to use specific VM options and others are provided on the command line, the results will not have the expected interpretation. In this case, we have a failure. In other cases, the test may continue to pass, but the test itself has been invalidated as the expected conditions no longer exist. When jtreg began supporting arbitrary VM options, we did not commit to supporting them in the test suite. Tests were not retrofitted to support them. This is likely not a bug as the test suite was never intended for this use.
14-07-2008