Skip to content

DO NOT MERGE — ci(diag): OTP matrix for the RSR oracle segfault - #1032

Closed
hyperpolymath wants to merge 1 commit into
mainfrom
claude/gifted-thompson-vsrzhw-pr3
Closed

hyperpolymath wants to merge 1 commit into
mainfrom
claude/gifted-thompson-vsrzhw-pr3

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Diagnostic only. This draft PR will be closed unmerged once the matrix has run. Do not merge it, and do not mark it ready for review.

Question

mix hypatia.rsr_score segfaults (exit 139) on 30/30 runs when it scores hyperpolymath/rsr-template-repo at 2ba9126 against standards e064539. The setup is Hypatia be98f74 on Elixir 1.19.4 / OTP 28.3 (erts 16.2.2). The same setup crashes 0/30 times on tree 0c9dc42. gdb shows the crashing scheduler in sweep_off_heap (erl_gc.c), reached from minor_collection ← gc_test ← beam_jit_bs_init_bits. That points to heap corruption from earlier in the run.

We want to know three things:

  • Is the crash tied to one OTP release, or does every release we test hit it?
  • Does Hypatia's current code still crash?
  • Does it go away with +JMsingle true, or on the interpreter flavour?

What this PR adds

  • .github/workflows/oracle-segfault-diag.yml runs only on pull_request, with a paths filter on itself. Its matrix is OTP {27.3, 28.0, 28.1, 28.2, 28.3, 28} × Hypatia {be98f74, this PR's head}. Each job:

    • scores the subject 5 times with the default emulator,
    • runs it once more with ERL_FLAGS='+JMsingle true',
    • runs it once with ERL_AFLAGS='-emu_flavor emu' if that flavour is installed (if not, the job records that),
    • records the OTP release, erts version and emu_flavor,
    • prints a gdb bt 40 of the crashing thread for any crash.

    A crash never fails the job.

  • .github/workflows/actions.lock gets an entry for this workflow. All four SHA-pinned refs are already locked.

Nothing upstream is filed and OTP is not pinned anywhere. The results go into one summary comment, and then the PR is closed.


Generated by Claude Code

…ERGE)

Diagnostic only, on a draft PR that is closed unmerged. Scores
rsr-template-repo at 2ba9126 against standards e064539 with Hypatia at
be98f74 and at this PR's head, across OTP 27.3, 28.0, 28.1, 28.2, 28.3
and 28 (Elixir 1.19.4): 5 default runs, one with +JMsingle true, one on
the emu flavour when shipped, with gdb backtraces of any crash. The job
never fails on a crash. actions.lock gains the workflow's entry (all
four refs already locked).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01E294yTkKk127qgKEXFFDBE
@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 43 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 74f09954-5603-4ccc-af32-c8d2be7a9fe2
Commits

Reviewing files that changed from the base of the PR and between c639c46 and 8a7571c.

Files ignored due to path filters: 1

  • .github/workflows/actions.lock is excluded by !**/*.lock
Files selected for processing: 1

  • .github/workflows/oracle-segfault-diag.yml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

Copy link
Copy Markdown
Owner Author

Results: run 42633018429

The setup matched the original crash: subject rsr-template-repo 2ba9126, standards e064539, Elixir 1.19.4. Each cell ran 5 times on the default JIT emulator plus once with +JMsingle true. None of the setup-beam builds ships the emu flavour (erlexec: Invalid emulator type or flavor), so that leg could not run anywhere.

OTP resolved (erts) hypatia be98f74 hypatia PR (4133cad = main c639c465 + this file)
27.3.4.19 (15.2.7.14) 0/5, JMsingle rc 0 0/5, rc 0
28.0.4 (16.0.3) 0/5, rc 0 0/5, rc 0
28.1.1 (16.1.1) 5/5 rc 139, JMsingle rc 139 0/5, rc 0
28.2 (16.1.2) 5/5 rc 139, JMsingle rc 139 0/5, rc 0
28.3.3 (16.2.2) 5/5 rc 139, JMsingle rc 139 0/5, rc 0
28 → 28.5.0.8 (16.4.0.7) 0/5, rc 0 0/5, rc 0

All crashes show the same backtrace: sweep_off_heap (erl_gc.c:3129/3130) ← do_minor ← minor_collection ← garbage_collect ← erts_garbage_collect_nobump ← gc_test ← beam_jit_bs_init_bits(num_bits=8) ← JIT code. The GC arguments are identical across 28.1, 28.2 and 28.3 (fcalls=3922, new_sz=17731, ygen_usage=10800), so the crash happens at the same deterministic point in execution.

Verified:

  • The crash needs Hypatia be98f74 together with OTP 28.1–28.3.
  • The same tree and SSOT on OTP 27.3.4.19, 28.0.4 or 28.5.0.8 do not crash.
  • Current Hypatia main does not crash on any OTP version tested.
  • +JMsingle true does not help.

Inferred, not proven: The OTP window matches erlang/otp#10588, OTP-19951 in compiler-9.0.5 / OTP 28.4: "Fixed a compiler alias analysis bug that could generate unsafe code for repeated binary segments". In that bug, private_append is applied destructively when one binary appears in several segments, and the result is memory corruption and segfaults. OTP 28.1 (compiler-9.0.2) changed destructive update (OTP-19660), which may be where the window opens. It is a compiler bug, so it would live in Hypatia's .beam files compiled under 28.1–28.3. That fits current Hypatia code not crashing on the same runtimes. OTP 28.4 was not tested, and no run split compile-OTP from runtime-OTP.

Nothing was filed upstream and OTP is not pinned anywhere. This PR is closed unmerged.


Generated by Claude Code


Generated by Claude Code

hyperpolymath added a commit to hyperpolymath/rsr-template-repo that referenced this pull request Nov 9, 2026
## What

The **RSR oracle** job in `dogfood-gate.yml` and the scanner in
`hypatia-scan.yml` move from OTP `28.3` to `28.5.0.8`. Both cache keys
now carry the exact OTP version.

## Why

The OTP matrix run in hyperpolymath/hypatia#1032 (closed diagnostic)
found the following:

- **Crashes:** Hypatia `be98f74` segfaults on every run when it is
compiled and run on **OTP 28.1, 28.2 or 28.3**: rc 139 on 5 of 5 runs
for each version. The crash is in `sweep_off_heap`, during GC, under
`beam_jit_bs_init_bits`.
- **Clean:** the same tree runs clean on OTP 27.3, 28.0 and
**28.5.0.8**. Hypatia main is clean on all of them.
- **Likely cause:** a compiler bug that was fixed upstream in OTP 28.4
(OTP-19951, erlang/otp#10588). This is inferred and not proven: no test
compiled the tree under 28.5 and ran it under 28.3. Upstream has already
fixed it, so there is nothing to file.

Following the owner's ruling to pin around a faulty version window, both
jobs move to the version the matrix ran clean. The Hypatia pin stays at
`be98f74`, so the scorer is unchanged.

**The cache key matters.** The old key, `…-otp28-…`, would have restored
a `_build` compiled under 28.3 into the new runtime, and the miscompiled
beams would have survived the OTP bump. The new key holds the full
version, `otp28.5.0.8`.

## Not in this PR

- **`oracle-segfault-diag.yml`** still names 28.3. rsr-template-repo#297
removes that whole file.
- **Other 28.3 pins in the estate:** standards `governance-reusable.yml`
and `hypatia-scan-reusable.yml`, and Hypatia `ci.yml` and the
`rsr-oracle.yml` input default. Those are separate PRs in their own
repos.

## Checks run locally

- `tests/workflows/validate_workflows_test.sh`,
`check_lock_sync_test.sh` and `workflow_edges_test.sh` pass.
- `scripts/check-lock-sync.sh` and `scripts/check-workflow-edges.sh` are
clean.
- The action SHAs are unchanged, so `actions.lock` needs no edit.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01E294yTkKk127qgKEXFFDBE)_

Co-authored-by: Claude <[email protected]>
hyperpolymath added a commit to metadatastician/standards that referenced this pull request Nov 9, 2026
## What

- `governance-reusable.yml`, `hypatia-scan-reusable.yml` and the Hypatia
projection job in `self-test.yml` move from OTP `28.3` to `28.5.0.8`.
- The two `hypatia-scanner-v4-…` cache keys now include the OTP version.

## Why

hyperpolymath/hypatia#1032 ran a matrix of OTP versions:

- Hypatia `be98f74` segfaults on every run (rc 139, 5 of 5) when it is
compiled and run on **OTP 28.1, 28.2 or 28.3**.
- It is clean on 27.3, 28.0 and 28.5.0.8.
- The likely cause is OTP-19951 (erlang/otp#10588), fixed in 28.4. That
is inferred, not proven.

These reusables build whatever Hypatia SHA the caller names, and every
consumer runs them. Leaving them on a release whose compiler is known to
be faulty puts the whole estate at risk.

The cache keys matter on their own. A cached `~/hypatia` holds an
escript of beams compiled under the old release. The SHA-only key would
have restored that escript under the new runtime, and the guard steps
would then have skipped the rebuild.

## Companion PRs

- hyperpolymath/hypatia#1037 moves the oracle default and Hypatia's own
CI.
- hyperpolymath/rsr-template-repo#311 moves the spine's oracle and
scanner.

## Checks

- All three workflows parse.
- No action SHA changed, so the locks are untouched.
- The local runs of `check-workflow-*` and `check-lock-sync` give the
same results here as on unmodified main. They fail there too, because
this container's `yq` is the Python one. CI is the real check.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01E294yTkKk127qgKEXFFDBE)_

Co-authored-by: Claude <[email protected]>
hyperpolymath added a commit that referenced this pull request Nov 10, 2026
## What

- `rsr-oracle.yml`: the `otp-version` input default changes from `28.3`
to `28.5.0.8`.
- `ci.yml`: both "identical to the dogfood gate" setup steps move to
`28.5.0.8`. The Mix cache key and its restore prefix now include the OTP
version.
- `docs/consumers/rsr-oracle.adoc`,
`docs/consumers/standards-governance.adoc` and `CHANGELOG.adoc` are
updated to match.

## Why

The matrix in the closed diagnostic PR #1032 found:

- Hypatia `be98f74` segfaults every time on **OTP 28.1, 28.2 and 28.3**:
5 of 5 runs per version exited with rc 139, in `sweep_off_heap` under
`beam_jit_bs_init_bits`.
- The same tree is clean on 27.3, 28.0 and 28.5.0.8.
- The likely cause is OTP-19951 (erlang/otp#10588), which was fixed in
28.4. That is inferred, not proven.

Current main runs clean on 28.3 too. But 28.3's compiler can miscompile
code, so keeping the oracle's default toolchain on it leaves every
consumer that relies on the default exposed.

The cache-key change matters on its own. The old key ignored the OTP
version, so a `_build` compiled under 28.3 would have been restored and
reused under 28.5.0.8.

## Companion PRs

- hyperpolymath/rsr-template-repo#311 moves the spine's oracle and
scanner. The `ci.yml` comment says to bump both together.
- A standards PR moves the reusable workflows. The
`standards-governance.adoc` line edited here describes those workflows,
so it is accurate once that PR merges.

## Checks

- Both workflows parse with Ruby YAML and yq.
- No action SHA changed.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01E294yTkKk127qgKEXFFDBE)_

Signed-off-by: Jonathan D.A. Jewell <[email protected]>
Co-authored-by: Claude <[email protected]>
hyperpolymath added a commit that referenced this pull request Nov 13, 2026
)

## Why

`rsr-oracle.yml` defaults to OTP 28.5.0.8. The #1032 matrix found that
release clean, but later trees crash it. The crash is in
`sweep_off_heap`, reached from the JIT's `bs_init_bits`, the same crash
as in #1032. OTP 27.3.4.19 runs cleanly on the same trees
(rsr-template-repo#333, #339).

The template pinned 27.3.4.19 in its own copies (rsr-template-repo#335,
#340). That fixes only the template. Every other caller of this reusable
workflow still gets 28.5.0.8 by default. This PR fixes the default here,
at source.

## Changes

- `.github/workflows/rsr-oracle.yml`: the `otp-version` default changes
from `28.5.0.8` to `27.3.4.19`.
- `.github/workflows/ci.yml`: the 2 jobs pinned "identical to the
dogfood gate", and their Mix cache keys, change to `27.3.4.19`. The
template's gate runs 27.3.4.19 now.
- `docs/consumers/rsr-oracle.adoc`: the stated toolchain changes to
match.
- `docs/consumers/standards-governance.adoc`: states the OTP the pinned
standards reusables really run (28.3 at `7641c7f`). Those reusables move
to 27.3.4.19 in metadatastician/standards#1508.
- `CHANGELOG.adoc`: a new entry corrects the entry of 2026-11-09 that
called 28.5.0.8 clean.

## Evidence

Measured on 2026-11-13: this repository at `be98f74`, `mix
hypatia.rsr_score` on 3 rsr-template-repo trees, 5 runs each. OTP and
Elixir builds come from builds.hex.pm, SHA-256 verified.

| OTP | Elixir | `3213333` | `a55669e` | `af8665c` |
|---|---|---|---|---|
| 28.5.0.8 | 1.19.4 | 5 of 5 clean | **5 of 5 exit 139** | **5 of 5 exit
139** |
| 27.3.4.19 | 1.19.4 | 5 of 5 clean | 5 of 5 clean | 5 of 5 clean |
| 29.1 | 1.20.5 | 5 of 5 clean | 5 of 5 clean | 5 of 5 clean |

On OTP 28.5.0.8, neither a UTF-8 locale nor `+JMsingle true` stops the
crash (3 of 3 each). The scanner crash (`hypatia-cli.sh scan`) comes
from the template's CI record (rsr-template-repo#339); I did not rerun
it.

## Checks I ran

- Both edited workflows parse as YAML.
- `scripts/check-readme-claims.sh` passes.

## Limits

- OTP 29.1 is clean in these runs, but it needs Elixir 1.20, so that row
changes 2 things.
- The cause inside OTP is not known, and it is not yet reported to
erlang/otp.
- The red "Build Test Images", "Integration Status", "Rust Dependency
Audit" and "Security Status" checks also fail on `main`. None of them is
a required check. The audit failure is fixed in #1071.
- **Downstream:** canonry, chancel, czech-file-knife and occupancy-types
still pin 28.5.0.8 in their own `dogfood-gate.yml`. anytype,
autoformal-fidelity, secret-types, system-et and zig-unorm (and the 4
above) pin it in `hypatia-scan.yml`. These are copies of the template,
so they follow the template's realign. This PR does not change them.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_0136P7Zp7h93ZYjxoVNQQYRR

---------

Co-authored-by: Claude <[email protected]>
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.

2 participants