Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313086

Summary: Deadlock when saving CUE
Product: [Eclipse Project] JDT Reporter: Benno Baumgartner <benno.baumgartner>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, jamesblackburn+eclipse, john.arthorne
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Thread Dump none

Description Benno Baumgartner CLA 2010-05-17 05:16:55 EDT
Created attachment 168698 [details]
Thread Dump

I20100429-1549

I'm not sure what I did, nothing fancy though, just edited some Java file in the CUE and saved:

"main" prio=6 tid=0x008f6400 nid=0x680 in Object.wait() [0x0012d000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.eclipse.core.internal.jobs.Semaphore.acquire(Semaphore.java:38)
        - locked <0x0b327008> (a org.eclipse.core.internal.jobs.Semaphore)
        at org.eclipse.core.internal.jobs.OrderedLock.doAcquire(OrderedLock.java:175)
        at org.eclipse.core.internal.jobs.OrderedLock.acquire(OrderedLock.java:109)
        at org.eclipse.core.internal.jobs.OrderedLock.acquire(OrderedLock.java:83)
        at org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:118)
        at org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:1914)
        at org.eclipse.core.internal.resources.Marker.setAttribute(Marker.java:233)
        at org.eclipse.core.internal.resources.Marker.setAttribute(Marker.java:222)
        at org.eclipse.ui.texteditor.MarkerUtilities.setIntAttribute(MarkerUtilities.java:334)
        at org.eclipse.ui.texteditor.MarkerUtilities.setCharStart(MarkerUtilities.java:308)
        at org.eclipse.ui.texteditor.BasicMarkerUpdater.updateMarker(BasicMarkerUpdater.java:75)
        at org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel.updateMarker(AbstractMarkerAnnotationModel.java:511)
        at org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel.updateMarkers(AbstractMarkerAnnotationModel.java:571)
        at org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel.commit(AbstractMarkerAnnotationModel.java:636)
        at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer.commitFileBufferContent(ResourceTextFileBuffer.java:402)
        at org.eclipse.core.internal.filebuffers.ResourceFileBuffer.commit(ResourceFileBuffer.java:325)
        at org.eclipse.jdt.internal.ui.javaeditor.DocumentAdapter.save(DocumentAdapter.java:472)
        at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider$5.run(CompilationUnitDocumentProvider.java:1579)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.notifyPostSaveListeners(CompilationUnitDocumentProvider.java:1566)
        at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.commitWorkingCopy(CompilationUnitDocumentProvider.java:1363)

Had to kill eclipse after 10 minutes.

See attachment for full dump.
Comment 1 Dani Megert CLA 2010-05-17 05:28:02 EDT
John, any idea what could be wrong? Could the changes made for bug 307282 cause this? We recently got similar bug reports, see bug 308235 and bug 312543.
Comment 2 Dani Megert CLA 2010-05-17 05:41:55 EDT
Note that setting a marker attribute uses no scheduling rule ('null').
Comment 3 John Arthorne CLA 2010-05-17 11:30:00 EDT
(In reply to comment #1)
> John, any idea what could be wrong? Could the changes made for bug 307282 cause
> this? We recently got similar bug reports, see bug 308235 and bug 312543.

Yes, I think this is caused by the fix for bug 307282. I didn't see the connection before, but I believe what we are seeing here is bug 311863, which was introduced by the fix for bug 307282. Luckily this is already fixed in RC1 so I think this can be marked as a duplicate.
Comment 4 James Blackburn CLA 2010-05-17 11:39:30 EDT
(In reply to comment #3)
> Yes, I think this is caused by the fix for bug 307282.

Yes, I agree this is probably caused by 307282 (see bug 311863 comment 11). The fix in M7 unfortunately exposed this issue to callers of OrderedLock#acquire(). I haven't seen any similar issues since this was fixed (we added a test + I had a readily reproducible real life example here).
Comment 5 Dani Megert CLA 2010-05-17 11:45:44 EDT

*** This bug has been marked as a duplicate of bug 311863 ***