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

Bug 350284

Summary: Enable logging on SWTBOT can cause a dead lock
Product: [Technology] SWTBot Reporter: Stefan Rossbach <rossbach>
Component: SWTBotAssignee: Project Inbox <swtbot-inbox>
Status: NEW --- QA Contact:
Severity: major    
Priority: P3 CC: danielfriederich, KetanPadegaonkar
Version: 2.0.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
strack traces of the Jvm after the eclipse gui has frozen
none
Log4J configuration none

Description Stefan Rossbach CLA 2011-06-24 11:41:38 EDT
Created attachment 198547 [details]
strack traces of the Jvm after the eclipse gui has frozen

After investigating the code of the
org.eclipse.swtbot.swt.finder.utils.MessageFormat class i found out that the
string creation for the debug message is performed lazy.

So the following scenario holds:

Main-Thread (EDT): runs some code
SWTBOT-Thread: begins to log a message and acquire the lock on the logger
Main-Thread (EDT): tries to log a message and is blocked on the current lock
of the logger
SWTBOT-Thread: is running a Display.(A)Sync to gather the information for
the string to be logged.
SWTBOT-Thread: is blocked by Main-Thread (EDT) which is blocked by
SWTBOT-Thread:

DEADLOCK

see attachment for stack traces
Comment 1 Ketan Padegaonkar CLA 2011-06-24 12:46:10 EDT
Hi,

Could you also attach a copy of your log4j.xml file?
Comment 2 Stefan Rossbach CLA 2011-06-24 12:59:44 EDT
Created attachment 198551 [details]
Log4J configuration
Comment 3 Daniel Friederich CLA 2015-11-11 19:46:10 EST
Just run into this deadlock as well.
If I understand this issue correctly, then the logging support in log4j cannot be reliably enabled, say enabled without running occasionally into this deadlock.