Community
Participate
Working Groups
Build Identifier: 3.6.1.v3655c Our Eclipse based application was running when the screen saver on Mac OS X locked after a couple of minutes of activity. When the user came back, and unlocked the screensaver, the application crashed with a Apple crash report. When looking at the crash report, its clear that there is a never ending loop in the stack, that looks like this: j org.eclipse.swt.internal.carbon.OS.SelectWindow(I)V+0 j org.eclipse.swt.widgets.Shell.setActive()V+16 j org.eclipse.swt.widgets.Shell.bringToTop(Z)V+20 j org.eclipse.swt.widgets.Control.forceFocus()Z+60 j org.eclipse.swt.widgets.Control.setTabItemFocus()Z+10 j org.eclipse.swt.widgets.Control.setTabGroupFocus()Z+1 j org.eclipse.swt.widgets.Control.traverseGroup(Z)Z+93 j org.eclipse.swt.widgets.Shell.kEventWindowActivated(III)I+169 J org.eclipse.swt.widgets.Widget.windowProc(III)I J org.eclipse.swt.widgets.Display.windowProc(III)I v ~StubRoutines::call_stub j org.eclipse.swt.internal.carbon.OS.SelectWindow(I)V+0 j org.eclipse.swt.widgets.Shell.setActive()V+16 j org.eclipse.swt.widgets.Shell.bringToTop(Z)V+20 j org.eclipse.swt.widgets.Control.forceFocus()Z+60 j org.eclipse.swt.widgets.Control.setTabItemFocus()Z+10 j org.eclipse.swt.widgets.Control.setTabGroupFocus()Z+1 j org.eclipse.swt.widgets.Control.traverseGroup(Z)Z+93 j org.eclipse.swt.widgets.Shell.kEventWindowActivated(III)I+169 J org.eclipse.swt.widgets.Widget.windowProc(III)I J org.eclipse.swt.widgets.Display.windowProc(III)I v ~StubRoutines::call_stub This is repeated 100s of times. The root cause, at the very bottom of the stack, is a call to setFocus() on the Window. The problem is intermittent -- and not easy to reproduce. The Apple crash stack will be attached. Reproducible: Always Steps to Reproduce: Difficult to reproduce, but the application crash stack has been recorded. To reproduce, setFocus must be called at exactly the correct time as when the screensaver is locking.
Created attachment 187775 [details] Apple crash report showing infinite loop in SWT Apple crash report showing infinite loop in SWT
Amazingly enough, this is the same problem we're fixing in bug 329872. Calling SelectWindow, presumably when the application is not currently active, leads to an infinite loop. That might be a better fix than the one I wrote, but in any event the stack is the same. *** This bug has been marked as a duplicate of bug 329872 ***