jerbuild build hangs forever in [1/5] compile-program on FreeBSD amd64 (Chez 10.4.0 GC churn); same sources finish on macOS #78
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
jerbuild build(viagmake binaryin ober/jerboa-code) hangs forever on FreeBSD amd64. The build gets cleanly through everything up to the[1/5] Program compile in isolated subprocess (multicall self)step, then a single child process (jerboa runtime <objdir>/cross-wpo-compile.ss) spins at 100% CPU with multi-GB GC churn and zero output progress. The identical sources + identical jerboa version complete on macOS in ~2 minutes, so this is a FreeBSD-specific compiler bug in jerbuild's WPO/compile-program path (bundled Chez 10.4.0), not a source, Makefile, version, or resource problem.Tested under both jerboa 0.12.6 and 0.12.9 — identical stall, so the recent update to 0.12.9 is unrelated.
Environment (reproducer host)
uname -m= amd64,uname -r= 15.1), host nicknamebiggushw.physmem=132930727936) — resource ceiling ruled out0.12.6(freebsd-amd64 release tarball) and0.12.9(multicall ELF), both from ~/.local/bin; bundled Chez runtime 10.4.0ober/jerboa-code@ HEAD7cb9f19, VERSION 0.4.7PATH=~/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbingmake binary(Makefilebinarytarget →jerbuild build --config .jerbuild --os-libs "-lm -lpthread -lutil -lncurses -L/usr/local/lib -liconv")JERBOA_BINARY_DETERMINISTIC_LINK=0Repro
Expected: proceeds past
[1/5]. Actual: stuck forever at:with the child
jerboa runtime ...at ~99% CPU on one thread.Hard evidence (measured on biggus)
procstat -k→ one running thread)bundle/stuck at 158 files,u-*at 234 files, across 90 s sampling windowsprogram.sostayed 0 bytes,program.wp.sonever createdjerboa, frame #0 at0x7341f41in a Scheme-generated trampoline region (compiler's own compiled code), no C-stack deadlock.JERBOA_BINARY_WPO=0run (0.12.6): same spin, froze even earlier (bundle 79 / u-* 117, RSS climbed past 5.5 GB). So not WPO-fasl-emission specific — it's thecompile-programexpansion/codegen itself.[1/5]in under ~1 minute (the transpile, Rust crate build via cargo, and linker prep all completed fine).Control experiment: macOS completes identically
On macOS arm64 (
/Users/user/mine/jerboa-code, same HEAD7cb9f19), jerboa 0.12.6 (macos-arm64 multicall),make binary:So: same sources, same jerboa version — macOS compiles the full closure to a working 17 MB
jcode; FreeBSD amd64 never writes the first byte ofprogram.so. The fault is specific to the FreeBSD/ta6fb bundled Chez build path.Code path inside this repo
jerbuild.ss→do-binary-build→[1/5]branch selected at ~line 3390 when(or xpatch (getenv "JERBOA_SELF_EXE"))(multicall self → isolated subprocess).cross-program-subprocess!(~line 3115–3186) writescross-wpo-compile.ssand spawns a freshjerboa runtimewhose helper runs, in order:(library-directories '(...))(bundle + user libs redirected under obj-dir)(compile-imported-libraries #t)(generate-wpo-files <binary-wpo?>)(compile-program <entry> <program.so>)cross-wpo-whole.ss→(compile-whole-program ...).so/.wpo+ ~234 project.so/.wpoare all emitted, thencompile-programonmain-binary.ssruns forever without touchingprogram.so(0 bytes) and without ever reaching the whole-program helper. Last-successful module writes before the freeze cluster aroundjcode/ui/tui-*,jcode/tool/lsp,std/os/sysmon,std/misc/process— recent PRs #16–#19 in jerboa-code touched exactly these tui/lsp/eval modules.What was ruled out
/tmp/jerbuild-binary-*obj-dir each run; toolchain bundle in~/.cache/jerbuildcomplete (.completemarker, verified contents)ensure-jerboa-tools(which succeeded; the v0.2.8 fallback 404s but is never reached whenjerbuildis on PATH)JERBOA_BINARY_WPO(WPO on vs off) — both stall atcompile-programJERBOA_BINARY_DETERMINISTIC_LINK— set (0) in all runs including the working macOS oneHypotheses for the fixer (ranked)
compile-program(R6RS top-level program mode) on the full jcode import closure blows up on the FreeBSD/ta6fb bundled Chez 10.4.0 — an optimization/expansion pass allocates a combinatorially growing structure (GC-churn signature ~sweep_generationcontinuance is the giveaway: endless mark/sweep, RSS plateaus as the collector reclaims, output never advances). Likely a path/bug that is x86_64-freebsd-specific (macOS arm64tarm64osxbuild unaffected). Prime suspects: a specific large module in the closure (see last-writes above), a huge literal/case/macro expansion, orletrec*closure-conversion on a largelet-chain.cross-wpo-compile.sshelper standalone against progressively larger subsets of the libdirs; once a minimal repro is found, reduce to bare Chez (chezscheme)compile-programfor an upstream report.JERBOA_WPO_SCHEMEpointing at a source-builtta6fbscheme, see thejerboa-freebsd-build-from-sourcebuild recipe) to distinguish bundled-runtime build flags (dtrace probes, machine type,--enable-harden) from a genuine Chez 10.4.0 FreeBSD codegen bug. The bundled runtime is the current suspect; a plaingmake-builtta6fbschememay dodge it.(collect-trip-bytes)/GC notify aroundcompile-program, interrupt with gdb and unwind the Scheme continuation) to identify the exact pass/continuation.Success criteria for a fix
gmake binarycompletes to=== Build complete: .../jcode ===on FreeBSD 15.1 amd64 with these exact sources and 0.12.6 and 0.12.9, OR.ss→chezschemecompile-program) that documents the FreeBSD-specific Chez bug, with the upstream workaround/flag documented.Files/dirs referenced on the reproducer host
ober referenced this issue2026-09-17 20:45:02 -04:00
Verified resolved on FreeBSD 15.1-RELEASE-p3 amd64 (biggus) using fresh Jerboa master
2b00a04277(VERSION 0.13.0) and the pinned consumer ober/jerboa-code 7cb9f19bb27a13213222d5391a409a469043f928.Two clean default-WPO gmake binary runs completed with JERBOA_BINARY_FORCE_INPROCESS unset and the isolated [1/5] Program compile in isolated subprocess (multicall self) path. Both produced nonempty program.so, program.wpo, program.wp.so, and executable jcode. The pinned builds passed clean-environment --version and --help both in place and after copying only jcode to an otherwise empty staging directory (all exit 0, no stderr). A separate pinned JERBOA_BINARY_WPO=0 build also completed successfully.
For confirmation against the requested latest consumer, current ober/jerboa-code master 990f54917685810737da670b1f2c4da95f33eadb completed the same isolated default-WPO build and clean/staged startup checks (all exit 0, no stderr).
Evidence was retained on biggus:
This verifies that the original FreeBSD compile hang no longer reproduces. Closing issue 78.