Repository navigation
feat(native): inspect recorded crashes through pwntools and pwndbg - #1054
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfd3627b52
ℹ️ 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".
|
@codex review the latest 818d70e follow-up as well as the core-only ownership and evidence boundaries. Final self-review reproduced a portable validator gap: an EVIL NUL-terminated raw owner could be accepted if its display label said CORE (both thread and signal variants). The validator now requires exact raw CORE bytes, matching the existing unchanged decoder behavior;31 focused checks pass. The first real CI stopped at missing GDB on the disposable runner, before provider execution; the workflow now provisions that CI prerequisite. VPS defaults are unchanged. The earlier installed28-case proof passed, and a current-package owner-boundary smoke is running. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 818d70efac
ℹ️ 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".
|
@codex review the latest b2cd148. All three findings are fixed and backed by failing-before/passing-after regressions: compatible OSABI/version checks before Linux note interpretation, independent snapshot binding of PID/signal scalars, and derived confidence for mixed debugger-map Evidence. Latest39 focused tests and static/build/docs/format checks passed; the freshly installed package passed36 real CLI/MCP/core-only trace cases, complete139-tool schemas and cleanup with no descendants. Earlier818d70ef hosted core and ELF real-tool lanes passed. Waiting for all latest-head CI before merge. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2cd148bb3
ℹ️ 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".
|
@codex review latest9147e89b, addressing the remaining completeness finding. Each supported raw note must have exactly one interpretation and each thread every supported register exactly once, with register names independently bound to ABI slots.12 regressions failed before the fix;51 targeted checks and latest installed6-case CLI/MCP smoke with139-tool schema/inventory parity now pass. Full36-case installed verification passed locally and in hosted CI on b2cd148; latest-head CI is running. No additional feature scope. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9147e89b90
ℹ️ 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".
|
@codex review the latest 9ba594c, addressing the physical note identity finding. Pure aligned/physical coverage checks and independent snapshot header/count/kind bindings prevent duplicate or hidden notes/segments; owner displays are checked against raw bytes as well. Latest 64 targeted tests and freshly installed 42-case CLI/MCP/core-only trace verification passed, including extended program counts and zero/nonzero note tails, all 139 schemas and empty descendants. The unchanged upstream parser remains in use. Waiting for latest-head CI before merge; no new feature scope. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be6c54e3ad
ℹ️ 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".
| if content[4:6] != b"\x02\x01": | ||
| raise CoreFailure("unsupported-target", "Initial recorded-core profile requires ELF64 little-endian.") | ||
| if len(content) < 64: | ||
| raise CoreFailure("format", "Selected ELF64 core header is truncated.") |
There was a problem hiding this comment.
Reject invalid ELF versions before decoding core notes
When an otherwise valid-looking core sets either EI_VERSION (byte 6) or the ELF header's e_version field to a value other than EV_CURRENT, these checks still proceed because they validate only class, endianness, OSABI, type, and machine; the independent snapshot binding omits both version fields as well. Such a malformed carrier can therefore have its Linux note payload interpreted and returned as observed crash evidence instead of producing an invalid-format failure, so validate both version fields before constructing ELFFile and bind them again at the consumer boundary.
AGENTS.md reference: AGENTS.md:L63-L63
Useful? React with 👍 / 👎.
| for (const [key, path, kind] of [ | ||
| ["REA_PWNDBG_GDB", gdb, "file"], | ||
| ["REA_PWNDBG_GDBINIT", entry, "file"], | ||
| ["REA_PWNDBG_VENV_PATH", venv, "directory"], | ||
| ] as const) { |
There was a problem hiding this comment.
Check cancellation before debugger configuration probes
When include_debugger_context is requested and cancellation arrives after the basic decoder completes but before or during this preflight, an invalid or missing GDB/pwndbg path is caught and converted to AnalysisCapabilityUnavailableError because the first abort check occurs only after all three probes and the staging writes. The caller can therefore receive a provider-configuration failure instead of cancellation; check the signal before these probes and preserve cancellation if it fires while they run.
AGENTS.md reference: AGENTS.md:L59-L59
Useful? React with 👍 / 👎.
…orluto#1054) * feat(native): inspect recorded crashes through pwntools and pwndbg * fix(native): bind core note semantics to raw owner bytes * fix(native): validate recorded core ABI and evidence scalars * fix(native): require complete recorded note interpretations * fix(native): bind physical core notes to original headers
Summary
Refs #969. Add a general recorded-crash capability: inspect an explicit Linux core independently of an active disassembler or live process. This is useful for application crash investigation and binary analysis; CTF is only one possible application.
Problem and expected behavior
REA's offline ELF tool deliberately excludes cores. Agents need every recorded thread/register, original note bytes and source locations, with optional debugger mapping context. Historical PIDs must remain recorded metadata and must never select a live process.
Change and scope
Contract and boundary impact
domain/native/recordedCrash; source parsing and ABI interpretation stay in provider bridges.inspect-recorded-crash/inspect_recorded_crash, explicit path and optional mapping-context facet; catalog139/skill33. No approval boolean. Coverage-bearing ELF/note headers, canonical kind labels and owner displays are independently bound to the selected snapshot; exact physical note/padding coverage prevents hidden or duplicated observations.unsupported_targetcategory rather than provider absence.Evidence and regression coverage
/procfiles, and attempted Internet sockets. Exact ownershippsenumeration and observed upstreamiconv -l/selected Git version lookup are separately accounted for. Sentinel survives; no descendants remain after cleanup. Fixture generation explicitly executes its own test program.{"name":"inspect_recorded_crash","arguments":{"path":"/artifacts/crash.core","include_debugger_context":true}}The normalized report includes
target_execution: "not-performed",live_process_identity: "unknown", source-boundthreads[].registers[], rawnotes[], anddebuggerwith core connection, no executable, derived maps and unknown current file identities. This describes inspection, separately from fixture generation.Remaining coverage: full unwinding, executable/library matching, live debugging, other architectures/core formats and other hosts are outside this increment. Shared decoder resource markers, late cancellation and cleanup have deterministic boundary regressions; real GDB memory/CPU exhaustion is not claimed.
Validation performed
npm run check:fast,npm run format:check,npm run docs:check— passed.npm run verify:test-discovery— all576 test files exactly once.npm pack --ignore-scripts/ isolated installation — required bridges/runtime/original licenses included; private plans, reference clones, game data and binary fixtures excluded. Original upstream checkout remains unmodified.node scripts/verify-recorded-crash.mjs <installed>/scripts/rea.mjs— 42 actual CLI/MCP/trace cases passed on the latest9ba594c0 installed package (including GNU/Linux, Solaris, FreeBSD, unsupported ABI-version, extended program counts, zero/nonzero note tails and envelope confidence checks), complete139-tool schema/inventory/session parity; original inputs unchanged, sentinel alive and verifier descendants empty.Compatibility, safety, and release
Review checklist