mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 06:45:22 +00:00
[GH-ISSUE #5523] [Feature] inspect_native_api: report whether a function is variadic #3360
Open
opened 2026-10-31 00:39:31 +00:00 by bsakaguchi
·
5 comments
No Branch/Tag specified
main
codex/procedure-reference-stacked
release-please--branches--main--components--rea-agents
release-please--branches--main--components--rea-agents--release-notes
codex/kuna-independent-retry
codex/byte-search-overlay-coverage
codex/open-failure-target-receipt
codex/kuna-xref-evidence
codex/ghidra-ambiguous-procedure-recovery
codex/function-source-bundle
codex/trace-function-integration-prototype
codex/snapshot-source-closure
codex/recorded-evidence-array-pages
codex/evidence-recovery-redesign
codex/trace-feature-address-scope
codex/call-discovery-scope
codex/ghidra-literal-candidate-evidence
codex/decompile-directory-independent-retry
codex/retry-provenance-base
codex/value-flow-capability-experiment
codex/ghidra-containing-instruction
cursor/readme-discord-button-ef9f
dependabot/github_actions/actions/setup-node-7.1.0
dependabot/github_actions/actions/upload-artifact-7.0.2
dependabot/npm_and_yarn/npm-minor-and-patch-d8d97ce6df
codex/kuna-1989
fix/8559-native-ui-fixture-ownership
fix/8555-go-verifier-mcp-ownership
codex/provider-capability-recovery
fix/8642-rizin-target-stdin
codex/ghidra-memory-effect-scope
codex/ghidra-annotation-entry-selector
codex/ghidra-readonly-recovery
codex/ghidra-regex-verifier-recovery
codex/evidence-discovery-view-guidance
fix/8545-bulk-append-overflow
fix/8428-navigation-refusal-alternatives
codex/address-context-recovery
codex/matching-member-limitations
codex/unknown-scope-contract
codex/evidence-view-guidance
feat/8373-native-trace-views
codex/ghidra-snapshot-verifier-binding
codex/elf-export-visibility
codex/evidence-view-recovery
codex/native-reference-cli-help
codex/provider-candidate-observation-scope
codex/kuna-session-verification
codex/ghidra-switch-lifetime-guidance
codex/pseudocode-paging-discovery
codex/clarify-evidence-view-support
codex/kuna-xrefs-selector-recovery
codex/context-capacity-recovery
codex/evidence-closure-large-links
codex/same-function-evidence-identity
codex/ghidra-verifier-inspected-jdk
codex/audit-guided-workflows
codex/crash-prompt-retained-dossiers
codex/analysis-view-error-recovery
codex/kuna-verifier-target-selection
codex/ghidra-selected-project-call-coverage
codex/docs-native-analysis-scope
codex/ghidra-java-socket-boundary
codex/ghidra-retained-snapshot-verifier
codex/ghidra-search-inventory-facts
fix/8284-zero-argument-parameter-bindings
fix/8198-ui-action-handler-offset
fix/8257-elf-entry-label-identity
fix/8304-deferred-output-schema-projection
fix/8277-call-path-computed-target-uncertainty
fix/pr-8089-conflicts
fix/ci-static-duplicate-export
dependabot/npm_and_yarn/lint-staged-17.6.0
dependabot/github_actions/actions/download-artifact-8.0.2
dependabot/npm_and_yarn/write-file-atomic-8.0.0
dependabot/npm_and_yarn/canonicalize-5.1.0
dependabot/github_actions/actions/cache/restore-6.1.0
dependabot/npm_and_yarn/toon-format/toon-4.4.0
dependabot/github_actions/actions/deploy-pages-5.0.1
codex/review-fixes-pr-2403
codex/review-fixes-pr-2400
codex/process-terminal-width
codex/test-brittleness-cleanup
verify/7167-browser-connect-macos
fix/7167-browser-connect
feat/native-matching-allowance-setting
feat/browser-scenario-dry-run
test/managed-caller-parameters-20261024
codex/parser-fortythird-boundaries
fix/6926-pinvoke-platform-decorations-20261023
fix/6889-har-body-encoding-20261023
fix/6888-sqlite-schema-budget-20261023
fix/dependency-security-gates-6708
cursor/evidence-overwrite-rebase-b4ac
feat/4057-verify-native-exports
fix/windows-acl-observer-overhead-20261022
cursor/erlang-beam-restack-4476
cursor/pe-certificate-review-bf32
fix/6116-javascript-application-fs-errors
fix/6061-unmapped-runtime-script-unknown
feat/browser-scenario-summary
fix/pe-certificates
codex/verify-3407
cursor/rebase-5699
cursor/rebase-5352
cursor/rebase-5600
cursor/fix-cli-schema-omission-10a8
codex/audit-hopper-shutdown-reasons-20261021
fix/demangle-swift-omitted-record
fix/nib-boolean-value-types
cursor/cancellation-partial-observation-a5ac
fix/ib-object-limit-reasons
fix/electron-fuse-limit-advice
fix/kuna-doctor-dangling-cache
fix/fixed-budget-refusal-advice
fix/js-ipc-listener-dedup
fix/js-return-member-provenance
fix/dmg-integrity-retry-advice
fix/ida-doctor-readiness
fix/kuna-version-probe-output-drain
fix/legacy-swift-runtime-name-matching
fix/dylib-lazy-load-commands
fix/browser-scenario-startup-cancel
fix/swift-nested-punycode-classification
fix/compare-unselected-scopes
fix/objc-method-budget-coverage
fix/dmg-mounted-root-observations
audit/ci-tests-20261019-round2
release/6.7.0
fix/wabt-cleanup-retry-resolution
fix/electron-fuse-elf-pe-architecture
fix/native-plist-descriptor-ownership
fix/kuna-caller-cleanup-ownership
experiment/atomic-codemode-20261016
review/first-contributor-3776
fix/call-resolution-full-read-cycles
fix/member-mutation-selection-repeat
experiment/atomic-re-tools-20261015
perf/member-mutation-lazy-origins
perf/static-network-mutation-index
fix/hopper-startup-lifecycle
audit/3050-windows-proof-20261015
feat/windows-window-capture-2183
audit/3049-windows-proof-20261015
audit/3735-macos-fixtures-20261015
fix/batch-decompile-null-pseudocode
fix/kuna-inventory-honors-jobs
experiment/browser-codemode-tool-design-20261015
fix/hopper-clean-runtime-argv
codex/review-2049-27f1b367
review-fixes/pr-2787-routing
fix/3360-scoped-this-emitters
fix/3367-replaced-global-effects
fix/3838-compact-any-value-items
test/hopper-download-probe-20261015
codex/windows-runtime-creation-red-green-20261015
codex/windows-readonly-root-red-green-20261015
codex/windows-root-share-red-green-20261015
codex/exp-1685-win-mcp-startup
codex/bug-sweep-20261015
investigate/2190-windows-package-phases
investigate/3543-macos-cli-deadline
perf/3281-reverse-tools-feedback-quality
fix/3406-hopper-doctor-fixture
fix/3341-wrapper-require-test-context
fix/3301-owned-uninstall-fixtures
fix/3164-compiler-input-ownership
fix/pcap-cleanup-stdout-newline-20261014
perf/interface-builder-summary
codex/review-fixes-pr-1977
fix/ghidra-effective-jvm-platform
fix/docs-turkish-rust-link-20261013
fix/main-maintenance-ci-20261010
fix/recover-binary-session-process-effects
codex/review-fixes-pr-2457
codex/ci-required-cancellation-gate
fix/main-format-baseline-20261013
fix/setup-preserve-entry-fields
cursor/restore-main-checks-1ffc
fix/ghidra-bridge-hashmap-import
codex/shared-ci-jadx-json-default-20261013
codex/shared-ci-ghidra-test-groups-20261013
codex/shared-ci-java-fixture-format-20261013
codex/fix-intrinsic-invocation-boundaries
test/release-preflight-reusable-jobs
test/js-parameter-provenance-expectation
fix/linux-hopper-verification-current
test/2419-ghidra-elf-probe-size
followup/pr-1544-native-ida
codex/fold-pr-2230-contribution
docs/readme-responsible-use
fix/issue-2064
fix/issue-2050
fix/issue-2053
fix/issue-1968
fix/issue-1945
experiment/codemode-bridge-20261011
fix/tool-effects-negative-wording-1904-20261012
fix/1842-electron-interop-provenance
feat/recover-javascript-multi-input
refactor/website-i18n-prep
fix/nativeaot-pe-virtual-extent
fix/browser-verifier-ci-hang
fix/pe-resources-input-selection
docs/beginner-friendly-guides
docs/beginner-setup-guide
fix/javascript-analysis-worker-1563
fix/1649-ghidra-duplicate-names
fix/javascript-export-keys-integration-1369
test/maintenance-boundary-contracts-20261011
review/javascript-export-keys-1369
review/process-live-progress-1483
test/javascript-1495-growth-ratio
fix/ci-escape-timing
docs/normalized-terminal-geometry-1450
release/6.3.0
archive/release-6.3.0-pr1381
release/6.2.0
fix/electron-preload-dynamic-override
fix/javascript-self-referential-bundler-edges
release/6.1.0
cursor/grok-client-cherry-pick-0b56
feat/signature-posture
feat/dyld-shared-cache
feat/artifact-integrity-policy
feat/pkg-inventory
release/6.0.0
chore/sync-release-5.0.0
release/5.0.0
cursor/cloud-agent-node-787e
fix/javascript-xhr-open-endpoints
review/pr-711-realpath-fallback-wording
cleanup/replay-confinement
codex/test-suite-performance
codex/issue-foundations
codex/address-open-issues-2026-07-20
agent/javascript-vite-rollup-esbuild-adapters
agent/process-cleanup
agent/triage-integration
agent/unknown-commands-registry
feat/mcp-identity-metadata
morlvps/issue_cleanup
codex/installer-redesign
morl/roadmap-investigation-core
morl/roadmap-investigation-docs
release-please--branches--main--components--rea
rea-agents-6.8.0
rea-agents-6.7.0
rea-agents-6.6.0
experiment/atomic-codemode-wait-runtime-20261016
rea-agents-6.5.0
rea-agents-6.4.0
rea-agents-6.3.0
rea-agents-6.2.0
rea-agents-6.1.0
rea-agents-6.0.0
rea-agents-5.0.0
rea-agents-4.1.0
rea-agents-4.0.1
rea-agents-4.0.0
rea-agents-3.2.1
rea-agents-3.2.0
rea-agents-3.1.0
rea-agents-3.0.0
rea-agents-2.7.0
rea-agents-2.6.0
rea-agents-2.5.1
rea-agents-2.5.0
rea-agents-2.4.0
rea-agents-2.3.0
rea-agents-2.2.0
rea-agents-2.1.0
rea-agents-2.0.0
rea-agents-1.7.0
rea-agents-1.6.0
rea-agents-1.5.0
rea-agents-1.4.0
rea-agents-1.3.0
rea-agents-1.2.0
rea-agents-1.1.0
rea-agents-1.0.0
rea-agents-0.5.0
rea-agents-0.4.0
rea-agents-0.3.0
rea-0.2.1
rea-0.2.0
Labels
Clear labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
Mirrored from GitHub Pull Request
question
roadmap
triage
No labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
question
roadmap
triage
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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#3360
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Rinkia on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/5523
Before submitting
Area
Native analysis or decompilation
Current limitation
inspect_native_apireconstructs a function boundary ascalling_convention,return_typeandparameters[]with storage, but it has no field for a variadic signature. A variadic function is indistinguishable from one with only its fixed parameters.Fixture (x86-64,
gcc 13.3 -O1 -g):rea inspect-native-api abi f_var --provider ghidraonrea-agents@6.7.0(Ghidra 12.1.4) returns:parameters:[{name: "n", data_type: "int", storage: "EDI:4"}]signature_source:"imported",calling_convention:"__stdcall"available, provenance, signature_source, calling_convention, return_type, parameters, jump_tables, pseudocode, decompiler_artifacts, limitationsNone of these says "variadic". The information is available upstream of REA:
rea decompile abi f_var --provider ghidraprintslong f_var(int n,...), so Ghidra's function has var-args set.f_varhas aDW_TAG_unspecified_parameterschild.git grep -i varargsfinds no match insrc/orbridge/onmain074768901, so the bridge doesn't readFunction.hasVarArgs().Use cases
f_vartakes one argument and that callers pass nothing else. The extra arguments sit in registers and on the stack (and in AL on x86-64 SysV), and are easy to dismiss as noise.n.Desired outcome and success criteria
varargs: true | false | null), withnullwhen the provider can't tell. Nothing should be inferred from...text.hasVarArgs(), the result istruewith evidence naming the source (signature source, DWARF import or user annotation). Fixed-arity functions readfalse.Expected interaction with targets
Read existing files or captured data
Target and scope details (optional)
Minimal check: compile the fixture above, then compare
inspect_native_apionf_varwith a fixed-arity sibling such aslong f_seven(long a, long b, long c, long d, long e, long f, long g). A stripped build, where Ghidra may not know, is a usefulnullcase.Verification available so far
I have a prototype or observed results
Verification details (optional)
Observed on
rea-agents@6.7.0, Linux x86-64, Ghidra 12.1.4. Fixture binary sha256844b7a8568814711681a1cf7998367e954e3d17feeed6b111e09ae7b78e038bc, built reproducibly from the source above. On the same fixture, the other 11 exported functions' parameter and return storage matched the SysV psABI by hand derivation, exceptunsigned __int128, which follows Ghidra's prototype model.Alternatives considered
...out of the pseudocode text. That is fragile, and the boundary's limitations already say the pseudocode is not source.analyze_function. That reaches the same Ghidra function, but agents asking specifically about the API boundary would still miss it.Possible direction
Read
Function.hasVarArgs()in the Ghidra bridge next to the existing signature-source and calling-convention facts, and add it to the boundary schema as a nullable boolean. Other providers reportnulluntil they can supply it.References
ghidra.program.model.listing.Function#hasVarArgs@morluto commented on GitHub (Oct 31, 2026):
Additional real Ghidra 12.1.4 / REA
b43c329MCP control on macOS arm64: I copied a selected Ghidra project and deliberately toggled the same user-defined, zero-fixed-parameter function fromhasVarArgs=falsetotrue. Headless Ghidra reportedint audit_zero(void)andint audit_zero(...), respectively. REA's complete dossiers retained those different display signatures, butinspect_native_apireturned identical normalized results for both:signature_source: "user_defined",parameters: [], and no structured variadic fact. Their analysis-profile digests differed, correctly reflecting different project states.This is an intentionally edited metadata control on a binary whose source is non-variadic, not a real variadic call or ABI reproduction. It demonstrates why neither an empty parameter array nor
user_definedalone can resolve the distinction, and complements the real variadic fixture in the issue description. The original project and binary were unchanged; REA did not change the edited copy. Related value-trace issue #8284 needs the same distinction to avoid replacing a missing-bindings unknown with an unjustified fixed-zero conclusion. A structured fact should preserve unknown where the provider cannot establish it.Looping in @gensokyo-dev @kaoru0822-kitauji @N0zoM1z0 for visibility on the REA tool-design investigation.
@morluto commented on GitHub (Oct 31, 2026):
Compiled Apple arm64 variadic control
On REA
b43c329, Ghidra 12.1.4 and macOS arm64, I compiled an unexecuted fixture containingaudit_variadic(int tag, ...)usingva_arg(args, long), a fixed siblingaudit_fixed(int tag, long value), and a caller invoking both with(5, 99L). LLVM's DWARF dump showedDW_TAG_unspecified_parametersunder the variadic callee. Independent disassembly showed the caller storing 99 at[sp]before the variadic call, and passing 99 inw1before the fixed call. This verifies the fixture's emitted static facts; it does not establish whether Ghidra imported the sidecar DWARF.In a fresh real REA/Ghidra MCP session,
inspect_native_apireportedsignature_source: "default"for both functions: the variadic callee had one low-confidence recovered fixed parameter, and the fixed sibling had two. No structured variadic flag appeared. The dossier displayed the variadic callee asundefined _audit_variadic(), so in this fresh-import case even the display signature did not reveal the source's ellipsis.trace_native_valuesfor the caller retained both direct calls, three fixed-parameter binding edges and two return bindings; it did not emit a per-call unknown for the stack-passed variadic value. Its general limitations did explicitly say variadic arguments remain unknown, andtruncated:falseconcerns traversal, not proof of complete argument recovery. Kuna's API boundary and def-use model were explicitly unavailable for the same fixture.This extends the earlier artificially edited-project control to one real arm64 variadic call and shows why the general limitation matters. It does not establish a particular Ghidra analyzer setting, imported prototype, runtime behavior, or a universal ABI claim. Compare #3083 for Apple-arm64 pseudocode and #8284 for the related need to distinguish fixed-zero, variadic and unknown parameter coverage. The target and debug companion hashes were unchanged, and both sessions closed successfully; no target was executed.
@morluto commented on GitHub (Oct 31, 2026):
The compiled arm64 fixture above also has a selected-project control with an explicitly authored, correct prototype. After importing the binary into a disposable Ghidra project, a headless script set
audit_variadic(int tag, ...)withUSER_DEFINED/hasVarArgs=true, and the fixed sibling with two parameters andhasVarArgs=false. The setup log confirms those states. Some DWARF expression recovery errors were logged during import; the explicit prototype settings are independent of those errors.In a real REA/Ghidra MCP session bound to that project, the complete variadic dossier displayed the ellipsis, and
inspect_native_apireturnedsignature_source: "user_defined", one fixed parameter and no structured variadic flag; itsresidual_unknownswas empty. The fixed sibling returned two fixed parameters. The caller's value trace retained the two direct call edges, three fixed-argument bindings and return edges, with no per-call unknown for the variadic tail. Its general limitations continued to state that variadic arguments remain unknown. Thus even when the selected Ghidra program knows the prototype, the structured boundary omits that fact; an empty local unknown list must be read with the broader limitations.The project and target hashes remained unchanged during the REA session, and the target was not executed. This tests one explicitly authored project and call site, not runtime argument recovery or all compilers. It supports a producer-owned structured variadic flag with an explicit unknown where appropriate, while preserving the existing non-source and call-flow limitations.
@morluto commented on GitHub (Oct 31, 2026):
A related x86-64 Mach-O control on main
d54a4661ddistinguishes missing metadata from missing call operands. With an explicitly authoredint audit_variadic(int count, ...)project, Ghidra's high p-code supplied three caller operands (2,7,11), and REA kept all three on the CALL node. The trace bound the fixedcountparameter but supplied no per-call unknown for the other two; the general variadic limitation remained present. The two-argument fixed sibling bound both operands. A fresh Ghidra import produced the same counts on this particular fixture.I filed #8358 for the distinct question of locating already-recovered operands without parameter bindings. Structured signature metadata remains necessary for #5523, and no assumption that an unmatched operand proves variadicness is warranted. The static target and project hashes stayed unchanged during REA sessions; no target was executed.
@morluto commented on GitHub (Nov 1, 2026):
An existing implementation is already under review in #8343: it adds
native_api.parameter_listto the existing function boundary, including a provider-derivedvariadicflag and whether the list is signature-based or recovered. I exercised its exact head84f66cc672f4bf7725e21bd3b5c73c2c5c4b35d0with real Ghidra 12.1.4/JDK 21 on the two selected x86-64 Mach-O projects described in #8358, using pinned Node 24.22.1 and compact SDK stdio MCP:parameter_list: {"basis":"signature","variadic":true}andsignature_source: "user_defined".{"basis":"signature","variadic":false}and the same signature source. The two projects also produced different recovered CALL operands, as described in #8358.This supports exposing Ghidra's prototype fact in the existing boundary while making its provenance visible. A
falsevalue reports the selected decompiler prototype, not proof that the shipped binary's original source function is non-variadic. This control used user-authored prototypes, one fixture and one host; it does not establish detection of all inferred, stripped, or imported signatures. The PR does not itself add located unknowns for the unmatched operands in #8358.The actual
rea inspect-native-apiCLI on the same PR head and pinned Node also returnedok: truewith the matchingsignature/true andsignature/false parameter-list facts for the two selected projects. Target and project-tree hashes matched the pre-CLI state. This is a real-provider CLI control, in addition to the stdio MCP checks above.