Open ivy-lli opened 5 months ago
Could you please try with latest 4.31 nightly build?
One addition
I quickly wanted to see if this bug is also the case if I use the shipped JDK just j in version 17.0.10.
As the Eclipse 4.30 is shipped with the latest JDK v21, I installed the JustJ laster 17 package via the software manager, which then removed the v21 and installed the v17.0.10. After the installation, I restarted Eclipse as said, and now it is not starting at all:
I'm not sure if it has to do with the same problem, but now I have a log file: 1706519978372.log
I just wanted to mention it, but as said, maybe it has nothing to do with the bug of this issue.
Tried it with Version: 2024-03 M1 (4.31.0 M1) / Build id: 20240111-1612
Same problem, with Temurin 17.0.10 the screen in blank, with Temurin 17.0.9 everything seems to work as expected.
Note that this works on Windows:
Are there any clues in the console?
I just tried with yesterday's I-Build artifacts started from current sources: Version: 2024-03 (4.31) Build id: I20240128-1800
Plain SWT applications work fine:
Log is empty.
I just tried with yesterday's I-Build artifacts started from current sources: Version: 2024-03 (4.31) Build id: I20240128-1800
Yes exaclty the first image I've got with our real RCP application, I just wanted to create an issue on a simple reproducable way, what is the reason why I tried it with a base RCP application too.
I started once again and now I've got a log, but not sure if this has something to do with it, maybe it is also because of some config changes...
I think it also works with Linux (latest linux mint 21.3). I have an internal coworker which shortly tried our application with Temurin 17.0.10 at it seems to work fine.
I can confirm this. Launching a child Eclipse or an RCP app with Temurin JDK 17.0.10+7 leads to a totally blank app.
MacBook M2 Sonoma 14.3
The log just makes it sound like some bundle was not included in the launch configuration. It looks like the leaf cause is this failure:
Unresolved requirement: Import-Package: org.apache.commons.io; version="[1.4.0,2.0.0)"
But how that's related to the JRE version is entirely unclear.
Could you maybe try to add the bundle explicitly?
Note that my screenshot with an empty RCP application is taken without any log errors. After switching back to Temurin 17.0.9 with the exact same workspace setup, the application looks good.
Note that my screenshot with an empty RCP application is taken without any log errors. After switching back to Temurin 17.0.9 with the exact same workspace setup, the application looks good.
Same here. I'm using vanilla Eclipse SDK from here.
So one very strange thing here is that Eclipse itself works fine, just not an RCP application. There is no clue or theory for how that is possible, and I can't reproduce it because I'm on Windows so I cannot help in this regard. 😱
The log just makes it sound like some bundle was not included in the launch configuration. It looks like the leaf cause is this failure:
Unresolved requirement: Import-Package: org.apache.commons.io; version="[1.4.0,2.0.0)"
But how that's related to the JRE version is entirely unclear.
Could you maybe try to add the bundle explicitly?
Makes no difference:
Tested on macOS Ventura and it's OK. So seems to be a combination of:
Plain SWT Snippets are OK and work as expected when launched from Eclipse.
Same problem with Temurin 21.0.2+13 (but OK with 21.0.1+12).
Is that something related to "signing" of the app, may be some old signing algorithms / keys etc were revoked in new JVM's?
Is that something related to "signing" of the app, may be some old signing algorithms / keys etc were revoked in new JVM's?
I don't think so. These JDKs work fine if you use them to run Eclipse or an RCP app directly. The problem is when launching a child Eclipse / RCP app from Eclipse to run/debug it. The menus are rendered but not the app's contents.
I don't know how we can proceed to solve this one.
The situation as it stands means that if someone is running macOS Sonoma and has one of these versions of the Temurin JDK installed (currently 17.0.10+7 and 21.0.2+13) they will be able to run Eclipse OK but they will not be able to debug launch a working child instance of Eclipse or an RCP application.
FWIW simple steps to reproduce (on macOS Sonoma):
org.eclipse.sdk
and Runtime JRE of the Temurin JDKFYI, to reproduce using the installer one can install anything with 17.0.10 or 21.0.2 which will also use that as the JRE in that installed IDE:
It just seems bizarre that the IDE itself works (does it?) yet something is failing in the launched application (but not in SWT snippets), and nothing is in the log as an indicator...
I assume the failure is in any launch, not just a debug launch but also a run launch?
It just seems bizarre that the IDE itself works (does it?) yet something is failing in the launched application (but not in SWT snippets), and nothing is in the log as an indicator...
Yes the IDE itself works. Problem is only the launched app. SWT Snippets are OK too.
I assume the failure is in any launch, not just a debug launch but also a run launch?
Yep, I tried that.
I don't know how we can proceed to solve this one.
Divide and conquer.
Possible issues could be in
-Djdk.xml.xpathExprGrpLimit=0 -Djdk.xml.xpathExprOpLimit=0 -Djdk.xml.xpathTotalOpLimit=0
So one should try to reduce the problem to smallest possible example and see which partis responsible here.
Since I don't have Mac, I can't help further ...
I'm not sure how on mac java is launched. I think it uses some library in the JDK/JRE rather than like the way java executable is used directly for a launched application:
So I guess there is no good way to compare how launched processes might be different...
I wish I could help more effectively. 😢
When Eclipse or an RCP app is run from desktop it runs from the launcher binary file (Eclipse.app/Contents/MacOS/eclipse
).
On Mac, a child Eclipse launches using the java
binary. We can see that in the launch config dialog "Command Line".
The latest Mac Eclipse launcher binary is built using Mac SDK 13 while these versions of Temurin are built using Mac SDK 14. (You can determine this with the command vtool -show /path/to/binary
will show this.)
I think this is the problem.
We can rule out the Eclipse IDE by copying the launch config's command line and editing it to get rid of extra stuff. For me:
/Users/phillipus/Desktop/jdk-17.0.10+7/Contents/Home/bin/java \
-XstartOnFirstThread \
-classpath /Users/phillipus/projekts/archi/workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar org.eclipse.equinox.launcher.Main \
-product org.eclipse.sdk.ide \
-data /Users/phillipus/projekts/archi/workspace/../runtime-New_configuration \
-configuration file:/Users/phillipus/projekts/archi/workspace/.metadata/.plugins/org.eclipse.pde.core/New_configuration/ \
-consoleLog
Running the above in Terminal give a blank Eclipse window.
- e4 css code (the one that renders seem not work)
One thing that would support this is that actually everything seems to "exist", but is simply not rendered correctly. You can see that the cursor changes on buttons, you can click buttons, open context menus etc. For example, you can open another dialog:
- Btw, there was earlier a fix in JVM that introduced some stack limits for xml parsing - so if now the stack is longer, we may hit that limit. Try to start with
-Djdk.xml.xpathExprGrpLimit=0 -Djdk.xml.xpathExprOpLimit=0 -Djdk.xml.xpathTotalOpLimit=0
I've tried these options, but they did not change anything.
Unfortunately I can currently not invest much into investigating this issue, since I work on Windows and only have Mac for SWT/Platform UI validation tasks.
The latest Mac Eclipse launcher binary is built using Mac SDK 13 while these versions of Temurin are built using Mac SDK 14. (You can determine this with the command vtool -show /path/to/binary will show this.)
The current Eclipse launcher binary is built using macOS SDK 13 (vtool -show Eclipse.app/Contents/MacOS/eclipse
will show this). It might be that if ever it is built using SDK 14 we will see the same problem.
We can rule out e4 css code because I set up child Eclipse to not use themes and same problem.
From further testing I'm pretty certain the difference is because the java
binary has been built using macOS SDK 14. Why this causes the problem in SWT I don't know.
I replaced just the java
binary file with one from an earlier Temurin SDK and it is working OK. This supports my theory.
OK, I'm going to summarise the situation based on the assumption that the problem is arising because of Temurin using macOS SDK 14 to create the java
binary.
java
binary in the command lineeclipse
launcher executable which has been created using an earlier macOS SDKWorthy of investigation is why SWT Snippets are running OK.
@SyntevoAlex and @tmssngr I wonder if you could help to test something? The SmartGit app uses its own launcher binary (SmartGit
) which has been built against SDK 11.3 (vtool -show SmartGit
will show this). Is it possible for you to create this binary file using macOS SDK 14 and launch SmartGit with this?
My latest experiments show that the problem is indeed caused by using macOS SDK 14 to create the runtime launcher binary - this will be java
in the case of launching child Eclipse or Eclipse.app/Contents/MacOS/eclipse
in the case of launching Eclipse itself.
On my Mac (with Sonoma 14.3) I built a new equinox launcher file from source - see https://github.com/eclipse-equinox/equinox/tree/master/features/org.eclipse.equinox.executable.feature/library/cocoa
I confirmed that the resulting eclipse
launcher has been compiled with macOS SDK 14.x by running vtool -show eclipse
:
Load command 10
cmd LC_BUILD_VERSION
cmdsize 32
platform MACOS
minos 11.0
sdk 14.2
ntools 1
tool LD
version 1022.1
Load command 11
cmd LC_SOURCE_VERSION
cmdsize 16
version 0.0
In a working version of the Eclipse SDK I replaced the Eclipse.app/Contents/MacOS/eclipse
launcher file with the newly built one and launched Eclipse. The window was blank as shown above.
So, this leads to the next question - why does this cause the problem in Eclipse but not in SWT Snippets?
Attached is the recompiled eclipse
launcher if anyone wants to try it (it's aarch64
version)
So, this leads to the next question - why does this cause the problem in Eclipse but not in SWT Snippets?
Running a Workbench does a lot more than running a main class. Maybe just try to start without any theming enabled?
Maybe just try to start without any theming enabled?
Done that.
Maybe just try to start without any theming enabled?
Done that.
I only see "dark mode" screenshots here, so how does it look in "light mode"?
so how does it look in "light mode"?
And with theming off:
@Phillipus Just a guess but look out for some line like https://github.com/eclipse-platform/eclipse.platform.swt/blob/31e1414709ac286cb0d93f4266257bc6a6a27967/bundles/org.eclipse.swt/Eclipse%20SWT/cocoa/org/eclipse/swt/widgets/Display.java#L2539 - a string comparison of versions . I am not saying this line is the case but I have been bitten by such bugs in the past. Edit: As SWT snippets work I would be looking in jdt/pde launching code doing/lacking some such code.
For my part, I think I've gone as far as I can to help diagnose this one and can't do any more. But the following should be emphasised:
As it stand today this issue affects launching child Eclipse / RCP apps that target the latest SDK 17 and 21. But if the equinox Mac launcher is ever compiled against the later Mac SDK then Eclipse itself will simply not work on Mac.
But if the equinox Mac launcher is ever compiled against the later Mac SDK then Eclipse itself will simply not work on Mac.
Does anyone know how the Equinox build of the Mac launcher is done? I'm assuming it's on a Mac with a given OS (I'm guessing Ventura 13.x). Is there a likelihood in the future that the Mac build machine will be updated to a new OS (Sonoma 14)?
The build artifacts are here: https://github.com/eclipse-equinox/equinox/tree/master/features/org.eclipse.equinox.executable.feature/library
I'd like to emphasise the seriousness of this issue, while also acknowledging that I understand how things are regarding lack of resources, committers and time, especially on Mac.
Today, if an Eclipse developer on Mac downloads and installs Eclipse from Oomph they will be asked to install the latest versions of Temurin Java 17 or 21. Or perhaps they have the latest Temurin Java already installed. If they then launch a child Eclipse / RCP app instance they will come across this issue and it will be unusable.
If and when the Mac native launcher is built using a later SDK (see here) then Eclipse and RCP apps on Mac will simply not function.
The first reports we will see will be like the original post here - a Mac Eclipse/RCP developer launching a child instance of Eclipse/RCP app with the latest JDK. (The workaround is to install an older version of the JDK.)
But, as I said, if/when a later version of Eclipse ships with a launcher binary built with a later Mac SDK then Eclipse will be dead in the water on Mac, and there will be no workaround.
I've spent a lot of time diagnosing this, and I can't determine why it causes the SWT rendering issue. But I think at least a heads-up is necessary.
If anyone could help solve this issue it would ensure that Eclipse continues to work on Mac.
@jonahgraham @akurtakov
Perhaps this another issue that Planning Council should consider prioritizing...
@Phillipus
The issue is often that even if there is funding to do the work, finding the skilled people can remain a challenge...
Apache Hop has the same problem with their Mac version and the latest Temurin JDK 11. A quick look at the source suggests this project uses plain SWT, not the Eclipse Workbench.
It seems that this problem is reproducible with stand-alone SWT code, just not simple examples. Blank parts of the UI can be seen when running some of the SWT Examples.
Ensure you are running macOS Sonoma (14).
Here's some screenshots.
GraphicsExample - how it should look:
GraphicsExample - how it looks with latest Temurin JDK:
TextEditor - how it should look:
TextEditor - how it looks with latest Temurin JDK:
I think I may have found the underlying cause. It has something to do with how some child controls are laid out.
Take the following snippet:
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
public class JDKTest {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Test");
shell.setLayout(new GridLayout());
shell.setSize(200, 150);
Composite comp = new Composite(shell, SWT.NONE);
comp.setLayout(new GridLayout());
comp.setBackground(new Color(255, 128, 128));
Label label1 = new Label(comp, SWT.NONE);
label1.setText("Label 1");
Label label2 = new Label(shell, SWT.NONE);
label2.setText("Label 2");
shell.open();
while(!shell.isDisposed()) {
if(!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
This is how it should look (using an older JDK):
This is how it looks using the latest Temurin JDK on macOS Sonoma:
The composite fills the whole window.
In my experiments with the SWT Examples (see previous post) I found out that some Composite
controls are covering over whole areas of the application leading to blank parts.
The composite fills the whole window.
Cool. So I guess some native SWT code that calculates or queries composite size is now broken on that Mac version? Or it queries / receives wrong size (not from composite but from the parent or entire shell).
@SyntevoAlex @tmssngr You might be interested in this as SmartGit is an SWT-based application that runs on Mac...
SmartGit has its own launcher executable (SmartGit.app/Contents/MacOS/SmartGit
) which, because it has been built using macOS SDK 11, does not display this problem.
However, we can launch SmartGit using the latest Temurin Java
acting as the launcher with this command:
jdk-17.0.10+7/Contents/Home/bin/java -XstartOnFirstThread -jar SmartGit.app/Contents/Resources/Java/bootloader.jar
And SmartGit looks like this with blank areas:
Again, this shows that this is an SWT issue, not an Eclipse Workbench one.
Note - this only happens running on macOS 14.
A better example:
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class JDKTest {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Test");
shell.setLayout(new GridLayout());
shell.setSize(250, 250);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.heightHint = 100;
Composite comp1 = new Composite(shell, SWT.NONE);
comp1.setBackground(new Color(255, 128, 128));
comp1.setLayoutData(gd);
Composite comp2 = new Composite(shell, SWT.NONE);
comp2.setBackground(new Color(128, 255, 128));
comp2.setLayoutData(gd);
shell.open();
while(!shell.isDisposed()) {
if(!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
This is how it should look (using an older JDK):
This is how it looks using the latest Temurin JDK on macOS Sonoma:
So we can see that the first Composite
that is declared covers any other Composites, which explains the blank areas when launching child Eclipse.
This only seems to be happening if the Composite's style is SWT.NONE
. If the style is set to, say, SWT.BORDER
or SWT.H_SCROLL
or SWT.V_SCROLL
it renders correctly.
Also, the same problem if a Label
control is used instead of a Composite
.
I think I may have found the underlying cause. It has something to do with how some child controls are laid out.
Take the following snippet:
import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; public class JDKTest { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Test"); shell.setLayout(new GridLayout()); shell.setSize(200, 150); Composite comp = new Composite(shell, SWT.NONE); comp.setLayout(new GridLayout()); comp.setBackground(new Color(255, 128, 128)); Label label1 = new Label(comp, SWT.NONE); label1.setText("Label 1"); Label label2 = new Label(shell, SWT.NONE); label2.setText("Label 2"); shell.open(); while(!shell.isDisposed()) { if(!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } }
This is how it should look (using an older JDK):
![]()
This is how it looks using the latest Temurin JDK on macOS Sonoma:
![]()
The composite fills the whole window.
In my experiments with the SWT Examples (see previous post) I found out that some
Composite
controls are covering over whole areas of the application leading to blank parts.
Could you please try to set some fixes locations and log the preferred sizes?
Could you please try to set some fixes locations and log the preferred sizes?
Hi, I don't understand what you mean?
Currently, the GridLayout
sets the sizes. It would be interesting to understand whether they are calculated at the wrong time, whether the size for the container is reported wrong, whether the controls report a wrong preferred size, ... Could you please, instead of setting a layout manager simply set the controls some fixes locations, and lot their preferred sizes:
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.*;
public class JDKTest {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Test");
shell.setSize(200, 150);
Composite comp = new Composite(shell, SWT.NONE);
comp.setBackground(new Color(255, 128, 128));
comp.setBounds(10, 10, 50, 30);
Label label1 = new Label(comp, SWT.NONE);
label1.setText("Label 1");
label1.setBounds(5, 5, 40, 20);
Label label2 = new Label(shell, SWT.NONE);
label2.setText("Label 2");
label2.setBounds(10, 40, 40, 20);
System.out.println(label1.computeSize(SWT.DEFAULT, SWT.DEFAULT));
System.out.println(label2.computeSize(SWT.DEFAULT, SWT.DEFAULT));
shell.open();
while(!shell.isDisposed()) {
if(!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
Describe the bug Since the update to Temurin 17.0.10 (from Temurin 17.0.9), my started Eclipse RCP application shows only an empty screen.
To Reproduce
I can also provide the workspace via a GitHub repo, but it is not more than the wizard for new RCP Applications created.
Expected behavior The Eclipse RCP application should also show the sample content
Screenshots Temurin 17.0.10:![299993416-0886d040-5dec-4f6e-8f53-301f224f5484](https://github.com/eclipse-platform/eclipse.platform.swt/assets/42733123/c6310259-0090-46f5-83d2-4e2cb36a62ce)
Temurin 17.0.9:![299993541-2c9b71ae-e0f9-482f-91d9-8df9be20ea8b](https://github.com/eclipse-platform/eclipse.platform.swt/assets/42733123/26a2fe3f-2ed7-4273-8510-ed5a806829ea)
Environment:
Select the platform(s) on which the behavior is seen:
Additional OS info (e.g. OS version, Linux Desktop, etc) OS: MacOS Sonoma 14.3 Platform: MacBook Pro M2, 2023
JRE/JDK version Temurin 17.0.10:
Temurin 17.0.9:
Version since Tested with 4.30
Workaround (or) Additional context I didn't see any log, crash, or something like that. I also already opened an issue at the Temurin site: https://github.com/adoptium/adoptium-support/issues/1008