Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350284 - Enable logging on SWTBOT can cause a dead lock
Summary: Enable logging on SWTBOT can cause a dead lock
Status: NEW
Alias: None
Product: SWTBot
Classification: Technology
Component: SWTBot (show other bugs)
Version: 2.0.4   Edit
Hardware: PC Windows 7
: P3 major with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-24 11:41 EDT by Stefan Rossbach CLA
Modified: 2015-11-11 19:46 EST (History)
2 users (show)

See Also:


Attachments
strack traces of the Jvm after the eclipse gui has frozen (6.17 KB, text/plain)
2011-06-24 11:41 EDT, Stefan Rossbach CLA
no flags Details
Log4J configuration (3.13 KB, application/octet-stream)
2011-06-24 12:59 EDT, Stefan Rossbach CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.