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

Bug 365700

Summary: [Xtend] XtextDocument causes Deadlock
Product: [Modeling] TMF Reporter: Oliver L <oliver.libutzki>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: knut.wannheden, sebastian.zarnekow
Version: 2.0.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Thread 1
none
Thread 2
none
Stack
none
thread dump for deadlock none

Description Oliver L CLA 2011-12-06 05:37:34 EST
From time to time the Xtend editor causes a deadlock and you have to kill the whole Eclipse instance.

I have attached two screenshots showing the two threads waiting for each other. 

I didn't find a way to reproduce this problem, but it occurs quite often (roundabout every 2 hours).. very annoying as all unsaved changes are lost.
Comment 1 Oliver L CLA 2011-12-06 05:38:06 EST
Created attachment 207963 [details]
Thread 1
Comment 2 Oliver L CLA 2011-12-06 05:38:26 EST
Created attachment 207964 [details]
Thread 2
Comment 3 Sebastian Zarnekow CLA 2011-12-06 05:41:56 EST
Which version do you use? 2.0.1?

Can you provide the stack of the thread that holds the modify lock of the document? #readonly locks should be allowed concurrently.
Comment 4 Oliver L CLA 2011-12-06 05:46:15 EST
(In reply to comment #3)
> Which version do you use? 2.0.1?
> 
> Can you provide the stack of the thread that holds the modify lock of the
> document? #readonly locks should be allowed concurrently.

Yes, I use 2.0.1.

In the meantime I have killed the Eclipse instance, but I'm pretty sure it will occur again soon... then I will provide the missing stack.
Comment 5 Knut Wannheden CLA 2011-12-06 05:56:09 EST
By the looks of it this is probably bug 358396, which was fixed in 2.1. The line EditorResourceAccess.java:63 from the stack trace at least seems to indicate that.
Comment 6 Oliver L CLA 2011-12-06 07:29:39 EST
Created attachment 207975 [details]
Stack
Comment 7 Oliver L CLA 2011-12-06 07:31:59 EST
(In reply to comment #5)
> By the looks of it this is probably bug 358396, which was fixed in 2.1. The
> line EditorResourceAccess.java:63 from the stack trace at least seems to
> indicate that.

I guess you are right. I have attached the stacks of all threads as the problem occured again.
Comment 8 Oliver L CLA 2011-12-06 07:35:54 EST
Btw. Is it possible to disable "Mark occurences" as a workaround?
Comment 9 Sebastian Zarnekow CLA 2011-12-06 07:38:08 EST
(In reply to comment #8)
> Btw. Is it possible to disable "Mark occurences" as a workaround?

Yes, that should work. Just toggle Mark occurrences in your toolbar.
Comment 10 Sebastian Zarnekow CLA 2011-12-06 18:01:37 EST
(In reply to comment #9)
> (In reply to comment #8)
> > Btw. Is it possible to disable "Mark occurences" as a workaround?
> 
> Yes, that should work. Just toggle Mark occurrences in your toolbar.

Please try to verify the fix with 2.1, too. Thanks.
Comment 11 Nikolay Kasyanov CLA 2012-01-31 02:56:11 EST
Created attachment 210297 [details]
thread dump for deadlock

I experienced similar deadlock on 2.2. Here is thread dump, threads "Worker-53", "Worker-41" and main seems to be deadlocked

I caught this deadlock after content assist activation
Comment 12 Oliver L CLA 2012-01-31 03:08:58 EST
This has been reported: Bug 366784