-
Notifications
You must be signed in to change notification settings - Fork 2
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
JOGL 2.4rc4 + JDK Temurin 17.02+8 + SWT 4.23 + macOS + ARM Processor = Crash w/o exception #23
Comments
Just to mention that the use of the SWT GLCanvas provided by JOGL crashes too, but the view appears briefly (and seems valid) before it crashes. |
I had little hope, but who knows ? I have also tested the combination with Azul Zulu and Oracle JDKs -- but the same crash happens. . |
Hi @AlexisDrogoul, |
Thanks :) -- and yes, everything changed except JOGL :) SWT is the version indicated here (https://forum.jogamp.org/JOGL-incompatible-with-SWT-4-21-td4041643.html) as having fixed a bug on Linux. It is actually not already out (I've been working on the RC2a version) but will be soon. The JDKs (Temurin, Zulu and Oracle) are all version 17.02+8, necessary in our case to have Java2D displays, that rely on AWT_SWT, to work correctly on macOS... And finally, I used a M1 MacMini (last time was on Intel). Everything working just fine under Rosetta. And I can tell that the AArch64 library is indeed found and loaded because, sometimes, the display appears very briefly and disappears almost immediately. |
From reading your logs it seams that you are using rc-20210111 instead of While testing on many platforms I noticed that using a non-ARM JDK (hence a JDK made for Intel) on an ARM based Apple M1 will enable Rosetta and hence will make use of JOGL natives made for Intel, which make My first assumption is that you are still using Are you able to verify which JOGL version stand in your java classpath? The |
Thanks for the feedback. 🤔 I'm a bit lost now. Are there binaries I can download of 2.4rc4 that include the M1 natives ? |
I have actually downloaded and used the binaries found here: https://download.jzy3d.org/jogl/. Is there another place I can download 2.4rc4 from ? |
Unfortunately, it seems that the version returned by the jars is not the correct one... Version 2.4rc4 from Maven returns |
Sorry for this bad direction. It may be due to the fact that the rc4 is made of jars where the native part made for ARM is appended to the existing rc-2021011. So not a complete rebuilt (which is tedious). The single other way to get RC4 is to do it through Maven but I think you are not using it in your application since you chose to download the zip archive. |
Just and idea as these log files remain a bit mysterious to me : there is a sentence mentioning that the application must be started from the main thread. OpenGL being single threaded, I had to add a specific JVM flag on macOS on another OpenGL based projects which was This would be relevant with the fact that the crash occurs out of the main thread while trying to update the OpenGL context - see also this. The last point related to GL context is that one of the latest info before JOGL stops emitting logs is mentioning an update of the OpenGL context. |
Thanks Martin ! Good try. However, |
Another idea : is it normal to have this animator working in thread 68 and not in the first one ? |
The first one is reserved by SWT if I'm not wrong. I wouldn't take the risk of slowing the animation when moving the mouse ^^. And in any case we can have several animators running in parallel in GAMA, something that works very well under Rosetta, so we can't really restrict ourselves to one thread. |
I was wondering if you were following this thread : processing/processing4#370 They seem to have made interesting progress (w/o SWT though) |
The fix has been proposed here https://github.com/jzy3d/jogl/pulls, I just forgot it :/ |
Hello Alexis, I had a similar crash which I described here: https://forum.jogamp.org/JOGL-2-4-and-Java-17-report-td4041572.html The crash occured when opening the newt window (or resizing the window - after deactivating the animator, etc.) Your error message is similar to what I sometimes got (running on wrong thread) The crash was caused by the FPSAnimator class which I use for a dynamic content with constant framerate. I simply copied the class (similar of what you did with gtk) and wrapped the called display method (called in the run method of the class): |
Hi ! Thanks a lot ! I will try when I'm back to office and tell you if it works. |
@jzy3d I wonder if this PR might solve the issue described here, as it explicitly revolves around updating the GL context in the main thread ... Any chance you'd do a new build anytime soon ^^ ? |
@Bio7 Your workaround produced something ! Not exactly what was expected, a different behavior. The crash is gone, which is undoubtedly a progress. But the display does not display anything (just a grey surface, which I suspect is not even a Newt Window, just the empty Composite supposed to host it, but I haven't had time to debug) Thanks anyway, I feel we are in the right direction ! |
@Bio7 @jzy3d Forget the previous comment. It is working. I had the leftovers of various attempts in my code, which prevented the display to open. Things are working very well, even with several OpenGL displays. A bit of a lag because of the sharing of the thread with SWT UI, but it is already something !! Thanks a lot both of you !! |
Great to hear. I see no performance issues using only one view (or a split of the same view). Hopefully the jogl development continues so that we don't need all these workarounds. It would be nice to see soon a final 2.4 release. |
Great there is a fix on this topic. I however fear I can't copy paste this fix as is in FPSAnimator. I fear some applications not using SWT (and not having SWT in classpath would fail using FPSAnimator since your fix makes FPSAnimator dependent on org.eclipse.ui.PlatformUI). |
Yes, this was a fix for a RCP. However, for SWT a Display display =Display.getDefault().... would also work. For JavaFX Platform.runLater could work, too if there is an error. Same for Swing. Not tested though. SWT could be detected. A short search on the internet gave me some maybe usable templates: |
@jzy3d yes, clearly. But, as @Bio7 says, we could probably imagine a class that would provide the "relevant main thread" depending on the detection of the windowing system used by the GLAutoDrawable(s) animated by the animator. A best guess of course. And to ease the development of custom animators, one could also extract the call to |
Hi,
I've tried a rather adventurous combination (which is the one we are currently supporting for GAMA -- https://github.com/gama-platform/gama) and it crashed, which is disappointing, especially because I am unable to determine what makes it crash.
The goal was to go "all native": the JDK is native, Eclipse is the native aarch64 version (and SWT is a native binary), and I used the JOGL version (2.4rc4) that contains the native ARM libraries for macOS. GAMA is run from Eclipse, in a configuration that works well on Intel computers or with Rosetta.
Everything is running fine (Java2D displays, SWT views, etc.) except JOGL, which crashes without warnings as soon as one tries to open a NEWT Window (used for the OpenGL displays in GAMA).
Here are the two "logs" I was able to gather.. Any ideas welcome !
The log produced by JOGL: https://gist.github.com/AlexisDrogoul/1adb8dd5a80602ae0f6b5691796c0532#file-log
The crash report produced by Apple: https://gist.github.com/AlexisDrogoul/1adb8dd5a80602ae0f6b5691796c0532#file-crash
The text was updated successfully, but these errors were encountered: