Skip to content

Make IGV start on GraalVM 24.0.1 #11409

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JaroslavTulach
Copy link
Contributor

I have problems launching IGV on GraalVM 24.0.1. It yields following error:

Executing: /bin/sh -c '/home/devel/NetBeansProjects/graalvm/graal/visualizer/IdealGraphVisualizer/application/target/idealgraphvisualizer/bin/idealgraphvisualizer' '--userdir' '/home/devel/NetBeansProjects/graalvm/graal/visualizer/IdealGraphVisualizer/application/target/userdir' '-J-Dnetbeans.logger.console=true' '-J-ea' '--branding' 'idealgraphvisualizer' '--jdkhome' '/home/devel/bin/graalvm-24'
WARNING: package com.sun.tools.javadoc.main not in jdk.javadoc
Error occurred during initialization of VM
java.lang.Error: A command line option has attempted to allow or enable the Security Manager. Enabling a Security Manager is not supported.
	at java.lang.System.initPhase3(java.base@24.0.1/System.java:1947)

The problem is that JDK 24 has removed SecurityManager support and as the NetBeans Platform launcher needs to be adjusted to that. Such an adjustment has happened in NetBeans 26. Hence upgrading.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jun 14, 2025
@@ -117,7 +117,7 @@
<module>ViewerApi</module>
</modules>
<properties>
<netbeans.version>RELEASE220</netbeans.version>
<netbeans.version>RELEASE260</netbeans.version>
Copy link
Contributor Author

@JaroslavTulach JaroslavTulach Jun 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change I can built regularly:

/graal/visualizer/IdealGraphVisualizer$ JAVA_HOME=/graalvm-21/ mvn install

and then execute on GraalVM 24.0.1 (which was failing previously):

/graal/visualizer/IdealGraphVisualizer$ JAVA_HOME=/graalvm-24 mvn -f application/ \
   -Dexec.vmArgs= -Dexec.appArgs= \
  nbm:cluster-app nbm:run-platform

@@ -45,7 +46,12 @@
public class GraphTypeModeSelector implements ModeSelector {
@Override
public Mode selectModeForOpen(TopComponent tc, Mode mode) {
if (tc.getLookup().lookup(InputGraph.class) == null) {
try {
if (tc.getLookup().lookup(InputGraph.class) == null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change I couldn't open any file in the editor. I was getting exception like this one

obrazek

@JaroslavTulach
Copy link
Contributor Author

JaroslavTulach commented Jun 15, 2025

@tkrodriguez: weird unit test failures when running them on 24b

  • building and running unit tests needs to be done on JDK21
  • looks like JDK24 increased the security checks again
  • and IGV modules can no longer access Graal code in the JDK
  • I haven't investigated any details, but probably some --add-opens or --add-exports when launching IGV would help

With following command line the execution gets further:

/graal/visualizer/IdealGraphVisualizer$ ./application/target/idealgraphvisualizer/bin/idealgraphvisualizer -J--add-exports=jdk.graal.compiler/jdk.graal.compiler.graphio.parsing.model=ALL-UNNAMED -J--add-exports=jdk.graal.compiler/jdk.graal.compiler.graphio.parsing=ALL-UNNAMED -J-Dnetbeans.logger.console=true --userdir ~/tmp/igvud3 --jdkhome ~/bin/graalvm/

why IGV needs to access graphio.parsing from a JDK and how you want to make sure it gets the right version on different JVMs, is beyond ambitions of this PR...

@fniephaus fniephaus requested a review from tkrodriguez June 16, 2025 10:14
@tkrodriguez
Copy link
Member

I'm already looking into this and as you say it's more complicated than just bumping to RELEASE260. We don't want to access jdk.graal.compiler.graphio.parsing.model from the JDK as there is already a module in IGV that contains this code. The presence of jargraal in GraalVM seems to break this and I'm not sure how to stop that. An Oracle JDK24, which contains only libgraal, doesn't have this problem but the actual unit tests fail other ways. The IGV application seems to run ok for me though. I guess your exception fix above is probably related to the jargraal problem though.

@tkrodriguez
Copy link
Member

I've got a working update at #11421 including a workaround for the GraalVM JDK 24 IGV problem. Could you test it out?

@JaroslavTulach
Copy link
Contributor Author

JaroslavTulach commented Jun 17, 2025

We don't want to access jdk.graal.compiler.graphio.parsing.model from the JDK as there is already a module in IGV that contains this code.

I see. I didn't realize it before. In such case, the 3637a2d is the right fix.

I've got a working update at #11421 including a workaround for the GraalVM JDK 24 IGV problem. Could you test it out?

Done. It seems to be broken: #11421 (comment) - probably 3637a2d is necessary.

@tkrodriguez
Copy link
Member

Thanks for that fix. I'll try that out. If it can resolve our GraalVM 24 jargraal issue that would be great.

@tkrodriguez
Copy link
Member

That seems to have improved things, but I still need to disable JVMCI or I get exceptions like this when processing filters:

Error(s) encountered when executing filter Coloring:
java.lang.IllegalStateException: javax.script.ScriptException: javax.script.ScriptException: org.graalvm.polyglot.PolyglotException: TypeError: instantiate on jdk.graal.compiler.graphio.parsing.model.Properties$RegexpPropertyMatcher failed due to: Message not supported.
	at org.graalvm.visualizer.filter.CustomFilter.applyWith0(CustomFilter.java:311)
	at org.graalvm.visualizer.filter.CustomFilter.applyWith(CustomFilter.java:273)
	at org.graalvm.visualizer.filter.profiles.impl.FilterBridge.applyWith(FilterBridge.java:222)

Maybe other modules need to have the OpenIDE-Module-Hide-Classpath-Packages stuff?

@tkrodriguez
Copy link
Member

I just added it to every manifest.mf and that seems to have resolved the problem. I'm respinning my changes with all your suggestions. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants