Bug 477185 - Potential deadlock in AERI logger when sending messages to osgii logger and UI thread is locked in a mutex
Summary: Potential deadlock in AERI logger when sending messages to osgii logger and U...
Status: CLOSED FIXED
Alias: None
Product: EPP
Classification: Technology
Component: Automated Error Reporting Client (AERI) (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 critical (vote)
Target Milestone: 4.5.1RC1   Edit
Assignee: Daniel Haftstein CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2015-09-11 08:35 EDT by Teodor Madan CLA
Modified: 2015-09-19 05:51 EDT (History)
1 user (show)

See Also:


Attachments
A sample plugin to reproduce it (11.96 KB, application/zip)
2015-09-11 09:19 EDT, Teodor Madan CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Teodor Madan CLA 2015-09-11 08:35:51 EDT
org.eclipse.core.runtime.Plugin.getLog().log(IStatus) is a standard way of registering events in workspace log, including for later diagnostic. 'Till recently there were no constrains from what thread it is called nor on existing synchronization locks. After upgrading to Eclipse 4.5.1 RC1, it can enter in deadlock in case UI thread for some reason cannot be released.

The real use-case of deadlocking was reported for CDT product. See Bug 476989 . The stack trace is in https://bugs.eclipse.org/bugs/attachment.cgi?id=256465

This seems to be a side effect from Bug 472704 that introduced a Display#syncExec in AERI logger implementation. 

The patch contains the Display.syncExec (Shells#hasActiveWindow())  that indirectly introduced a dependency of not having UI thread locked.
Comment 1 Teodor Madan CLA 2015-09-11 09:19:37 EDT
Created attachment 256523 [details]
A sample plugin  to reproduce it

A sample plugin is attach. Has the sources as well. Install it into a eclipse product and execute "Sample Menu->Sample command".  There should be two dialogs, the last one confirming that there's no lock.

The code from org.eclipse.test.testloginglock.handlers.SampleHandler.execute(ExecutionEvent) will lock the UI thread and execute a background job that will attempt to log into workbench.
Comment 2 Teodor Madan CLA 2015-09-11 09:30:17 EDT
The same sample plugin does work with Eclipse 4.5.0
Comment 3 Eclipse Genie CLA 2015-09-11 13:39:27 EDT
New Gerrit change created: https://git.eclipse.org/r/55772
Comment 5 Marcel Bruch CLA 2015-09-13 04:02:16 EDT
Daniel, 
can you please migrate the ui deadlock test action to the aeri.ui.test error toolbar menu and add it to the manual test scenarios wiki page?
Comment 6 Marcel Bruch CLA 2015-09-19 05:51:32 EDT
Discussion happened on bug 476989. This issue has been fixed.