[PR #6886] test: keep deliberate fixture signals out of systemd-coredump #7432

Open
opened 2026-11-01 21:47:49 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6886
Author: @marceloterra1983
Created: 10/23/2026
Status: 🔄 Open

Base: main ← Head: test/fixtures-no-coredump


📝 Commits (4)

  • b2f7ee0 test(process): keep the deliberate compiler SIGSEGV from dumping core
  • 84ba5af test(captures): keep the SIGXFSZ fixture out of systemd-coredump
  • 5b7e7a3 test(providers): keep deliberate resource-signal fixtures out of systemd-coredump
  • 5650ca8 test: skip the coreless prlimit wrapper under a hard core limit of 0

📊 Changes

5 files changed (+41 additions, -4 deletions)

View changed files

📝 tests/boundary/binaryDiagnostics/pwntoolsLayoutProvider.test.ts (+4 -1)
📝 tests/boundary/captures/resourceLimits.test.ts (+3 -1)
📝 tests/boundary/evm/evmoleInterfaceProvider.test.ts (+4 -1)
📝 tests/boundary/process/darwinProcessRunTokenReader.test.ts (+9 -1)
➕ tests/fixtures/corelessPrlimit.ts (+21 -0)

📄 Description

Summary

Four test fixtures kill themselves on purpose (SIGSEGV, SIGXFSZ, SIGXCPU) to exercise REA's signal and resource-limit classification. On Linux hosts with systemd-coredump, every test run records those deaths as real crashes (coredumpctl list) and raises desktop crash notifications. This PR keeps the deliberate deaths out of the core-dump pipeline without changing what the tests assert.

Problem and expected behavior

Trigger: run the affected boundary tests on a host where kernel.core_pattern pipes to systemd-coredump. Each run leaves entries like SIGXCPU present /usr/bin/node and SIGXFSZ none /usr/bin/python3.14 (command lines node -e 'process.stdout.write("resource diagnostic", () => process.kill(process.pid, "SIGXCPU"))' and /tmp/rea-tshark-file-limit-*/file-probe).

Expected: the fixture still dies by the same signal, and the provider still observes it, but no core is produced or recorded.

Change and scope

Test-only. Production code is not touched.

  • darwinProcessRunTokenReader.test.ts (SIGSEGV) and the evmole/pwntools resource fixtures (SIGXCPU, SIGXFSZ) run under prlimit --core=1:1 when /usr/bin/prlimit exists and the inherited hard core limit is not 0 (tests/fixtures/corelessPrlimit.ts; an unprivileged process cannot raise a hard limit of 0, and cores are already off then). With RLIMIT_CORE=1 the kernel discards the core, and the limit survives exec, so the node child keeps its PID and its own process.kill(process.pid, …) still targets itself. Hosts without prlimit behave as before.
  • resourceLimits.test.ts (SIGXFSZ from a real kernel file-size limit): the Python fixture calls prctl(PR_SET_DUMPABLE, 0) before the overflowing write. RLIMIT_CORE=0 alone is not enough there: systemd-coredump still logs the crash.

Not included: other deliberately failing fixtures that never showed up as coredumps on this host.

Contribution scope: ordinary test fix within existing boundaries; maintainer scope decision not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: test fixtures only.

  • Contribution scope fit and linked maintainer decision: not applicable.

  • CLI and MCP/tool-catalog contract: none.

  • Provider, bridge, target-format, or platform compatibility: none; the wrapper applies only when /usr/bin/prlimit exists.

  • Evidence, artifact, provenance, or reconstruction contract: none.

  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.

  • Generated metadata, package, or installation impact: none.

  • Read existing files or captured data.

  • Launch or attach to a process.

  • Inject instrumentation or run scripts/code.

  • Change process memory, registers, files, or configuration.

  • Contact network services.

  • Recover protected code or work around protections.

  • Documentation or usability only; no target interaction.

  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: the four fixture files above; assertions unchanged.
  • Base reproduction or other evidence: on the base revision, a run of these tests on Arch Linux (systemd-coredump) left SIGXCPU/SIGXFSZ node cores, a SIGXFSZ python3.14 record and a SIGSEGV node core in coredumpctl list. With this branch, the same runs leave No coredumps found.
  • User-visible CLI/MCP output (if applicable): not applicable.
  • Remaining proof gaps: macOS and Windows not run; the fixtures are unchanged there when /usr/bin/prlimit is absent.

Validation performed

Node 24.22.1 (.nvmrc), Arch Linux x64:

  • npm run test:focused -- tests/boundary/evm/evmoleInterfaceProvider.test.ts tests/boundary/binaryDiagnostics/pwntoolsLayoutProvider.test.ts tests/boundary/captures/resourceLimits.test.ts tests/boundary/process/darwinProcessRunTokenReader.test.ts: 4 files passed, 93 tests passed, 10 skipped.
  • npx vitest run <evmole> <pwntools> -t SIGX: all 6 SIGXCPU/SIGXFSZ cases passed.
  • coredumpctl list --since -25min after the runs: No coredumps found.
  • npm run check:fast: 2/2 tasks successful.
  • Same four files under prlimit --core=0:0 -- npm run test:focused … (inherited hard core limit of 0, after review): 4 files passed, 93 tests passed, 10 skipped.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: Linux only.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: test-only; it lowers the core limit of the fixture child only.

Author readiness

Human owner: @marceloterra1983

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🤖 Generated with Claude Code

https://claude.ai/code/session_01A8ufWyj1ejxKhzPzhcbeNe


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6886 **Author:** [@marceloterra1983](https://github.com/marceloterra1983) **Created:** 10/23/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `test/fixtures-no-coredump` --- ### 📝 Commits (4) - [`b2f7ee0`](https://github.com/morluto/rea/commit/b2f7ee0a6a90d155b223e1e0e2f3c28f5bcbc52f) test(process): keep the deliberate compiler SIGSEGV from dumping core - [`84ba5af`](https://github.com/morluto/rea/commit/84ba5af4ea46f48017d22834945e172d8f7469d2) test(captures): keep the SIGXFSZ fixture out of systemd-coredump - [`5b7e7a3`](https://github.com/morluto/rea/commit/5b7e7a30ca5e229362ac40c76df83f87860fa230) test(providers): keep deliberate resource-signal fixtures out of systemd-coredump - [`5650ca8`](https://github.com/morluto/rea/commit/5650ca8d88765e81b1c80795d163849cfbccc7d2) test: skip the coreless prlimit wrapper under a hard core limit of 0 ### 📊 Changes **5 files changed** (+41 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `tests/boundary/binaryDiagnostics/pwntoolsLayoutProvider.test.ts` (+4 -1) 📝 `tests/boundary/captures/resourceLimits.test.ts` (+3 -1) 📝 `tests/boundary/evm/evmoleInterfaceProvider.test.ts` (+4 -1) 📝 `tests/boundary/process/darwinProcessRunTokenReader.test.ts` (+9 -1) ➕ `tests/fixtures/corelessPrlimit.ts` (+21 -0) </details> ### 📄 Description ## Summary Four test fixtures kill themselves on purpose (SIGSEGV, SIGXFSZ, SIGXCPU) to exercise REA's signal and resource-limit classification. On Linux hosts with systemd-coredump, every test run records those deaths as real crashes (`coredumpctl list`) and raises desktop crash notifications. This PR keeps the deliberate deaths out of the core-dump pipeline without changing what the tests assert. ## Problem and expected behavior Trigger: run the affected boundary tests on a host where `kernel.core_pattern` pipes to systemd-coredump. Each run leaves entries like `SIGXCPU present /usr/bin/node` and `SIGXFSZ none /usr/bin/python3.14` (command lines `node -e 'process.stdout.write("resource diagnostic", () => process.kill(process.pid, "SIGXCPU"))'` and `/tmp/rea-tshark-file-limit-*/file-probe`). Expected: the fixture still dies by the same signal, and the provider still observes it, but no core is produced or recorded. ## Change and scope Test-only. Production code is not touched. - `darwinProcessRunTokenReader.test.ts` (SIGSEGV) and the evmole/pwntools resource fixtures (SIGXCPU, SIGXFSZ) run under `prlimit --core=1:1` when `/usr/bin/prlimit` exists and the inherited hard core limit is not 0 (`tests/fixtures/corelessPrlimit.ts`; an unprivileged process cannot raise a hard limit of 0, and cores are already off then). With `RLIMIT_CORE=1` the kernel discards the core, and the limit survives `exec`, so the node child keeps its PID and its own `process.kill(process.pid, …)` still targets itself. Hosts without `prlimit` behave as before. - `resourceLimits.test.ts` (SIGXFSZ from a real kernel file-size limit): the Python fixture calls `prctl(PR_SET_DUMPABLE, 0)` before the overflowing write. `RLIMIT_CORE=0` alone is not enough there: systemd-coredump still logs the crash. Not included: other deliberately failing fixtures that never showed up as coredumps on this host. Contribution scope: ordinary test fix within existing boundaries; maintainer scope decision not applicable. ## Contract and boundary impact - Semantic owner and earliest changed stage: test fixtures only. - Contribution scope fit and linked maintainer decision: not applicable. - CLI and MCP/tool-catalog contract: none. - Provider, bridge, target-format, or platform compatibility: none; the wrapper applies only when `/usr/bin/prlimit` exists. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable. - Generated metadata, package, or installation impact: none. - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: the four fixture files above; assertions unchanged. - Base reproduction or other evidence: on the base revision, a run of these tests on Arch Linux (systemd-coredump) left `SIGXCPU`/`SIGXFSZ` node cores, a `SIGXFSZ` python3.14 record and a `SIGSEGV` node core in `coredumpctl list`. With this branch, the same runs leave `No coredumps found.` - User-visible CLI/MCP output (if applicable): not applicable. - Remaining proof gaps: macOS and Windows not run; the fixtures are unchanged there when `/usr/bin/prlimit` is absent. ## Validation performed Node 24.22.1 (`.nvmrc`), Arch Linux x64: - `npm run test:focused -- tests/boundary/evm/evmoleInterfaceProvider.test.ts tests/boundary/binaryDiagnostics/pwntoolsLayoutProvider.test.ts tests/boundary/captures/resourceLimits.test.ts tests/boundary/process/darwinProcessRunTokenReader.test.ts`: 4 files passed, 93 tests passed, 10 skipped. - `npx vitest run <evmole> <pwntools> -t SIGX`: all 6 SIGXCPU/SIGXFSZ cases passed. - `coredumpctl list --since -25min` after the runs: `No coredumps found.` - `npm run check:fast`: 2/2 tasks successful. - Same four files under `prlimit --core=0:0 -- npm run test:focused …` (inherited hard core limit of 0, after review): 4 files passed, 93 tests passed, 10 skipped. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: Linux only. - Package or release metadata impact: none. - Security, privacy, process, or containment review: test-only; it lowers the core limit of the fixture child only. ## Author readiness Human owner: @marceloterra1983 - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01A8ufWyj1ejxKhzPzhcbeNe --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7432
No description provided.