Bug 6180 - Wake mechanism broken on Motif
Summary: Wake mechanism broken on Motif
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: PC Linux
: P1 critical (vote)
Target Milestone: 2.0 M2   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-21 14:20 EST by David Whiteman CLA
Modified: 2002-03-07 10:33 EST (History)
5 users (show)

See Also:


Attachments
R1.0 JAR containing the fix (original name swt.jar) (793.45 KB, application/octet-stream)
2002-02-06 11:29 EST, Silenio Quarti CLA
no flags Details
dump written to console (2.84 KB, text/plain)
2002-02-07 15:07 EST, Stef van Dijk CLA
no flags Details
SWT shared library (original name "libswt-linux-1137.so") (364.67 KB, application/octet-stream)
2002-02-07 16:34 EST, Silenio Quarti CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Whiteman CLA 2001-11-21 14:20:56 EST
This is a placeholder for a problem we've talked about in email.

I have a method invoking Display.syncExec() to execute a Runnable.  Problem is, 
it appears that the Display never wakes up to execute the Runnable.  Other 
syncExec() calls before this one run cleanly, so I'm not sure why it gets stuck 
on this one, but I step through to where the synchronizer adds the runnable to 
its messages and tells the display to wake up using an OS call.  The display 
thread continues sleeping, however.

In a problem you noticed, a thread would not wake up to read if an image was 
successfully loaded.
Comment 1 David Whiteman CLA 2002-01-16 12:54:35 EST
Has there been any activity on this?  Some of my coworkers detected what 
appears to be a similar problem, running WSDD 4.0 on Linux.  I'd personally 
like to see this fixed as it is stopping me from running our JUnit test suite 
on Linux Motif.
Comment 2 Grant Gayed CLA 2002-01-16 13:32:55 EST
SSQ will be back in a day or two.  He was actively looking at this but did not 
determine the problem.
Comment 3 Silenio Quarti CLA 2002-01-23 17:08:50 EST
For some reason in some circumtances Xt only listens for
X events ignoring other alternate inputs which are used
by our wake up mechanism. When that happens the display
thread waits forever.

This Xt bug has been worked around.
Comment 4 Tim Koss CLA 2002-02-05 12:28:11 EST
Is there a fix for this that we can try in Eclipse 1.0?
Comment 5 Silenio Quarti CLA 2002-02-05 13:04:09 EST
The final fix is really complicated and involves many
changes. I don't think it can be back ported to R1.0. 

The method below fixes the problem too, but it is not
the final solution which is released in R2.0. You can try
this. If it fixes your problem, you need to go through
the normal procedures of getting a patch to R1.0.

+++++++++++++++++++++++
From org.eclipse.swt.widgets.Display:
public boolean sleep () {
	checkDevice ();
	int xtContext = OS.XtDisplayToApplicationContext (xDisplay);
	/*
	* Bug in Xt.  Under certain circumstances Xt waits
	* forever looking for X events, ignoring alternate
	* inputs.  The fix is to never sleep forever.
	*/
	int sleepID = OS.XtAppAddTimeOut (xtContext, 100, 0, 0);
	boolean result = OS.XtAppPeekEvent (xtContext, xEvent);
	if (sleepID != 0) OS.XtRemoveTimeOut (sleepID);
	return result;
}
++++++++++++++++++++++++++
Comment 6 Tim Koss CLA 2002-02-05 18:12:51 EST
Could I please get a version of this patch to try in the form of the swt.jar for 
org.eclipse.swt for Eclipse 1.0 for Linux?
Comment 7 Silenio Quarti CLA 2002-02-06 11:29:12 EST
Created attachment 310 [details]
R1.0 JAR containing the fix (original name swt.jar)
Comment 8 Tim Koss CLA 2002-02-06 12:35:37 EST
I donwloaded the attached swt.jar and it seems very different from the Eclipse 
1.0 jar:

attached jar: 364 files, 1,793 kb
Eclipse 1.0 swt jar: 458 files, 1,056 kb
Comment 9 David Whiteman CLA 2002-02-06 12:51:42 EST
Actually, the Eclipse 1.0 jar was 1506kb, not 1056.  The SWT version number was 
1137.  Since the file swtsrc.jar is included in Eclipse 1.0, I'd assume one 
could just modify that one method there and recompile the contents.
Comment 10 Tim Koss CLA 2002-02-06 12:57:54 EST
Yes, I could load this and recompile, but I would really like to test on the 
true candidate jar, not one that I created
Comment 11 Silenio Quarti CLA 2002-02-06 13:53:37 EST
I downloaded "eclipse-SDK-R1.0-linux-motif.zip" from www.eclipse.org
and the swt.jar in the zip has 364 files. Are you comparing the new jar
with the jar for Windows instead of Linux/Motif?
Comment 12 David Whiteman CLA 2002-02-06 14:00:08 EST
D'oh!  Sorry about that.  I made that mistake, I don't know about Tim.
Comment 13 Tim Koss CLA 2002-02-06 14:44:32 EST
You are correct, I looked at the wrong one
Comment 14 Stef van Dijk CLA 2002-02-07 15:05:13 EST
I have been running with the jar Tim created, and while less frequent, the workbench is still crashing on Linux.I am attaching the latest dump I received in the console (stefCrash.txt).
Comment 15 Stef van Dijk CLA 2002-02-07 15:07:45 EST
Created attachment 328 [details]
dump written to console
Comment 16 Silenio Quarti CLA 2002-02-07 16:27:18 EST
The problem Stef is seeing is not the same problem as
to one described by this PR which is hang/deadlock, not
a GPF.

The GPF problem has been fixed a while ago and requires
a change in our C code. I could not find the PR associated
with it though.

Anyway, I will attach a new SWT shared library so that
you can try out.

Which change are you interested? I mean which change should
be in the patch?
Comment 17 Silenio Quarti CLA 2002-02-07 16:34:20 EST
Created attachment 329 [details]
SWT shared library (original name "libswt-linux-1137.so")