mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 06:45:22 +00:00
[GH-ISSUE #8198] [Bug] UI trace pairs Objective-C handler addresses with method-record file offsets #6480
Closed
opened 2026-11-01 21:11:28 +00:00 by bsakaguchi
·
8 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#6480
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 (Oct 30, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/8198
Originally assigned to: @kaoru0822-kitauji on GitHub.
Before submitting
Area
Native analysis / MCP Evidence projection.
Observed behavior
trace_native_ui_actioncombines an Objective-C handler's implementation address with the file offset of its encoded method-list entry. On an authored arm64 app, the function node reports{ "address": "0x10000077c", "file_offset": 1944 }. In the same real Ghidra MCP session,address_to_file_offsetmaps that function address to 1916. Offset 1944 maps to the distinct encoded method entry at0x100000798.The underlying
inspect_native_dispatch_metadataobservation correctly separatesimplementation_address: "0x10000077c"from its method-recordlocation: {"address":"0x100000798","file_offset":1944}. The UI graph node also retains an Evidence item describing the method entry at that correct record location. The inconsistency is in the node's combined implementation location, not the record Evidence.Reproduction
Compile an arm64 AppKit app with an
AuditControllerclass, anIBActionnamedrunAction:, and a compiled NIB button connected to that action. In a real REA MCP session, callopen_binaryon the.app,trace_native_ui_action({"action":"runAction:"}),inspect_native_dispatch_metadata, andaddress_to_file_offsetfor the returned handler and record addresses. The owned unexecuted fixture used here contains this handler:The binary was built with
clang -arch arm64 -O2 -framework Cocoa; the NIB was built withibtoolfrom a self-authored XIB. The same incorrect node location appeared with Ghidra and Kuna as selected providers.address_to_file_offsetwas verified with Ghidra; original target bytes were not executed or changed.Expected behavior
The handler node's
location.addressandlocation.file_offsetmust describe the same implementation location, or the file offset must remain explicitly unknown. Keep the method-record address and offset in its own Evidence location; do not substitute it for the function's file offset.Impact and scope
An agent using the function node's offset to inspect the handler's bytes may instead inspect the Objective-C metadata entry. This is one thin Mach-O fixture, not a claim about every selector, provider, FAT slice, or method-record encoding.
REA version
d48e472faplus unrelated Kuna baseline changes in #8187.Runtime and platform
macOS arm64; Node 24.22.1; Ghidra 12.1.4; Kuna 1.986.
Target and artifact context
Owned app executable SHA-256
c2bf21802d31ce75925deef6cfc84c29fb768d68eb9f31a233652617957ddd79; the compiled NIB and executable were not run.Interface
Real stdio MCP:
trace_native_ui_action,inspect_native_dispatch_metadata,address_to_file_offset, andread_bytes.Earliest failure stage
Native UI graph projection after the metadata reader has produced distinct implementation and method-record locations.
Relevant output or evidence
0x10000077c, reported offset1944.0x100000798, offset1944.0x10000077c -> 1916;0x100000798 -> 1944.read_bytesat the actual handler returnede00302aafeffff17.Source-derived cause:
src/domain/native/nativeInvestigationGraph.tsconstructs the function location usingimplementation.implementation_addressandimplementation.location.file_offset, though the latter identifies the metadata record for this binary.Typed outcome or recovery expected
Keep distinct record and implementation locations with truthful address-to-file mapping; preserve explicit unknown when implementation offset is not proven. Regression coverage should include an encoded record distinct from its implementation, symbol-only metadata with null offsets, and selected-slice/container offsets. Exercise the real public workflow where feasible.
Analysis or suspected cause
The projection reuses a record-location offset for a different interpretation without proving that the two addresses coincide. A source- or mapping-owned implementation offset would require an explicit provenance and coordinate contract.
@morluto commented on GitHub (Oct 31, 2026):
Looping in @gensokyo-dev @kaoru0822-kitauji @N0zoM1z0 for visibility on the Ghidra, Kuna, and REA tool-design investigation.
@morluto commented on GitHub (Oct 31, 2026):
Real CLI and second fixture control
On REA
b43c329df779708e43ae297f498a844e45d9c923with Ghidra 12.1.4 on macOS arm64,rea trace-native-ui-action <owned UIAudit.app> 'runAction:' --provider ghidra --max-depth 3 --max-nodes 40 --max-edges 80 --format json --full-outputsucceeded and included an Objective-C handler node with address0x1000008a0and file offset2344. Its embedded binary-metadata Evidence separately names the method-entry address0x100000928and offset2344.In a subsequent real Ghidra MCP session on the same target,
address_to_file_offsetreturned2208for handler address0x1000008a0and2344for metadata-entry address0x100000928. This extends the original report to CLI delivery and a second compiled UI fixture; it does not establish all formats or encodings. The executable SHA-256 was6672860af92d9cca5b01e373bc52c66726c495b5413ade073518aba8876f47b7; its digest matches the CLI observation. All six app-file content hashes were unchanged across the MCP mapping control. The fixture was not executed.@morluto commented on GitHub (Oct 31, 2026):
Real CLI handoff to decompilation
On the previously reported
UIAudit.appfixture with REAb43c329/ Ghidra 12.1.4, I followed the UI handler node's two coordinates through the public CLI:0x1000008a0and file offset 2344.rea decompile <app> --procedure 0x1000008a0 --provider ghidrasucceeded and returnedAuditController::runAction_.rea decompile <app> --file-offset 0x928 --provider ghidrafailed: Ghidra mapped it to0x100000928, where no procedure started or contained that address. This is the separately identified method-record address.--file-offset 0x8a0returned the same handler pseudocode as the implementation-address call. All six app-file content hashes were unchanged. The app was not executed.This shows an actual broken handoff for this fixture; it does not imply the wrong offset always fails, since another layout could place it inside a different function. Use the node's implementation address for this case and separately map it when an offset is required.
There is a separate input-format friction: directly passing either decimal number as
--file-offset 2344or--file-offset 2208failed CLI validation, because the declared schema requires a0x-prefixed hexadecimal string. The command's--helpsays it takes a source-file offset but does not state the hex requirement;--schemadoes show the pattern. This does not cause the incorrect coordinate, and #8178 covers the broader address/offset selection design. Initial decimal attempts and subsequent corrected hex attempts are both reported above. The invalid-offset error suggested a procedure search; I ran that exact suggested--jsonsearch and it succeeded.@morluto commented on GitHub (Oct 31, 2026):
Why the inspected tests did not catch this
At affected REA revision
b43c329, I rannpm run test:local -- src/domain/native/nativeInvestigationGraph.test.ts(19 passed) andnpm run test:focused -- tests/boundary/mcp/nativeUiAvailability.test.ts(11 passed). The first attempted to run both undertest:local; the runner correctly refused the boundary test and I reran each with its supported command. Neither run exercised a real provider.The graph tests I inspected primarily assert dispatch joins, resolutions and coverage. Their decoded metadata examples use the same address for
implementation_addressandlocation.address; their placeholder example uses a null file offset. The MCP availability fixture builds symbol-derived dispatch metadata and checks route availability and dispatch edges. These are useful controls for their intended semantics, but the inspected assertions do not compare an implementation's address and offset against an independently mapped real method entry. The inspected standard Ghidra and Kuna real-provider verifier scripts do not calltrace_native_ui_action; this is not a claim that every other test or verifier was exhaustively analyzed. The named test and verifier files are unchanged betweenb43c329and localorigin/main23de10b.A task-level regression can use a source-owned compiled app with a real encoded Objective-C method record at a different location from its handler. Invoke public
trace_native_ui_actionandinspect_native_dispatch_metadata, map the returned handler address independently with real Ghidra, and check that any non-null handler offset maps to the handler—not the method record. Also retain the record's own correctly located evidence; a truthful unknown handler offset is acceptable if mapping is unavailable. Exercise selected-slice/container and symbol-only cases as separate controls rather than treating one fixed offset as universal. No target execution or UI launch is required.@morluto commented on GitHub (Oct 31, 2026):
Additional test-scope control: REA already has a separate real
verify:interface-builderlane, and I ran it successfully on this macOS host atb43c329. It builds a compiled AppKit NIB and exercisesdecode-interface-builderthrough public CLI and stdio MCP, including action connections and boolean polarity. CI's Apple artifact job invokes it. This is valuable real-archive coverage, not a simulated provider test.That verifier's compiled executable fixture is
int main(void) { return 0; }; the inspected verifier does not calltrace_native_ui_actionor assert an Objective-C handler implementation/address-to-file-offset join. Its passing result therefore does not contradict the real UI handler mismatch above. A regression could extend this existing Apple workflow or add a provider-gated companion with an actual Objective-C handler and real Ghidra, subject to the project's CI/provider setup. The verifier, fixture, and CI workflow were unchanged betweenb43c329and localorigin/main23de10b.@morluto commented on GitHub (Oct 31, 2026):
A second existing CI lane covers the other half independently:
npm run verify:apple-dispatchpassed on this macOS host atb43c329. It built and statically inspected Objective-C fixtures with symbolized and stripped variants, multiple dyld/fixup encodings including arm64e, and also Swift cases; its report says the targets were not executed. The verifier checks that selected implementation addresses exist and exercisesinspect_native_dispatch_metadatathrough public CLI/MCP for one variant. It does not join that metadata to a compiled NIB action or check the UI graph node's implementation/file-offset pair.Together, the existing real Interface Builder and dispatch verifiers cover the producers; the missing check is the composed boundary between them and the real provider's address mapping. A regression can reuse their fixture-building patterns, while keeping the existing independent tests useful. The inspected dispatch verifier source was unchanged at local
origin/main23de10b.@morluto commented on GitHub (Oct 31, 2026):
Universal Mach-O control with selected-slice provenance
I built an unexecuted x86-64/arm64 universal AppKit app from the same source and NIB, then exercised real REA
b43c329MCP on macOS arm64. Forced Ghidra and Kuna correctly refused the universal executable under their current provider boundaries. Automatic selection opened it as arm64 and used Hopper's verified private thin image for provider operations, while retaining the universal executable as the Evidence subject.trace_native_ui_action({action:"runAction:"})returned handler address0x100000784paired with container file offset 34752.inspect_native_dispatch_metadataidentified that offset as the distinct encoded method record at0x1000007c0. REA/Hopperaddress_to_file_offsetinstead mapped the handler to container offset 34692, with provider thin-image offset 1924 and slice base 32768. A separate real Ghidra session on the independently compiled arm64 thin file also mapped the handler to 1924 and decompiled the named handler.nm -midentifies the handler at0x100000784; the selected container slice was byte-for-byte identical to that thin file, and the handler bytes at container 34692 matched thin offset 1924. The bytes at record offset 34752 differed.Both auto-provider and Ghidra control sessions closed successfully. All app-file hashes and the separate thin-file hash stayed unchanged; neither target ran. This extends the mismatch to one universal-container layout and checks actual container-versus-slice coordinates, not all FAT layouts or architecture-selection modes. It does not imply Ghidra/Kuna can analyze the universal container directly. The existing source fix needs to avoid copying the record offset even when it is already correctly relative to the original container.
@ShuaixinHuang commented on GitHub (Oct 31, 2026):
@morluto My account (@ShuaixinHuang) currently has eight open PRs in this repository: #8246, #8247, #8250, #8252, #8253, #8256, #8258, and #8259.
The GitHub comparison page reports an eight-open-PR limit for contributors without write access, so I cannot open an additional PR for #8198 at present.
The scoped fix for this issue is committed and preserved on codex/fix-native-ui-handler-location, at 2262e3be9. I will keep it queued until an open-PR slot becomes available.