[concurrency-interest] LinkedBlockingDeque deadlock? (Test case)

David Holmes - Sun Microsystems David.Holmes at Sun.COM
Thu Jul 23 05:48:31 UTC 2009


Just an update.

The good news is that I managed to reproduce this on an 8-way Intel box. 
Sometimes it hangs due to the applications LinkedBlockingDeque and 
sometimes it hangs in the executor's LinkedBlockingQueue.

The bad news is that as soon as I modified the LBQ/LBD  and 
ReentrantLock code to allow me to probe deeper, I can no longer 
reproduce the problem :-( And all I did to the code was make everything 
public so that I could dump the lock state when the hang occurred.

Very frustrating ...

David

David Holmes said the following on 07/18/09 12:28:
> Sorry Ryan, misread the stack trace. The main thread is interacting with the
> executors LBQ not the application one.
> 
> I'll see if I can use this test to reproduce the issue on Monday.
> 
> David Holmes
> 
>> -----Original Message-----
>> From: concurrency-interest-bounces at cs.oswego.edu
>> [mailto:concurrency-interest-bounces at cs.oswego.edu]On Behalf Of David
>> Holmes
>> Sent: Saturday, 18 July 2009 12:15 PM
>> To: Ryan Betts; concurrency-interest at cs.oswego.edu
>> Cc: core-libs-dev
>> Subject: Re: [concurrency-interest] LinkedBlockingDeque deadlock? (Test
>> case)
>>
>>
>>
>>
>> Ryan,
>>
>> Thanks very much for this.
>>
>> When this "deadlocks" does top show whether the java process is actually
>> quiet or is it still consuming CPU? I notice that in the stack
>> dump the main
>> thread is in the process of unlocking the lock that the other threads are
>> waiting upon and hence the system is not deadlocked - unless that main
>> thread is actually "stuck" somewhere. Can you take a series of
>> stackdumps to
>> see if/how the main thread is executing?
>>
>> Feel free to just send them to me rather than the mailing lists.
>>
>> Thanks,
>> David Holmes
>>
>>> -----Original Message-----
>>> From: concurrency-interest-bounces at cs.oswego.edu
>>> [mailto:concurrency-interest-bounces at cs.oswego.edu]On Behalf Of Ryan
>>> Betts
>>> Sent: Saturday, 18 July 2009 2:48 AM
>>> To: concurrency-interest at cs.oswego.edu
>>> Cc: core-libs-dev
>>> Subject: Re: [concurrency-interest] LinkedBlockingDeque deadlock? (Test
>>> case)
>>>
>>>
>>> Hello all,
>>>
>>> I've been working with Ariel on the j.u.c.LinkedBlockingDeque deadlock
>>> we observe. The attached test case reproduces the deadlock
>>> intermittently, usually requiring several minutes. The test simply
>>> prints periods until it deadlocks. Attempts to produce a simpler test
>>> case using only ReentrantLock or without an ExecutorService were
>>> unsuccessful.
>>>
>>> I've attached jstack reports showing the deadlocked case and the dmesg
>>> output from one of the servers that reproduces the defect. To date,
>>> this deadlock only occurs on our 2 socket i7s.
>>>
>>> We have not filed a defect with Sun for this issue. If that would be
>>> helpful (or necessary), we would of course happily oblige.
>>>
>>> $ java -version
>>> java version "1.6.0"
>>> OpenJDK  Runtime Environment (build 1.6.0-b09)
>>> OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode)
>>>
>>> $ uname -a
>>> Linux host3e 2.6.18-128.1.16.el5 #1 SMP Tue Jun 30 06:07:26 EDT 2009
>>> x86_64 x86_64 x86_64 GNU/Linux
>>>
>>> $ javac LBDLockPatternTest.java
>>> $ java LBDLockPatternTest
>>>
>>>
>>> Thank you,
>>> *--Ryan.
>>>
>>>
>>>
>> _______________________________________________
>> Concurrency-interest mailing list
>> Concurrency-interest at cs.oswego.edu
>> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
> 



More information about the core-libs-dev mailing list