#6886

test: keep deliberate fixture signals out of systemd-coredump

Openmarceloterra1983wants to merge intofrom

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

Activity

12
chatgpt-codex-connector[bot]1mo ago

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code Review🔄 Running since 2026-10-23T18:39:28.322502Z5650ca8New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

greptile-apps[bot]1mo ago

Confidence Score: 5/5

[Low impact] The PR appears safe to merge, with a non-blocking gap in suppressing crash records when the inherited hard core limit is zero.

Findings

  1.  Deliberate crashes still get recorded ▶
Fix with agent prompt
### Issue 1
tests/fixtures/corelessPrlimit.ts:18-21
If the test runner inherits a hard `RLIMIT_CORE` of zero on a host that pipes dumps to systemd-coredump, `corelessPrlimit` now launches Node directly. Linux ignores that zero limit for piped dumps, so the deliberate signals can still create crash records and desktop notifications. The compiler fixture uses the same fallback.

This is non-blocking, but leaves the original annoyance in that environment. Use a shared launcher that suppresses dumps without raising the inherited hard limit, rather than treating zero as sufficient.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This PR changes only test fixtures to keep deliberate signal deaths out of systemd-coredump.

  • Deliberate signal tests stop leaving Linux core records.

The previous launch failure is fixed. One non-blocking issue remains: the zero-limit fallback can still produce crash records.

Reviews (2) · Last reviewed commit: "test: skip the coreless prlimit wrapper ..." · Reviewed by Greptile

greptile-apps[bot]reviewed1mo ago
chatgpt-codex-connector[bot]reviewed1mo ago
chatgpt-codex-connector[bot]1mo ago

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

marceloterra1983reviewed1mo ago
marceloterra1983reviewed1mo ago
greptile-apps[bot]reviewed1mo ago
CassieFox2317d ago

TL;DR: I ran the PR's 4 changed test files in a Fedora VM, and each run on Node 22, 24 and 26 gave 93 passed and 10 skipped, matching the PR body. From reading the diff, the Darwin fixture changes on every host, which the body doesn't say. Three CI workflows wait for a maintainer to approve them.

I tested head 5650ca8d88.

CheckNode 22.23.4Node 24.22.1Node 26.12.1
4 changed test files4 files pass, 93 tests pass, 10 skipped4 files pass, 93 tests pass, 10 skipped4 files pass, 93 tests pass, 10 skipped

The PR body says "93 passed, 10 skipped", so my counts match on all three Node versions.

The body also says the Darwin, evmole and pwntools fixtures run under prlimit when /usr/bin/prlimit exists. It says that on macOS and Windows the fixtures are unchanged there when /usr/bin/prlimit is absent (PR body lines 15 and 46).

From reading the code, the Darwin fixture does it another way (tests/boundary/process/darwinProcessRunTokenReader.test.ts, lines 303-312):

  • It is now a #!/bin/sh script that runs node -e. Before, it was a #!/usr/bin/env node script.
  • It finds prlimit with command -v prlimit. That searches the folders on PATH, not /usr/bin/prlimit.
  • So the Darwin fixture changes on every host, macOS included, and it uses any prlimit found on PATH.

The evmole and pwntools test files import corelessPrlimit from tests/fixtures/corelessPrlimit.ts, which the PR adds (lines 12-13 of the diff).

One idea: say in the body that the Darwin fixture now always goes through /bin/sh and a PATH lookup. Or have the Darwin fixture use the same corelessPrlimit helper.

CI on 5650ca8d88:

  • CI, PR title and Real packet capture are waiting for a maintainer to approve them (action_required).
  • PR readiness, Greptile Review and Validate author declaration passed.

The head is 2,094 commits behind main b81da90354. GitHub says the PR is mergeable, and its merge state is blocked.

Not run

  • I did not run coredumpctl after the runs, so I did not check that no cores were recorded.
  • I did not run macOS, so the Darwin fixture's /bin/sh path did not run on its home platform.
  • I did not try a merge with current main, b81da90354.
Test setup
  • Box: Fedora 44 VM (4 vCPUs, 8 GB) on my Nobara 44 PC, Linux 7.2.11
  • Node: 22.23.4, 24.22.1, 26.12.1
  • Head / base: 5650ca8d88 / ef475fcf8b (merge base with main)
  • Install: npm ci --offline and npm run test:prepare on Node 24.22.1, exit 0
Commands
npm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- tests/boundary/binaryDiagnostics/pwntoolsLayoutProvider.test.ts tests/boundary/captures/resourceLimits.test.ts tests/boundary/evm/evmoleInterfaceProvider.test.ts tests/boundary/process/darwinProcessRunTokenReader.test.ts

🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊