Skip to content

Fix Linux .deb runtime crashes and source build on Ubuntu 22.04/24.04/26.04#6

Merged
stytim merged 1 commit into
mainfrom
fix/linux-ubuntu-22-24-26
Jun 14, 2026
Merged

Fix Linux .deb runtime crashes and source build on Ubuntu 22.04/24.04/26.04#6
stytim merged 1 commit into
mainfrom
fix/linux-ubuntu-22-24-26

Conversation

@stytim

@stytim stytim commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Problem

The prebuilt Linux .deb ran fine on Ubuntu 22.04 (the CI build target) but crashed on launch on a clean Ubuntu 24.04/26.04, and building from source failed. Root-caused on a clean Ubuntu 26.04 box; one Linux build now serves 22.04/24.04/26.04 (no separate 26.04 build needed).

Runtime crashes (.deb) — three latent bugs that 22.04 masked

  1. libOpenGL.so.0 missing — the binary links GLVND's libOpenGL.so.0, but the package only Depends-ed on libgl1error while loading shared libraries: libOpenGL.so.0. Now depends on libopengl0.
  2. Bundled libs unreachable + incompletepatchelf ran only on the binary, but RUNPATH $ORIGIN does not propagate to a library's own dependencies, and the name allow-list missed libprotobuf. So libopencv_core→libtbb.so.2 and libopencv_dnn→libprotobuf.so.23 weren't found, and those sonames don't exist on 24/26 (libtbb.so.2.so.12). Now bundles the dependency closure of the RealSense+OpenCV libs and sets $ORIGIN on every bundled .so.
  3. ImGui GL loader dlopen("libGL.so") — the dev-only symlink, absent on runtime-only machines → Failed to initialize OpenGL loader! → abort. Now tries libGL.so.1 first (Linux/GLX branch only; macOS/Windows untouched). This affected every clean Linux box, not just 26.04.

Also: ship the RealSense udev rules (non-root camera access — otherwise "No RealSense devices found") and the app icon; Depends widened to the host GL/GTK/X11/runtime/USB stack (names resolve on 24/26 via the t64 Provides).

Source build

  • Add libx11-dev/libxext-devfind_package(X11) aborted configure on 26.04.
  • librealsense apt repo falls back to noble when the running codename isn't served (Intel returns 403 for resolute/oracular/plucky).
  • -march=native is now opt-in via -DIRTRACK_NATIVE_ARCH=ON; the distributed binary targets a portable x86-64 baseline (avoids SIGILL on CPUs older than the CI runner).
  • README documents the Ubuntu 22.04/24.04/26.04 build recipe.

Verification (on a clean Ubuntu 26.04)

  • Ran the patched binary → reaches its GUI loop, no crash (was an instant libOpenGL.so.0 crash).
  • Reproduced the new packaging end-to-end → bundles exactly the private compute libs (no GTK/GL contamination); built a valid .deb with dpkg-deb (Depends, postinst/postrm, icon, udev rules all correct).
  • All sources pass GCC-15 -fsyntax-only; CMake configures through RealSense + OpenCV; both workflows pass bash -n and YAML validation.
  • Adversarial multi-lens review: 0 confirmed defects; its low-severity hardening was applied (nullglob, retry + 403/404-only codename fallback, libudev1/zlib1g in Depends, icon-cache refresh).

Note: an in-place .deb upgrade may need the camera replugged once for the new udev rules to take effect.

🤖 Generated with Claude Code

…26.04

The prebuilt Linux .deb crashed on launch on clean Ubuntu 24.04/26.04
(libOpenGL.so.0 and transitive libs not found, then ImGui "Failed to
initialize OpenGL loader!"), and building from source failed. One Linux
build now serves all three LTS releases.

Runtime (.deb packaging in release.yml):
- Depend on libopengl0: the binary links GLVND's libOpenGL.so.0, but the
  package only depended on libgl1 -> instant load-time crash on a clean box.
- Bundle the dependency *closure* of the RealSense+OpenCV libraries (this
  catches libprotobuf.so.23 and libtbb.so.2 that the old name allow-list
  missed) and patchelf $ORIGIN onto every bundled .so. RUNPATH does not
  propagate to a library's own deps, and those sonames are gone on 24/26.
- Ship librealsense udev rules (non-root camera access) and a 256px icon;
  reload udev + icon/desktop caches in postinst. Depends widened to the
  host GL/GTK/X11/runtime/USB stack (names resolve on 24/26 via t64 Provides).

ImGui GL loader (imgui_impl_opengl3_loader.h):
- dlopen libGL.so.1 (the runtime soname) before the dev-only libGL.so
  symlink, which is absent on end-user machines. This crashed every clean
  Linux box, not just 26.04. Linux/GLX branch only; macOS/Windows untouched.

Build (build.yml / release.yml / README.md / CMakeLists.txt):
- Add libx11-dev/libxext-dev: find_package(X11) aborted configure on 26.04.
- librealsense apt repo falls back to noble when the running codename is
  not served (Intel returns 403 for resolute/oracular/plucky).
- -march=native is now opt-in via IRTRACK_NATIVE_ARCH (default OFF); the
  distributed binary targets a portable x86-64 baseline.
- Document the Ubuntu 22.04/24.04/26.04 build recipe.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@stytim stytim force-pushed the fix/linux-ubuntu-22-24-26 branch from bded9f7 to 0a556c1 Compare June 14, 2026 14:50
@stytim stytim merged commit 58cf1dd into main Jun 14, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant