Skip to content

[1.18.32] Bun 1.4.2 segfault at 0x40 on Android/bionic #23

Closed

Description

@lhk1129
Image

Device: SM-S921N
Android: 16
Kernel: Linux localhost 6.1.157-android14-11 #1 SMP PREEMPT Fri Aug 14 06:25:39 UTC 2026 aarch64 Android
Termux package: opencode1 1.18.32 aarch64 (native bionic mainline)

Working: opencode 1.18.30 native runs fine, 68 sessions intact
Broken: opencode1 1.18.32 crashes on startup

Crash:
panic: Segmentation fault at address 0x40
Bun v1.4.2 (744846f84) Android arm64
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
bun.report link: screenshot attached (full link in terminal output)

CPU line from crash: neon fp aes crc32 atomics sve

Activity

  1. Hope2333 commented on Sep 26, 2026

    @Hope2333
    Owner

    Root cause found — fixed, rebuilt with Bun 1.4.0

    Thanks for the high-quality report (exact crash signature + working-vs-broken versions).

    Chain that produced your build:

    1. tools/transplant/config/bun-bind.json pins target: "1.4.0".
    2. probe_assemble.py resolve_bun_base() checked the local cache first and accepted any cached version >= 1.4.0. Your (and CI's) cache happened to contain bun-1.4.2, so every rebuild since 1.18.31 silently shipped 1.4.2 instead of the pinned 1.4.0 — while 1.18.30 shipped 1.4.0. That's exactly the working/broken boundary you observed.
    3. Bun v1.4.2 (744846f84) Android arm64 segfaults at 0x40 on this device (segmentation at a near-NULL pointer is consistent with the 0x40 signature reported across multiple Bun versions upstream — this looks like a Bun runtime bug on Android/bionic, not an app bug).

    Fixes landed:

    • resolve_bun_base() now sorts cache candidates so the bind target (1.4.0) wins over newer stray cache entries (still falls back to newer if 1.4.0 is absent).
    • Restored the previously hidden bun-1.4.0 cache entry.

    Rebuilt asset (available on this release):

    • opencode1_1.18.32_aarch64.deb — rebuilt with Bun 1.4.0, payload sha256 e40a5259a0a3c2ef… (deb) / 2fc4077d1a05b989… (pac), also carries the seccomp shim at lib/opencode/libopencode-crhandler.so (DT_RUNPATH fix) + migrate-to-opencode1.sh.

    Verified on-device (Termux, Android arm64):

    • opencode1 --version → 1.18.32
    • TUI starts: input box reached at 40 s, typing echoes, no CANNOT LINK / no panic markers
    • Embedded runtime string = 1.4.0

    Please re-download the two 1.18.32 assets from this release (they were clobbered; same names, new content) and re-test. If 1.4.0 still segfaults at 0x40 we'll dig into the sve CPU-feature angle — but I expect this closes it.

  2. Hope2333 commented on Sep 26, 2026

    @Hope2333
    Owner

    [@Hope2333] Fixed — v2.0.12 rebuilt with embedded bun 1.4.0 instead of the crashing 1.4.2.

    Root cause: build-bionic.sh pinned bun-1.4.2; the v1.4.2 standalone binary SIGSEGVs at 0x40 on Android/bionic. The A-line transplant already used 1.4.0; the B line did not.

    Fix: bun pin patch in build-bionic.sh (idempotent sed rewriting package.json packageManager to [email protected] + assertion). Rebuilt 2.0.12 → --version = opencode v2.0.12 exit 0, embedded bun 1.4.0 (strings-verified), TUI smoke no crash.

    New packages uploaded to Push260922:

    # pacman
    pacman -U https://github.com/Hope2333/opencode-termux/releases/download/Push260922/opencode-2.0.12-1-aarch64.pkg.tar.xz
    # dpkg
    curl -LO https://github.com/Hope2333/opencode-termux/releases/download/Push260922/opencode_2.0.12_aarch64.deb && dpkg -i opencode_2.0.12_aarch64.deb

    (2.0.0–2.0.11 remain on 1.4.2; if you hit the same crash there, say the word — same pin rebuild.)

  3. Hope2333 commented on Sep 26, 2026

    @Hope2333
    Owner

    Confirmed uploaded & verified on Push260922 now (sha256 crypto-match, not just size):

    • opencode_2.0.12_aarch64.deb — 48.1 MB, sha256 69e256fde443177b…
    • opencode-2.0.12-1-aarch64.pkg.tar.xz — 48.1 MB, sha256 182c6eebf4616c89…

    Both carry the bun 1.4.0-embedded runtime (the earlier comment's "uploaded" claim was premature — the migrate-fix deb went up first; the two 2.0.12 packages are now genuinely live).

  4. Hope2333 commented on Sep 28, 2026

    @Hope2333
    Owner

    RC3 (Push260922, 2026-09-28) supersedes the per-version rebuilds above — the whole two-generation family was rebuilt with bun 1.4.0 embedded and re-uploaded with PKGREL=3:

    • v2 native opencode 2.0.0–2.0.12 (deb + pacman, all 1.4.0 — no more 1.4.2 stragglers)
    • v2 wrapper opencode-wrapper 2.0.0–2.0.12
    • v1 opencode1* 1.18.30–1.18.32 (native / wrapper / compressed)

    Upgrade to the latest:

    pacman -S opencode            # v2 mainline (or opencode-wrapper)
    pacman -S opencode1           # v1 mainline (coexists with v2)

    or grab assets directly: https://github.com/Hope2333/opencode-termux/releases/tag/Push260922 (70 assets, per-file digest-verified against the release notes).

    Closing this as the 1.4.2 crash is fully retired from the shelf — reopen if any 1.4.0-era build still segfaults at 0x40 on your device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions