mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 07:47:29 +00:00
[GH-ISSUE #8476] [Bug] Native value trace omits an external thunk target and its unknown flow #6620
Open
opened 2026-11-01 21:12:44 +00:00 by bsakaguchi
·
0 comments
No Branch/Tag specified
main
release-please--branches--main--components--rea-agents
release-please--branches--main--components--rea-agents--release-notes
codex/procedure-reference-stacked
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#6620
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 @morluto on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/8476
Before submitting
Area
Native analysis or decompilation
Observed behavior
trace_native_valuescan stop at a Ghidra-created external import thunk without exposing that its external target's value flow is unexamined. The trace preserves the observed call to the thunk, but the thunk's synthetic HighFunction contains onlyRETURNand no call to its separately reported target. The trace does not report an unknown for that external target.Reproduction
On macOS, build but do not execute this local arm64 Mach-O dylib:
xcrun clang -arch arm64 -dynamiclib -o fixture.dylib fixture.sresolve_native_call_targetsfor0x1368reports a candidate at0xc000.procedure_info({procedure:"0xc000"})reports a Ghidra thunk with targetEXTERNAL:0x1.read_bytes({address:"0xc000",length:4})returns zero bytes,complete:false; the target is in Ghidra's uninitialized external mapping. These addresses are build-specific.trace_native_values({procedure:"0xc000",max_depth:1,max_functions:3})returns two nodes, zero edges,unknowns: [], and traversal statuscomplete. A separate Ghidraanalyze_functiondossier says it is a thunk, but its available HighFunction has only a syntheticRETURNand a parameter; the value trace does not include that classification or target.trace_native_values({procedure:"_audit_import_call",max_depth:2,max_functions:5})records the call to0xc000and the thunk procedure; it reports an unrelated missing-argument unknown, but none for the external target. By contrast, tracingEXTERNAL:0x1directly returns the explicit unknownGhidra has no HighFunction p-code model for this procedure.Expected behavior
Preserve the observed Ghidra model and resolved call without equating it with the imported implementation. When known thunk metadata identifies an external or otherwise unexamined target, expose the target and the value-flow limitation or an appropriate unknown in the composed result. Do not claim that traversal status
completeestablishes complete runtime behavior, and do not automatically load or execute a library.Impact and scope
The missing distinction can lead a consumer of the trace to treat the stub's small model as the end of the selected call chain. The source dossier and
procedure_infodo expose the thunk classification; the result also contains general decompiler limitations. A real live-session recovery control retrieved the thunk classification viainspect_analysis_viewof the trace procedure's source Evidence on the cold run on main. The warm trace source lookup failed withevidence_integrity_mismatch(existing #8282). On exact PR #8384 heada20c186eb81785c96267f33cec3929ea5aeb8130, the same view retrieved the classification on cold and warm runs. This is a useful additional lookup, not an inline trace unknown or an automatic follow of the external target; offline export/import was not tested for this new case. No agent behavior or runtime call was observed. Two independently built copies of the same external-import fixture were tested on one host, not a prevalence estimate; other architectures and formats remain unverified. An internal-thunk control is described below. The first fixture and the independently rebuilt dylib were not executed and their hashes stayed unchanged during analysis. MCP SDK validated successful results against the compact schema on the first fixture and the full schema on the rebuilt fixture.Internal-thunk counterexample
A separate source-owned arm64 fixture contains a real four-byte branch from
_audit_thunkat0x2c0to the file-backed_audit_targetat0x2b8, which returns 42. Ghidra 12.1.4 independently classified the source as a thunk with target0x2b8;read_bytesreturned the actual branch bytes. For this case its thunk HighFunction contained a COPY at0x2b8and RETURN at0x2bc: it reflected the target's operations even though the thunk body was only0x2c0..0x2c3. Direct target analysis showed the same operation addresses, opcodes and operands, with different Ghidra p-code sequence/identity values. The thunk value trace used the selected thunk asprocedureand preserved the target operation addresses, but did not explain the thunk-to-target relationship inline. This means a blanket statement that every unvisited thunk target was unexamined would be false. Kuna on the same fixture returned the branch/tail-call text but no native def-use model. Successful calls used the compact advertised schema; both fixtures were unexecuted and unchanged.The call-only
trace_call_pathstopped at the branch under both providers, with a scoped negative over their reported call edges. Its separate tail-transfer design question is #8197; this control does not establish a call-path contract bug. Ghidra'sFunction.getThunkedFunction(false)exposes the referenced function; the provider's classification uses that immediate target. A further source-owned two-thunk chain confirmed the distinction: Ghidra reported outer0x2cc→ immediate0x2c8and inner0x2c8→0x2c0, while both HighFunctions contained operations at the final function's0x2c0and0x2c4. The outer trace retained the outer selected procedure and those operation addresses but did not report either thunk relationship. Actual Kuna reported no native def-use model. This is one static chain, not proof that all thunk models resolve recursively.A fresh real Ghidra compact MCP session on this chain also exercised an existing manual route:
inspect_analysis_viewon the trace procedure's retained source exposed the first target,procedure_infoon that target exposed the next,resolve_containing_procedureidentified the final function, andinspect_native_instructiondecoded all three addresses. All calls succeeded against advertised schemas; the target hash was unchanged. This was a cold-session scripted sequence, not an autonomous-agent or warm/offline replay study.Any solution must distinguish a target already represented in a borrowed model from an unmodeled external target, retaining each source's provenance and the selected procedure.
REA version
a6caa79bf4f393c02601fbf2f6df246eae0b1558.Runtime and platform
Node 24.22.1, macOS arm64, Ghidra 12.1.4/JDK 21; public stdio MCP.
Target and artifact context
Source-owned arm64 Mach-O dylib with a file-declared
_mallocGOT binding; static analysis only.Interface
MCP
Earliest failure stage
Native analysis or reconstruction.
Relevant output or evidence
The target thunk's
classificationis{external:false, thunk:true, thunk_target:"EXTERNAL:0x1", provenance:"ghidra-function-manager"}. Its direct value trace contains aRETURNoperation and parameter, nounknowns, and no edge toEXTERNAL:0x1. Directly tracing the external entry retains the no-model unknown. The separately measured file binding and synthetic uninitialized Ghidra memory are different observations; neither establishes runtime loader behavior.Typed outcome or recovery expected
A trace consumer can see that the known thunk target was not analyzed, while keeping the exact observed stub/model and its provenance. A caller can then explicitly inspect an available external target or a separately selected library; unavailable external implementation remains unknown.
Analysis or suspected cause
Source-derived:
NativeValueTrace.tsconsumes the dossier'snative_value_flow, follows recoveredCALL/CALLINDoperations, and records procedure address/provider/Evidence ID. It does not currently project or follow the dossier's thunk classification and target. Ghidra supplies a valid but synthetic no-call HighFunction for the thunk, so this path reaches neither the external entry nor the no-model branch. This explains the observed result; it is not a claim that Ghidra's model is incorrect or that every thunk needs automatic traversal.Additional context
Related #8408 concerns associating a Mach-O slot with its file-declared binding; #8277 concerns missing computed-call target completeness; #8282 concerns retained trace source closure. This issue is specifically about preserving a known thunk-to-target boundary in a value trace. Suggested further controls include internal backed thunks with distinct nontrivial target flow, longer or cyclic chains where permitted, real call edges, limited depth, and export/import; these have not been fully exercised. @gensokyo-dev @kaoru0822-kitauji @N0zoM1z0