Title: OpenGL/3D sketches crash with `UnsatisfiedLinkError` on Linux when the bundled sketch JDK cannot fork+exec · Issue #1537 · processing/processing4 · GitHub
Open Graph Title: OpenGL/3D sketches crash with `UnsatisfiedLinkError` on Linux when the bundled sketch JDK cannot fork+exec · Issue #1537 · processing/processing4
X Title: OpenGL/3D sketches crash with `UnsatisfiedLinkError` on Linux when the bundled sketch JDK cannot fork+exec · Issue #1537 · processing/processing4
Description: Most appropriate sub-area of Processing 4? OpenGL Processing version 4.5.5 Operating system EndeavourOS x86_64 Linux 7.0.5 Bug description Every 3D/OpenGL sketch (P3D, P2D, Lights, OBJ-loading sketches, or anything that using JOGL) fails...
Open Graph Description: Most appropriate sub-area of Processing 4? OpenGL Processing version 4.5.5 Operating system EndeavourOS x86_64 Linux 7.0.5 Bug description Every 3D/OpenGL sketch (P3D, P2D, Lights, OBJ-loading sket...
X Description: Most appropriate sub-area of Processing 4? OpenGL Processing version 4.5.5 Operating system EndeavourOS x86_64 Linux 7.0.5 Bug description Every 3D/OpenGL sketch (P3D, P2D, Lights, OBJ-loading sket...
Opengraph URL: https://github.com/processing/processing4/issues/1537
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"OpenGL/3D sketches crash with `UnsatisfiedLinkError` on Linux when the bundled sketch JDK cannot fork+exec","articleBody":"### Most appropriate sub-area of Processing 4?\n\nOpenGL\n\n### Processing version\n\n4.5.5 \n\n### Operating system\n\nEndeavourOS x86_64 Linux 7.0.5\n\n### Bug description\n\nEvery 3D/OpenGL sketch (P3D, P2D, `Lights`, OBJ-loading sketches, or anything that using JOGL) fails at launch:\n\n```\nWarning: Caught Exception while retrieving executable temp base directory:\njava.io.IOException: Could not determine a temporary executable directory\n at com.jogamp.common.util.IOUtil.getTempDir(IOUtil.java:1401)\n at com.jogamp.common.util.cache.TempFileCache.\u003cclinit\u003e(TempFileCache.java:84)\n at com.jogamp.common.os.Platform$1.run(Platform.java:313)\n ...\njava.lang.UnsatisfiedLinkError: 'boolean jogamp.common.jvm.JVMUtil.initialize(java.nio.ByteBuffer)'\n at jogamp.common.jvm.JVMUtil.initialize(Native Method)\n at com.jogamp.common.os.Platform.\u003cclinit\u003e(Platform.java:290)\n at com.jogamp.opengl.GLProfile.\u003cclinit\u003e(GLProfile.java:151)\n at processing.opengl.PSurfaceJOGL.initGL(PSurfaceJOGL.java:204)\n ...\nA library used by this sketch relies on native code that is not available.\n```\n\n2D (Java2D) sketches run fine.\n\n## Findings using Ai Agents\n\nJOGL's `IOUtil.testDirExec()` writes a tiny test script into a temp directory, sets `+x`, and **actually `execve()`s it** to verify the temp dir allows execution. If that exec fails, JOGL's native-lib cache (`TempFileCache`) never starts, and subsequent `JVMUtil.initialize` (a native method) fails with `UnsatisfiedLinkError`.\n\nThe bundled sketch JDK at `resources/jdk` (Temurin 17.0.19) cannot `fork+exec` **anything** even `/bin/true` as a child process, while the system's own JDK on the same machine/user succeeds.\n\nThis was confirmed by running the exact same Java program on both JDKs (Build-in and System):\n\n```\n# bundled Temurin 17 (Build-In):\nnew ProcessBuilder(\"/bin/true\").start()\n→ IOException: Cannot run program \"/bin/true\": error=13, Permission denied\n\n# system OpenJDK 21 (System):\nnew ProcessBuilder(\"/bin/true\").start()\n→ OK exit 0\n```\n\n`error=13` is `EACCES`. This is a per-process exec denial affecting only the bundled binary (same uid, same caps, no seccomp, no AppArmor/SELinux). The exact mechanism applying the denial is unconfirmed (likely a Landlock restriction from the environment, not from the JVM itself, perhaps the bundled libjvm does not reference landlock symbols).\n\n## Why `Platform.getJavaHome()` can't recover\n\n`processing/app/Platform.getJavaHome()` either returns `resources/jdk` (the broken bundle) or falls back to `java.home` (the IDE's own runtime at `lib/runtime/`). On the jpackage-based Linux install the IDE runtime has **no `bin/java`** (the launcher loads the JVM in-process via `libjli.so`, so a standalone `java` binary is not shipped in that tree). The fallback is therefore dead on Linux: removing `resources/jdk` gives a \"file not found\" error instead of working.\n\nNo preference or environment variable is read for the sketch JDK path — confirmed by decompiling `Platform`, `Runner`, and `JavaBuild`.\n\n## Affected file(s)\n\n- `processing/app/Platform.java` — `getJavaHome()` and `getJavaPath()`\n\n## Suggested fix direction\n\nBefore returning the bundled `resources/jdk` from `getJavaHome()`, validate it can launch a child process (one-shot `Runtime.exec(\"/bin/true\")`). When it fails:\n\n1. Honor `JAVA_HOME` / `JDK_HOME` env vars or a `runtime.java.path` preference **before** the bundled JDK, so users can override a broken bundle.\n2. On Linux, probe a system JDK (`/usr/lib/jvm/default-runtime`, `update-alternatives --list java`, `archlinux-java`) as the fallback before giving up.\n3. Report a clear message when no working JDK is found, instead of letting the crash surface as an opaque `UnsatisfiedLinkError` from JOGL.\n\n## Verified workaround\n\n```bash\nsudo mv resources/jdk resources/jdk.broken\nsudo ln -s /usr/lib/jvm/{any installed JDK} resources/jdk\n```\n\nAfter this, JOGL initializes cleanly (`GLProfile init OK`, GL 4.6 hardware detected) and all 3D sketches render.\n\n### Steps to reproduce this\n\n1. Run any 3D/OpenGL sketch (P3D, P2D, `Lights`, OBJ-loading sketches, or anything that using JOGL\n\n2. Crash\n\n### snippet\n\nUsing OnOff sketch template\n```processing\n\n/**\n * On/Off. \n * \n * Uses the default lights to show a simple box. The lights() function\n * is used to turn on the default lighting. Click the mouse to turn the\n * lights off.\n */\n \nfloat spin = 0.0;\n\nvoid setup() {\n size(640, 360, P3D);\n noStroke();\n}\n\nvoid draw() {\n background(51);\n \n if (!mousePressed) {\n lights();\n }\n \n spin += 0.01;\n \n pushMatrix();\n translate(width/2, height/2, 0);\n rotateX(PI/9);\n rotateY(PI/5 + spin);\n box(150);\n popMatrix();\n}```\n\n\n### Additional context\n\n## Environment\n\n- Arch Linux, kernel 7.0.5-arch1-1-g14\n- Processing 4.5.5, bundled sketch JDK Temurin 17.0.19+10\n- System JDK: OpenJDK 21.0.11 at `/usr/lib/jvm/java-21-openjdk`\n- `/tmp`: `tmpfs (rw,noatime)` — not `noexec`\n\n\n### Would you like to work on the issue?\n\nYes, I’d like to help with this","author":{"url":"https://github.com/ZanDev32","@type":"Person","name":"ZanDev32"},"datePublished":"2026-07-06T04:22:53.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1537/processing4/issues/1537"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2f00b33c-7185-71ce-a1a9-cbd80bd0a741 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9196:B1D4C:49A3BA3:5FFA7BB:6A5D48FA |
| html-safe-nonce | d386f3cf432b2744905a33f40509adfc0809d3938dfe21f802fdc70632a58477 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTk2OkIxRDRDOjQ5QTNCQTM6NUZGQTdCQjo2QTVENDhGQSIsInZpc2l0b3JfaWQiOiI4MDE5MjM0NDYyMDcxODY3NjQyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | eb843e9f1ecf97d0009f693608cf6094a0cbf4645c46a5a9783092e95272dc82 |
| hovercard-subject-tag | issue:4815927252 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/processing/processing4/1537/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1449a59bbcebe32ccb58fab78ce5aa8d8088639aba4ce6367a1e02e4812221c4/processing/processing4/issues/1537 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1449a59bbcebe32ccb58fab78ce5aa8d8088639aba4ce6367a1e02e4812221c4/processing/processing4/issues/1537 |
| og:image:alt | Most appropriate sub-area of Processing 4? OpenGL Processing version 4.5.5 Operating system EndeavourOS x86_64 Linux 7.0.5 Bug description Every 3D/OpenGL sketch (P3D, P2D, Lights, OBJ-loading sket... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ZanDev32 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/processing/processing4 git https://github.com/processing/processing4.git |
| octolytics-dimension-user_id | 1617169 |
| octolytics-dimension-user_login | processing |
| octolytics-dimension-repository_id | 844382769 |
| octolytics-dimension-repository_nwo | processing/processing4 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 844382769 |
| octolytics-dimension-repository_network_root_nwo | processing/processing4 |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width