Community
Participate
Working Groups
Created attachment 239385 [details] Plug-in to reproduce deadlock in SearchIndex Querying help content while exiting Eclipse may cause a deadlock: the help windows stays opened but cannot be used anymore. Even closing the help window does not stop the "eclipse.exe" process. Steps to reproduce: 1. Copy the attached plug-in "plugin.to.reproduce.deadlock.in.SearchIndex_1.0.0.jar" into the "dropins" folder of your Eclipse installation folder 2. Start Eclipse 3. Open the help window by choosing "Help > Help Contents" 4. In the help window in the "Contents" view, click on "Plug-in to reproduce deadlock in SearchIndex" 5. Close Eclipse by choosing "File > Exit" in the main window => Not always but sometime the main window disappears but the help window stays opened. Even if the help window is closed, the Window Task Manager still shows a running "eclipse.exe" process. The bug is caused by a deadlock in org.eclipse.help.internal.search.SearchIndex: The method "close()" waits for all searches to finish. But the code to wait is enclosed by the same "synchronized (searches) {...}" as in "unregisterSearch(Thread t)", which must be called to finish a search.
So in theory moving the "synchronized (searches) {" after the "while (searches.size()>0) {" loop would break this deadlock ? size() usually returns quickly, and the cost of it being wrong during a close() would be pretty low. PW
Created attachment 239406 [details] Patch for bug 426785 (In reply to Paul Webster from comment #1) Yes, the attached patch fixes this issue. By the way, I think the field "closed" must be "volatile" because it is accessed by different threads. Unfortunately, I failed to contribute via Gerrit: My push was rejected with following error message: Repository ssh://hvoormann@git.eclipse.org:29418/platform/eclipse.platform.ua prohibited by Gerrit Branch refs/heads/master: You are not allowed to perform this operation. To push into this reference you need 'Push' rights. User: hvoormann Please read the documentation and contact an administrator if you feel the configuration is incorrect Processing changes: refs: 1 Processing changes: refs: 1, done
You need to push to HEAD:refs/for/master PW
(In reply to Paul Webster from comment #3) > You need to push to HEAD:refs/for/master > > PW Success! :-) https://git.eclipse.org/r/21224
Released as http://git.eclipse.org/c/platform/eclipse.platform.ua.git/commit/?id=30ba8ea359acc60d26bbbc47684874777aefaff0 I just updated the comment to use Bug .... as the comment title. Thanks Holger! I've released http://git.eclipse.org/c/platform/eclipse.platform.ua.git/commit/?id=acce130be709cb2373506a9e7aa97ec8293cc409 to update versions and copyright. PW
(In reply to Paul Webster from comment #5) > I've released > http://git.eclipse.org/c/platform/eclipse.platform.ua.git/commit/ > ?id=acce130be709cb2373506a9e7aa97ec8293cc409 to update versions and > copyright. What was the reason to do that? It was already increased for 4.4. Just wondering.
(In reply to Dani Megert from comment #6) > > What was the reason to do that? It was already increased for 4.4. Just > wondering. That was a mistake on my part. I use: git diff R4_3..HEAD -- org.eclipse.help.base/META-INF/MANIFEST.MF To see if it has been changed since 4.3, and I misread the result. PW
I tried to reproduce the bug in I20140528-2000 (around 20 attempts) and it happened once. In 4.4 M3 I am able to reproduce it almost every time.