Repository navigation
fix(cli): name an Erlang VM crash instead of a bare exit 139 - #1200
Conversation
hypatia-cli.sh exec'd the escript, so when the BEAM crashed (the PinSites miscompile, #1062) callers saw only "exit 139" or "Hypatia scanner execution failed with exit 139". Downstream, that reads as a scanner fault or as a finding about the scanned repository. Seen on metadatastician/lintel#30, which still pinned the pre-#1062 revision be98f74. The wrapper now runs the escript as a child and stays as transparent as exec: stdin, stdout and stderr pass through, TERM/INT/HUP are forwarded, and the exit code is unchanged. On SEGV/BUS/ABRT/ILL it prints, to stderr only, the signal and the OTP and erts version (read from OTP_VERSION and `erl +V`, no code evaluation). It then re-raises the child's signal on itself, so the caller's shell still reports "Segmentation fault … hypatia-cli.sh" and the toolchain_segfault triage rule keeps matching. Tests: - tests/hypatia-cli-signal-test.sh (six cases with fake escripts), wired into escript-soundness.yml next to the consumer-shaped invocation. It passes, and against the old wrapper it fails the SIGSEGV case. - ci_failure_triage: the wrapper's report alone classifies as toolchain_segfault (new fixture). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDiFtqASJYm1U8JRY6P
TERM, INT, HUP and other signals end a run on purpose and get no crash report; the default arm now says so instead of falling through. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDiFtqASJYm1U8JRY6P
|
cargo-deny fails on
The same job passed on this PR's base, Sonar Generated by Claude Code |
|



What
hypatia-cli.shno longerexecs the escript. It runs it as a child and stays as transparent asexec:When the escript dies by SEGV, BUS, ABRT or ILL, the wrapper prints the signal and the OTP and erts version to stderr only. It gets them from the installation's
OTP_VERSIONfile anderl +V, without evaluating code. It then re-raises the same signal on itself.Because of the re-raise, callers still get exit 139, and their shell still prints
Segmentation fault … hypatia-cli.sh. So thetoolchain_segfaulttriage rule and its fixture keep matching.Also in this PR:
tests/hypatia-cli-signal-test.sh: six cases using fake escripts, wired intoescript-soundness.ymlright after the consumer-shaped invocation.ci_failure_triagefixture and row: the wrapper's report alone classifies astoolchain_segfault.Why
metadatastician/lintel#30 failed with
Hypatia scanner execution failed with exit 139, which reads as a scanner fault or as a finding about that repository.be98f74, which predates Stop the OTP 28 segfault in scans and the RSR oracle (PinSites miscompile) #1062. Its core dump shows the Stop the OTP 28 segfault in scans and the RSR oracle (PinSites miscompile) #1062 signature: in-place binary append inPinSites.do_mask/3, the head of the process'swrt_binslist withnext = 0xd8, andsweep_off_heapcrashing in the GC.6693f9aon OTP 27.3.4.19.Evidence
bash tests/hypatia-cli-signal-test.sh→ 6 of 6 PASS, with and withouterlon PATH.main'shypatia-cli.sh) fails the SIGSEGV case only (err=empty).be98f74escript, on Linteld7bdc21's tree, with OTP 28.3.3:Segmentation fault … hypatia-cli.sh, rc is 139, and stdout is empty.mix test test/rules/ci_failure_triage_test.exs→ 200 tests, 0 failures (OTP 27.3.4.19, Elixir 1.19.4).mix format --check-formattedpasses on the changed test file.shellcheck -S warningpasses onhypatia-cli.shand the new test.6693f9aescript reports 0 findings on the changed shell files. An earlier draft that usederl -evalwas flaggedeval_in_shelland has been rewritten.For #1062's notes. A stress run over 44 inputs (Lintel trees plus 40 random subsets of its workflows) used escripts built natively on each runtime:
be98f74(unfixed)6693f9a(fixed)So OTP 27 is not immune without the #1062 compile option. The OTP 27.3.4.19 pin (ruling R2) protects only together with a revision that carries the fix.
Not done
escript-soundness.yml.ci_failure_triage's reason text. It still says OTP 27 is unaffected, which the table above contradicts. That's the owner's wording to change.Generated by Claude Code