Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS 14.3 M2: RCP application blank screen with Temurin 17.0.10 #1012

Open
ivy-lli opened this issue Jan 29, 2024 · 90 comments
Open

MacOS 14.3 M2: RCP application blank screen with Temurin 17.0.10 #1012

ivy-lli opened this issue Jan 29, 2024 · 90 comments
Labels
bug Something isn't working help wanted Extra attention is needed macOS happens on macOS

Comments

@ivy-lli
Copy link

ivy-lli commented Jan 29, 2024

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

  1. Install Eclipse RCP 2023-12 (4.30.0) https://www.eclipse.org/downloads/packages/release/2023-12/r/eclipse-ide-rcp-and-rap-developers
  2. Create a new RCP application, done as described here: https://www.vogella.com/tutorials/EclipseRCP/article.html#generatetemplatewithcontent
  3. Add Temurin 17.0.10 to Eclipse
    • Open Preferences
    • Java > Installed JREs
    • Add...
    • Select it
    • Apply
  4. Start the Eclipse application as described in the tutorial (Step 2)
    -> Empty application
  5. Close the Eclipse application
  6. Add Temurin 17.0.9 to Eclipse
    • Same as step 3
  7. Make sure the Eclipse application uses Temurin 17.0.9
    • Run
    • Run configurations...
    • Choose our Eclipse Application
    • Java Runtime Environment
    • Runtime JRE: select Temurin 17.0.9
    • Apply
  8. Start the Eclipse application
    -> Application with sample content

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

Temurin 17.0.9:
299993541-2c9b71ae-e0f9-482f-91d9-8df9be20ea8b

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • All OS
    • Windows
    • Linux
    • macOS
  1. Additional OS info (e.g. OS version, Linux Desktop, etc)
    OS: MacOS Sonoma 14.3
    Platform: MacBook Pro M2, 2023

  2. JRE/JDK version
    Temurin 17.0.10:

openjdk version "17.0.10" 2024-01-16 
OpenJDK Runtime Environment Temurin-17.0.10+7 (build 17.0.10+7) 
OpenJDK 64-Bit Server VM Temurin-17.0.10+7 (build 17.0.10+7, mixed mode)

Temurin 17.0.9:

openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode)

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: adoptium/adoptium-support#1008

@iloveeclipse
Copy link
Member

Could you please try with latest 4.31 nightly build?

@ivy-lli
Copy link
Author

ivy-lli commented Jan 29, 2024

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:
image

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.

@ivy-lli
Copy link
Author

ivy-lli commented Jan 29, 2024

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.

@merks
Copy link
Contributor

merks commented Jan 29, 2024

Note that this works on Windows:

image

image

Are there any clues in the console?

image

@HeikoKlare
Copy link
Contributor

I just tried with yesterday's I-Build artifacts started from current sources:
Version: 2024-03 (4.31)
Build id: I20240128-1800

image

Plain SWT applications work fine:
image

Log is empty.

@ivy-lli
Copy link
Author

ivy-lli commented Jan 29, 2024

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...

eclipse_rcp-startup.log

@ivy-lli
Copy link
Author

ivy-lli commented Jan 29, 2024

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.

@Phillipus
Copy link
Contributor

Phillipus commented Jan 29, 2024

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

@merks
Copy link
Contributor

merks commented Jan 29, 2024

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?

image

@HeikoKlare
Copy link
Contributor

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.

@Phillipus
Copy link
Contributor

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.

@merks
Copy link
Contributor

merks commented Jan 29, 2024

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. 😱

@ivy-lli
Copy link
Author

ivy-lli commented Jan 29, 2024

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:
image

@Phillipus
Copy link
Contributor

Phillipus commented Jan 29, 2024

Tested on macOS Ventura and it's OK. So seems to be a combination of:

  • macOS Sonoma
  • Temurin JDK 17.0.10+7
  • Launching child Eclipse/RCP app

Plain SWT Snippets are OK and work as expected when launched from Eclipse.

@Phillipus
Copy link
Contributor

Same problem with Temurin 21.0.2+13 (but OK with 21.0.1+12).

@iloveeclipse
Copy link
Member

Is that something related to "signing" of the app, may be some old signing algorithms / keys etc were revoked in new JVM's?

@Phillipus
Copy link
Contributor

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.

@Phillipus
Copy link
Contributor

Phillipus commented Jan 29, 2024

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):

  1. Install Temurin JDK 17.0.10+7 or 21.0.2+13
  2. Install vanilla Eclipse SDK for macOS here
  3. Add Temurin JDK to Eclipse from Eclipse's Settings - Java -> Installed JREs - Add
  4. Create a new Debug Launch Configuration of product org.eclipse.sdk and Runtime JRE of the Temurin JDK
  5. Launch child Eclipse from this configuration

@merks
Copy link
Contributor

merks commented Jan 29, 2024

FYI, 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:

image

image

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?

@Phillipus
Copy link
Contributor

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.

@iloveeclipse
Copy link
Member

I don't know how we can proceed to solve this one.

Divide and conquer.

Possible issues could be in

  • e4 css code (the one that renders seem not work)
  • SWT Mac code (the one that draws)
  • PDE code (the one that prepares target/ dependencies before start)
  • Equinox code (the one that resolves dependencies at runtime)
  • Platform runtime code (may be some exceptions are swallowed)
  • JVM code (some weird security fix that breaks rendering by not running some "dangerous" part of the code)
  • 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
  • whatever else

So one should try to reduce the problem to smallest possible example and see which partis responsible here.

  • Reduce to simplest possible example code and debug that part that causes example to not render
  • Disable css by disabling themes support in Eclipse
  • Start with the JVM arguments I've given above
  • Check JDK fixed bugs for a good candidate (similar to xpath above)
  • Debug with breakpoint created on "Exception" that might be swallowed
  • Profile with Yourkit or ny other profiler and check for exceptions / problems reported there
  • Enable tracing, etc

Since I don't have Mac, I can't help further ...

@merks
Copy link
Contributor

merks commented Jan 29, 2024

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:

image

So I guess there is no good way to compare how launched processes might be different...

I wish I could help more effectively. 😢

@Phillipus
Copy link
Contributor

Phillipus commented Jan 29, 2024

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.

@HeikoKlare
Copy link
Contributor

  • 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:

image

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.

@Phillipus
Copy link
Contributor

Phillipus commented Jan 29, 2024

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.

@Phillipus
Copy link
Contributor

We can rule out e4 css code because I set up child Eclipse to not use themes and same problem.

@Phillipus
Copy link
Contributor

Phillipus commented Jan 29, 2024

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.

@Phillipus
Copy link
Contributor

Phillipus commented Jan 29, 2024

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.

  • This problem only manifests on macOS Sonoma (14). It's OK on Ventura (13).
  • It only manifests on launching a child Eclipse or RCP instance because that is launched with the java binary in the command line
  • It does not manifest when launching native Eclipse because that is launched with the eclipse launcher executable which has been created using an earlier macOS SDK
  • Why this change of SDK should cause the problem in SWT/Equinox/Whatever is unknown
  • Today this means that Mac developers cannot target the latest Temurin JDK if they want to debug Eclipse or RCP apps
  • If ever the Eclipse Mac launcher is built using macOS SDK 14 the same problem will occur when launching native Eclipse and Eclipse will be unusable on Mac Sonoma with the latest JDK

Worthy of investigation is why SWT Snippets are running OK.

@Phillipus
Copy link
Contributor

@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?

merks pushed a commit that referenced this issue Mar 11, 2024
- Add a new selector setClipsToBounds
- Set this selector to true in Widget#drawRect
- See #1012
@Phillipus
Copy link
Contributor

This seems to be fixed in the latest I-Build after PR #1081 was merged

I also tested the latest I-Build on aarch64 by replacing the eclipse launcher binary in the Eclipse.app/Contents/MacOS directory with the one built with SDK 14 and the fix works in that case, too.

If anyone is able to test the latest I-Build, please do.

@ivy-lli
Copy link
Author

ivy-lli commented Mar 12, 2024

Thanks for all of your work!

I quickly tested the snippet here: #1012 (comment)
With the I-Build: Eclipse 4.32.0 Integration Build: I20240311-1800
MacOS 14.4 M2, Temurin 17.0.10

Seems to work fine 👍

@Phillipus
Copy link
Contributor

Phillipus commented Mar 12, 2024

@ivy-lli Thanks for testing. 👍

A more realistic test is to launch a child Eclipse instance with the latest Temurin Java as target.

@ivy-lli
Copy link
Author

ivy-lli commented Mar 13, 2024

I've also tried my initial report scenario, the example rcp:

  • For that I downloaded the newest Eclipse SDK and installed all addional software (as I honstely have no idea what is needed to make a rcp example runnable in a normal Eclipse SDK).
  • Opened the existing workspace with the example rcp application
  • Run the example application with the Temurin JRE 17.0.9 and 17.0.10

Result: It seems to work now again with both JRE's

17.0.9
image

17.0.10
image

@merks
Copy link
Contributor

merks commented Mar 13, 2024

Thanks again for testing!

@akurtakov
Copy link
Member

Should this one be closed now?

@Fnux8890
Copy link

Im experiencing this on MacOS 14.3 on an Intel processor on a MacBook Pro.
Im using openJDK 17 and 21 but could try Temurin if that is a key difference.

image

If this is fixed what would I need to do to get that fix? 🙏

@Phillipus
Copy link
Contributor

This issue shouldn't affect OpenJDK as their binaries are not compiled/linked to macOS 14.

what would I need to do to get that fix?

Use the latest I-builds of Eclipse or SWT.

@Phillipus
Copy link
Contributor

Phillipus commented May 15, 2024

This is not completely fixed.

I'm seeing blank areas when using a Tabbed Properties control:

Screenshot 2024-05-15 at 17 11 34

It should look like this:

Screenshot 2024-05-15 at 17 11 49

The fix applied in #1081 is not enough. If we apply it to NSView it works:

public NSView(long id) {
	super(id);
	OS.objc_msgSend(id, OS.sel_setClipsToBounds_, true);
}

But as explained in #1081 (comment) we can't add it there.

I think that unless we apply the fix in a place where it catches all cases we'll continue to see this bug re-appear.

@lshanmug Can you please advise?

Phillipus added a commit to Phillipus/eclipse.platform.swt that referenced this issue May 15, 2024
- OS.objc_msgSend(id, OS.sel_setClipsToBounds_, true) needs to be applied in two more cases

- See eclipse-platform#1012
@Phillipus
Copy link
Contributor

New PR: #1232

@chrisrueger
Copy link

chrisrueger commented Jul 17, 2024

Also seeing this with Eclipse (but scroll down, how I got it working with a lower Temurin JDK)

  • Version: 2024-06 (4.32.0)
  • Build id: 20240606-1231

and

  • Macbook Air M3 2024
  • MacOS Sonoma 14.5 (23F79)

and

  • OpenJDK Runtime Environment Temurin-17.0.11+9 (build 17.0.11+9) (installed via .pkg at /Library/Java/JavaVirtualMachines/temurin-17.jdk)
  • as well as OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS) (installed via .pkg at /Library/Java/JavaVirtualMachines/temurin-21.jdk)
image image

For sake of reproduction:

But it works with JDK Temurin 17.0.9+9

I did not have this problem on my Macbook Pro M1.
There I was running JDK Temurin 17.0.9+9.

When I use this JDK Temurin 17.0.9+9 on my M3, it works 🥳

image

image

Summary:

  • Works with https://github.com/adoptium/temurin17-binaries/releases/tag/jdk-17.0.9%2B9 installed as extracted tar into /Users/me/Documents/development/jdks/jdk-17.0.9+9
  • does not work with
    • OpenJDK Runtime Environment Temurin-17.0.11+9 (build 17.0.11+9) (installed via .pkg at /Library/Java/JavaVirtualMachines/temurin-17.jdk)
    • as well as OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS) (installed via .pkg at /Library/Java/JavaVirtualMachines/temurin-21.jdk)

@Phillipus
Copy link
Contributor

Phillipus commented Jul 17, 2024

@chrisrueger This should all be fixed in Eclipse 4.32. If you are still seeing a blank UI when running a child Eclipse instance then perhaps your target Eclipse SDK version is an earlier version?

@chrisrueger
Copy link

@chrisrueger This should all be fixed in Eclipse 4.32. If you are still seeing a blank UI when running a child Eclipse instance then perhaps your target Eclipse SDK version is an earlier version?

Yes that is the case. Bndtools so far always uses an earlier version. There is an open issue at bnd bndtools/bnd#5815

So then i think i am fine with my workaround to uses temurin 17.0.9+9 and i will talk with the bnd team about it.

@Phillipus
Copy link
Contributor

Phillipus commented Jul 17, 2024

Another alternative is to use a non-Temurin target JDK (OpenJDK, Azul, etc) that has not been built/linked linked to macOS 14 SDK.

@Phillipus
Copy link
Contributor

Another alternative is to use a non-Temurin target JDK (OpenJDK, Azul, etc) that has not been built/linked linked to macOS 14 SDK.

To find out which macOS SDK the JDK has been linked to:

  1. Navigate to the java binary executable (typically found in <jdk-root-folder>/Contents/Home/bin)
  2. Open the Terminal and run this command: vtool -show java
  3. Look for the sdk entry in the output

Temurin 17.0.11+9 gives the following output and you can see the sdk 14.0 entry which indicates that this JDK will cause problems on earlier versions of Eclipse:

Load command 10
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform MACOS
    minos 11.0
      sdk 14.0
   ntools 1
     tool LD
  version 1022.1
Load command 11
      cmd LC_SOURCE_VERSION
  cmdsize 16
  version 0.0

Azul JDK gives the following output and you can see the sdk 13.3 entry which indicates that this JDK will be OK:

Load command 10
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform MACOS
    minos 11.0
      sdk 13.3
   ntools 1
     tool LD
  version 857.1
Load command 11
      cmd LC_SOURCE_VERSION
  cmdsize 16
  version 0.0

chrisrueger added a commit to chrisrueger/bnd that referenced this issue Jul 17, 2024
It seems we can stay on older Eclipse 4.25 but use a higher SWT version which has fixed the SWT bug (see eclipse-platform/eclipse.platform.swt#1012).

Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
chrisrueger added a commit to chrisrueger/bnd that referenced this issue Jul 17, 2024
It seems we can stay on older Eclipse 4.25 but use a higher SWT version which has fixed the SWT bug (see eclipse-platform/eclipse.platform.swt#1012).

Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed macOS happens on macOS
Projects
None yet
Development

No branches or pull requests