CR 6860309 - solaris timing issue on thread startup

Gary Adams gary.adams at
Sat Nov 12 12:11:10 UTC 2011

On 11/12/11 6:58 AM, Alan Bateman wrote:
> On 11/11/2011 16:56, Gary Adams wrote:
>>  CR 6860309 - TEST_BUG: Insufficient sleep time in 
>> java/lang/Runtime/exec/
>> A timing problem is reported for slow solaris systems for this
>> test to start up a process and systematically torture the underlying
>> threads processing data from the running process.
>> On my fast solaris machine I can not reproduce the error,
>> but it is reasonable to assume that on a slower machine there
>> could be scheduling issues that could delay the thread startup
>> past the designated 100 millisecond delay in the main thread.
>> This webrev suggests gating the process destruction until both
>> worker threads are alive.
> -Xcomp on a slow machine, always fun when testing the untestable.
> I agree with David but I don't think there is perfect solution. I 
> would suggest using a CountDownLatch or other synchronization so that 
> the main thread waits until the Copier thread is just about to do the 
> read. Then do a sleep in the main thread before invoking the destroy 
> method. I suspect that is the best that you can do as can't be 
> guaranteed that the Copier thread is blocked in the underlying read.
> -Alan.

I'll give it a try on Monday. Ideally, I could get a reproducible failure
before trying to fix the problem. Unfortunately, the only slow machines
I have on hand are linux/arm, which might have different issues
from the solaris/sparc originally reported.

More information about the core-libs-dev mailing list