This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 221757 - SourcePrefetcher deadlocks when it's cancelled
Summary: SourcePrefetcher deadlocks when it's cancelled
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 7.3
Hardware: PC Mac OS X
: P1 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-08 18:42 UTC by Tomas Zezula
Modified: 2012-11-10 03:26 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Zezula 2012-11-08 18:42:07 UTC
When the OnePassCompileWorker or SuperOnePassCompileWorker is cancelled the running SourcePrefetcher goes out of permits which causes deadlock.

"org.netbeans.modules.java.source.indexing.SourcePrefetcher" daemon prio=1 tid=7f9b81667000 nid=0x11c7bc000 waiting on condition [11c7bb000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <7c0325f68> (a java.util.concurrent.Semaphore$NonfairSync)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:969)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1281)
	at java.util.concurrent.Semaphore.acquire(Semaphore.java:441)
	at org.netbeans.modules.java.source.indexing.SourcePrefetcher$ConcurrentIterator$1.call(SourcePrefetcher.java:201)
	at org.netbeans.modules.java.source.indexing.SourcePrefetcher$ConcurrentIterator$1.call(SourcePrefetcher.java:192)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2036)
Comment 1 Tomas Zezula 2012-11-08 18:44:41 UTC
P1 due to the importance of the class.
The probability of the deadlock is now much higher due to much fine grained cancelling in NB 7.3.
Comment 2 Tomas Zezula 2012-11-08 21:23:22 UTC
Fixed jet-main afb310aa1a04
Comment 3 Quality Engineering 2012-11-10 03:26:29 UTC
Integrated into 'main-golden', will be available in build *201211100001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/afb310aa1a04
User: Tomas Zezula <tzezula@netbeans.org>
Log: #221757:SourcePrefetcher deadlocks when it's cancelled