You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenGL sketches crash on the aarch64 (Apple Silicon) version #370
Against my better judgement, I'm posting a release that's native for Apple Silicon. OpenGL is currently broken. Sketches crash immediately. You should only use it if you're a masochist. Or a masochist that likes extremely fast but very incomplete software, and won't file bug reports saying “OpenGL is broken.” But it's being posted for folks who do not need OpenGL, and/or want to help debug.
Thanks for looking into it, good to know… That could be a problem in the JOGL build that I made not properly supporting NEWT. Which could be good news in some ways (maybe I did something dumb), or bad news in others (NEWT may need more complicated changes for aarch64).
That's inside PSurfaceJOGL.initDisplay(), though it only got that far after disabling the earlier NewtFactory.setWindowIcons(res) call, which I was hoping was just happening at the wrong time.
…so it seems there's something in the static initialization of the NEWT code that's causing trouble. Which also means it could be pretty early in loading the native library.
However, swapping these in still leaves a crash in the same place when initializing a Processing sketch. I'd have to check whether it's the same for NEWT demos.
@jaegonlee Does the sleep() hack work consistently for you? I'm starting to wonder whether we want to just go with the hack for now (so that it's not just crashing for folks) until someone has the time or wherewithal to fix it properly.
Calling TISGetInputSourceProperty() to get keyboard layout cause the crash.
Instead of adding return NULL; to pass it, addiing dispatch_async could avoid the crash when mapping the keys.
I could fix the problem with newt window. -[NSOpenGLContext update] must be called from the main thread if the context has a view. golang/go#35177 (comment)
Fantastic! This is exactly what we're looking for. I'll take a look at patching that up and if it works, maybe we'll push out a new beta. This would be huge!
This issue has been automatically locked. To avoid confusion with reports that have already been resolved, closed issues are automatically locked 30 days after the last comment. Please open a new issue for related bugs.
Activity
processing-bot commentedon Jan 30, 2022
Created by: jaegonlee
I tested some jogl examples, they works ok except using newt. It crashes when creating GLWindow.
Code terminated in next step

.
processing-bot commentedon Jan 30, 2022
Created by: benfry
Thanks for looking into it, good to know… That could be a problem in the JOGL build that I made not properly supporting NEWT. Which could be good news in some ways (maybe I did something dumb), or bad news in others (NEWT may need more complicated changes for
aarch64).processing-bot commentedon Jan 30, 2022
Created by: benfry
Confirming the crash inside NEWT for us (this is
jdboutput of running an exported application).That's inside
PSurfaceJOGL.initDisplay(), though it only got that far after disabling the earlierNewtFactory.setWindowIcons(res)call, which I was hoping was just happening at the wrong time.processing-bot commentedon Jan 30, 2022
Created by: benfry
Though perhaps interestingly,
setWindowIcons()only does an assignment:…so it seems there's something in the static initialization of the NEWT code that's causing trouble. Which also means it could be pretty early in loading the native library.
processing-bot commentedon Jan 30, 2022
Created by: benfry
The
aarch64JOGL builds were done with these instructions: https://github.com/jzy3d/jogl/blob/feature/macosx-arm64/HOW-TO-ADD-ARM64-TO-2.4.mdAnd the result of that is also in a Maven repository:
However, swapping these in still leaves a crash in the same place when initializing a Processing sketch. I'd have to check whether it's the same for NEWT demos.
processing-bot commentedon Jan 30, 2022
Created by: benfry
Ok, and confirming that the NEWT demos crash the same way, using my build and the jzy3d builds.
Start the debugger:
Commands given to the debugger:
And finally:
…as the last line before the crash.
Or for the full trace:
also CCing @codeanticode for the progress update…
processing-bot commentedon Jan 30, 2022
Created by: benfry
Oh, and when run with appbundler, we get the full macOS crash thing, with this possible clue in the details:
processing-bot commentedon Jan 30, 2022
Created by: jaegonlee
Adding 2 lines of codes, it works with Jogl Newt Example.
(I don't know why)
MacNewtNSWindow.m(jogl/src/newt/native)

return NULL;MacWindow.m(jogl/src/newt/native)

sleep(1);OpenGL sketchs are running, but can't draw anything.

processing-bot commentedon Jan 30, 2022
Created by: jaegonlee
OpenGL sketches works fine after short delay.
processing-bot commentedon Jan 30, 2022
Created by: benfry
Sounds like good progress! Though fragile :)
processing-bot commentedon Feb 16, 2022
Created by: benfry
Hm, also seeing similar framebuffer errors when running the Intel version on an M1 Max:
processing-bot commentedon Feb 18, 2022
Created by: benfry
@jaegonlee Does the
sleep()hack work consistently for you? I'm starting to wonder whether we want to just go with the hack for now (so that it's not just crashing for folks) until someone has the time or wherewithal to fix it properly.processing-bot commentedon Feb 19, 2022
Created by: jaegonlee
@benfry some errors occur (as you mentioned above) when launching, but codes are running without problems.
(except resizing window)
processing-bot commentedon Feb 19, 2022
Created by: benfry
And I'm guessing keys are disabled as well (or at least keys that aren't just a-z and 0-9) because it's skipping the function to set up the mappings?
processing-bot commentedon Feb 21, 2022
Created by: jaegonlee
Calling
TISGetInputSourceProperty()to get keyboard layout cause the crash.Instead of adding
return NULL;to pass it, addiingdispatch_asynccould avoid the crash when mapping the keys.MacNewtNSWindow.m(jogl/src/newt/native)
key mapping is ok now.
processing-bot commentedon Feb 21, 2022
Created by: jaegonlee
I could fix the problem with newt window.
-[NSOpenGLContext update] must be called from the main thread if the context has a view.golang/go#35177 (comment)MacOSXWindowSystemInterface.m(jogl/src/jogl/native/macosx/)
no need to
sleep(1)or delay, and there're no more framebuffer errors.processing-bot commentedon Feb 21, 2022
Created by: benfry
Fantastic! This is exactly what we're looking for. I'll take a look at patching that up and if it works, maybe we'll push out a new beta. This would be huge!
processing-bot commentedon Feb 21, 2022
Created by: codeanticode
Nice, I have been following this issue looks you have made great progress. Thanks a lot @jaegonlee !!
processing-bot commentedon Apr 23, 2022
Created by: benfry
Ok, with the help of @jaegonlee's patches:
…I was able to hack together a working JOGL for ARM for 4.0 beta 8. 🎉
processing-bot commentedon Apr 23, 2022
Created by: benfry
To build from an (already existing) git clone, you'll need to clear out the old JOGL libraries:
then do a fresh build:
processing-bot commentedon May 24, 2022
Created by: github-actions[bot]
This issue has been automatically locked. To avoid confusion with reports that have already been resolved, closed issues are automatically locked 30 days after the last comment. Please open a new issue for related bugs.