Crash on Macos using Java 9

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Crash on Macos using Java 9

rchimiak

Dear Sir,

 

When running the following code:

 

    public Canvas3D createCanvas3D(boolean offscreen) {

 

        GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();

        GraphicsDevice d = e.getDefaultScreenDevice();

        GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D();

        GraphicsConfiguration c = d.getBestConfiguration(template);

        template.setSceneAntialiasing(GraphicsConfigTemplate.PREFERRED);

 

        Canvas3D c3d = new Canvas3D(c, offscreen);

        return c3d;

    }

 

Using jdk-9.0.1 (latest) , jogl v2.3.2, and java3d 1,6,0-final

Works well on Windows and Linux, but crashes on Mac  OS X at GraphicsConfiguration c = d.getBestConfiguration(template);

Debugging with latest Netbeans, it seems that the Override of   

GraphicsConfiguration

getBestConfiguration(GraphicsConfiguration[] gc) in GraphicsConfigTemplate3D returns null.

 

Added information: it works on all platforms using latest and earlier versions of java 8 and java 7. 

Thank you for your consideration,  please let me know if there is something else  I should be sending you or trying on my side.  I was trying to avoid going to java 3d 1.7 due to the package name change, but if needs be…

 

Cheers,

Reine Chimiak

 

Reply | Threaded
Open this post in threaded view
|

Re: Crash on Macos using Java 9

gouessej
Administrator
Hi

Java3D 1.6.0 relies on JOGL 2.3.2, the latter needs some complementary settings to work correctly with Java 1.9:
https://jogamp.org/bugzilla/show_bug.cgi?id=1317#c9
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Crash on Macos using Java 9

rchimiak
 I added --add-exports=java.desktop/sun.java2d=ALL-UNNAMED which I did not have originally, but unfortunately it did not help and the application still crashes under the same conditions (mac OS, java 9...).
This is a link to the application that I am working on which relies extensively on java3d:
https://sscweb.gsfc.nasa.gov/tipsod/

Your help is greatly appreciated
Reply | Threaded
Open this post in threaded view
|

Re: Crash on Macos using Java 9

gouessej
Administrator
Please be more accurate and post the full stack trace. Which version of OS X do you use?

Keep in mind that this problem might be caused by a bug in AWT under OS X with a specific version.

P.S: Please try with Java 1.8.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Crash on Macos using Java 9

rchimiak
(1) The  mac Version is : macOS Sierra (Version 10.12.6)

(2) The stack trace is  at (for the next 10 days) :
https://opendrive.gsfc.nasa.gov/shortauth/r/NQei9Oyb

(3) The application works with java 8 on all platforms including this mac
Reply | Threaded
Open this post in threaded view
|

Re: Crash on Macos using Java 9

gouessej
Administrator
Thanks. I know that it's unpleasant but since Oracle bought Java, we usually have to wait for some months to get a really "stable" major version. I still use Java 1.8 in production and I won't switch before 2019. We'll have to revisit this problem later.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Crash on Macos using Java 9

Mike Schnieders
Hi All,

My application (http://ffx.biochem.uiowa.edu) uses Java3D 1.6.0 / JOGL 2.3.2 and was also crashing on Mac OS X under JDK9.

I swapped in Doug Lyon's build of J3D / JOGL (from here http://show.docjava.com/book/cgij/code/jnlp/libs/jogl) and this did the trick!

Thanks to Doug! And thanks to the JogAmp and Java3D developers for all your work.

- Mike
Reply | Threaded
Open this post in threaded view
|

Re: Crash on Macos using Java 9

gouessej
Administrator
It's dangerous, it's not a reliable solution, please stop using the forum to advertise this kind of "trick". The real solution consists in fixing the release of some resources that causes a crash under OS X + Java 1.9. The "trick" works around the real bug and has some nasty side effects, someone will complain about an abnormal high memory footprint... The fact that you don't see the problem in your particular case doesn't mean that it doesn't exist.

I advise you to switch back to the official build in production. Promoting a low quality workaround and encouraging people to use an unofficial self-made build not only for testing purposes don't help the community. Doug Lyon's build should be used only for test.

P.S: Doug Lyon's build doesn't contain a fix of mine affecting some GNU Linux users. You have what you deserve :)
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Crash on Macos using Java 9

schnied
Hi Julien,

The degree of negativity in your response seems a bit unnecessary - ‘You have what you deserve’?. I was clearly trying to be helpful and thank Java3D maintainers such as yourself.

The ‘official’ builds of Java3d 1.6.0 and JOGL 2.3.2 cause my application to crash on Mac OS X under JDK 9, while Doug’s build works. Thus, advising me switch back to the official version is not very helpful if I want to explore using JDK 9 or JDK 10 features.

Perhaps you could suggest when the official J3D / JOGL releases will incorporate a fix to the ‘real bug’?

Thanks,
- Mike



Reply | Threaded
Open this post in threaded view
|

Re: Crash on Macos using Java 9

gouessej
Administrator
Hey

In my humble opinion, Doug's build was useful only to confirm the root cause of the bug and should not be used in production as it may cause a memory leak in the native memory (not in the Java heap). That's why encouraging anyone to use his build is a very bad idea. If many developers use his build, discover an abnormal memory footprint and point out Java3D, it will harm our efforts and some people won't be smart enough to make the distinction between his unofficial build and the official build of Java3D 1.6.0-Final.

You want to use his build to work around a bug with Java 1.9 and OS X but then, you don't use another JAR not provided by Doug with a fix for a bug affecting some Linux users. When JOGL 2.3.3 is released, some developers will go on using the already obsolete JARs provided by Doug. If you really want to use Java 1.9 and 1.10 features not in production only to "explore", why not using another operating system? If it's just for development, what is wrong with that? If you don't absolutely need some Java 1.9 and 1.10 features, you can still ship your software with Java 1.8 and avoid relying on the JRE installed on the system.

It's a JOGL bug for sure. I know where the crash happens in the native code but I haven't found a fix yet and I have no Mac which doesn't help at all for a platform specific bug. What is really frustrating is that some developers who claimed to be willing to contribute content themselves with a dirty workaround with an highly probable nasty side effect and claimed to have fixed the bug whereas it's plain wrong and they could have spent a few days to investigate with me so that we fix the real bug once for all. All this only adds some confusion in the community. To make things clear, if they had provided a clean bug fix, we would have had accepted it.

The help of a developer under OS X is warmly welcome. Keep in mind that we are volunteers. The bug report is here:
https://jogamp.org/bugzilla/show_bug.cgi?id=1317
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Crash on Macos using Java 9

gouessej
Administrator
In reply to this post by schnied
By the way, if you reproduce the crash under Java 1.10, please can you post the logs?
Julien Gouesse | Personal blog | Website