Launching fails with Equinox weaving and Scala debugger
Seems to be a Mac OS X problem. When launching a debugging session of an Eclipse project (not sure the weaving launcher is involved), it fails immediately. Adding `-XstartOnFirstThread` fixes the issue.
A few more pointers:
While debugging I didn't notice any difference in the command line arguments passed to the JVM, but somehow the successful launch has `-XstartOnFirstThread` right after `java` (the first argument). That is weird, because it comes in before `-agentlib:...` (that is hard-coded in the standard launcher), while the normal launch configuration cmd arguments come after `agentlib`. This suggests some special treatment in the belly of Eclipse launchers that I could not dig out.
A few more pointers:
- the Equinox Weaving Launcher replaces the default Eclipse launch JVM command line arguments, instead of appending. The original arguments contain `-XstartOnFirstThread`
- when I try to reproduce this in a debugged VM, both the Scala launcher and the plain weaving launcher behave the same (don't work), which is consistent with the point above
- however, that is not the whole story: my Eclipse installation consistently works fine with the weaving launcher, but not with the Scala launcher.
While debugging I didn't notice any difference in the command line arguments passed to the JVM, but somehow the successful launch has `-XstartOnFirstThread` right after `java` (the first argument). That is weird, because it comes in before `-agentlib:...` (that is hard-coded in the standard launcher), while the normal launch configuration cmd arguments come after `agentlib`. This suggests some special treatment in the belly of Eclipse launchers that I could not dig out.
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:4282)
at org.eclipse.swt.SWT.error(SWT.java:4197)
at org.eclipse.swt.SWT.error(SWT.java:4168)
at org.eclipse.swt.widgets.Display.error(Display.java:1065)
at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822)
at org.eclipse.swt.widgets.Display.create(Display.java:805)
at org.eclipse.swt.graphics.Device.<init>(Device.java:130)
at org.eclipse.swt.widgets.Display.<init>(Display.java:696)
at org.eclipse.swt.widgets.Display.<init>(Display.java:687)
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:716)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(IDEApplication.java:153)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:95)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
An error has occurred. See the log file
/Users/dragos/Documents/runtime-New_configuration/.metadata/.log.
Leave a comment
on 2012-10-24 10:44 *
By Iulian Dragos
Description changed from Seems to be a Mac OS X prob... to Seems to be a Mac OS X prob...
on 2012-11-12 10:43 *
By Iulian Dragos
Summary changed from Launching fails with Equinox weaving and Scala debggeer to Launching fails with Equinox weaving and Scala debugger
It is a hell of a ticket: no reproduction in a debugger, but I can reproduce it in my installed Eclipse. Given that there is such a simple workaround (simply add `-XstartOnFirstThread`, and it only happens on Mac OSX, for our own launcher), I will put this aside.
My findings are in the ticket description
My findings are in the ticket description
on 2012-11-22 13:15 *
By Iulian Dragos
Description changed from Seems to be a Mac OS X prob... to Seems to be a Mac OS X prob...
on 2012-11-22 13:15 *
By Iulian Dragos
Description changed from Seems to be a Mac OS X prob... to Seems to be a Mac OS X prob...
on 2013-01-08 10:24 *
By Iulian Dragos
We should document the workaround.
on 2015-03-27 15:40 *
By Simon Schäfer
Version changed from 2.1.0-nightly-210 to 4.0.0
Milestone changed from Helium SR1 to Lithium