mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 07:47:29 +00:00
[GH-ISSUE #6311] analyze_javascript_application hangs at parse_javascript_source on 664KB single-line ESM UMD (@castleio/castle-js) #3811
Open
opened 2026-10-31 00:44:18 +00:00 by bsakaguchi
·
3 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#3811
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 @jeremy9682 on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/6311
Originally assigned to: @kaoru0822-kitauji on GitHub.
Summary / observed behavior
analyze_javascript_applicationdoes not produce a result for a single 664 KB minified@castleio/castle-jsvendor bundle. All three recorded CLI runs remained atparse_javascript_source, with the messageParsing and projecting castle.js (1/1), until the main process was externally terminated after approximately 75 seconds. No evidence was returned.The progress event combines parsing and projection, so these observations do not establish whether the parser or semantic projection is responsible, or whether this is an infinite loop rather than unusually slow processing.
Environment
rea-agents6.7.0, using a local source build via/usr/local/bin/rea.bffcb2e3da7e48fc0078844502a39c54a4e37987. The compiled artifact was not verified to match this revision exactly.NOT_ENOUGH_INFOin the saved evidence.parse_javascript_source.NOT_ENOUGH_INFO; no version comparison was performed.Input / target and artifact context
input/castle.js, identified by its header as@castleio/castle-js.a6c454743e5a9bee6211bffad2db559cb9066796435239eeb57b0d427ad09a66.node --check input/castle.jsusing Node v22.22.0 with exit code 0 and empty stdout/stderr. This checks syntax; the target code was not executed, and it does not establish compatibility with REA's parser/projector.@castleio/castle-jsnpm package; exact package version and dist path still need to be matched to the SHA256 above (see Suggested fixture).Command / reproduction
The saved experiment ran one three-variant matrix, with a directory containing only the original
castle.jsfile. The base invocation was:For the second variant, append:
For the third variant, use the base invocation with
--max-heap-mb 1024, without the semantic-limit overrides.The harness set a 75-second external timeout for each main process. The REA setting
--analysis-timeout-ms 600000is a separate internal timeout; this matrix did not wait for that timeout.HOME,TMPDIR,XDG_CACHE_HOME, andCLANG_MODULE_CACHE_PATHwere redirected to directories inside the experiment's scratch workspace. No new analysis run was performed while preparing this issue.Expected behavior / typed outcome or recovery expected
Expected by the reporter: complete analysis and return an evidence identifier/result, or return an explicit, bounded timeout/resource error that can be handled by the caller. Cancellation should leave no analysis worker running. This is an expectation, not a claim that a documented completion-time guarantee was violated.
Actual behavior / relevant output
All three saved stderr logs end with the same event:
Each stdout is empty. The matrix records
exit: null,killed: true, andhas_evidence: falsefor every variant. No OOM or V8 heap-fatal diagnostic appears in the captured stderr.Matrix
parse_javascript_sourceparse_javascript_sourceparse_javascript_sourceAdditional reporter observations, outside this saved matrix: approximately 100% CPU while stuck at this phase, and previous 300-second and 1,200-second attempts also failed to produce a result. CPU samples, commands, and logs for those longer attempts are not present in the supplied evidence; they have not been independently verified during preparation of this issue. They should not be treated as measurements from the three rows above.
Timing / cancellation limitation: the harness used
p.kill()on the main process only. ThreejavascriptAnalysisWorkerProcess.jsworkers survived as orphan processes and were subsequently identified by their experiment-owned working directories and explicitly killed. At cleanup, their recorded running times were approximately 223 / 149 / 73 seconds. The first two workers therefore outlived the 75-second main-process windows and overlapped later variants. These are not strictly isolated 75-second process-tree experiments, and the elapsed times must not be used as comparative performance measurements. Final cleanup evidence records no remaining known experiment processes.Impact and scope
This one vendor file prevents full-file REA analysis coverage of the application under inspection: the original file still has no REA evidence. Omitting it or analyzing a transformed derivative would leave that original-file coverage gap.
No working workaround was found among the tested semantic-limit and heap flags. This does not establish that every possible REA configuration fails. Frequency within the saved matrix: 3 of 3 runs reached the same last phase without a result before external termination. Behavior for other package versions and inputs is untested.
Workarounds tried
No transformed-input workaround was tested, and none is claimed as equivalent coverage of the original file.
Suggested fixture and diagnostic improvements
Use the matching public npm package
@castleio/castle-jsdistribution file as an upstream fixture, in a directory with no other inputs. Package page: https://www.npmjs.com/package/@castleio/castle-js . Match the 664,306-byte size and SHA256 above before claiming an exact reproduction.Exact npm version and distribution filename:
NOT_ENOUGH_INFOin the permitted local evidence. Retrieval from npm and byte-for-byte equivalence were not tested during issue preparation; the package is a suggested fixture source, not a newly verified reproduction.Separate parser start/end and projection start/end progress/timing would help locate the expensive step. Please also clarify when semantic limits take effect. A bounded upstream CPU profile could distinguish slow parsing from slow projection; no CPU stack profile is included here. The observed worker lifecycle after external parent termination may also warrant cancellation handling, alongside fixing the harness to terminate the full process tree.
Checklist
gh issue list -R morluto/rea --state all --search 'castle parse_javascript_source' --limit 20; no matches were returned.@CassieFox23 commented on GitHub (Oct 23, 2026):
Thanks, jeremy9682, for the detailed matrix.
Your harness killed each run at 75 seconds. REA's own deadline was the 600000 ms you set with
--analysis-timeout-ms. So the runs never reached it, and the logs can't tell "stuck" from "slow".To tell them apart, repeat the base command with
--analysis-timeout-ms 60000, under your 75 s kill. The setting's description says what happens on timeout. REA returns the partial Evidence it collected and stops. If it still doesn't stop, please say so here. That would be a real hang.Not run: I did not run your file or this command.
🤖 Written with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊
@kaoru0822-kitauji commented on GitHub (Oct 25, 2026):
Result: this is slow processing, not a hang. REA stops at its deadline and returns partial Evidence. The time goes into a step that grows cubically, in ambient-write indexing (
indexJavaScriptAmbientWritesSteps), during the worker'sstaticphase. The open PRs #6146, #2041 and #6477 don't fix it.What ran (main
bc143125e, macOS arm64, Node 26.5.0, built CLI)Fixture: none of the npm
dist/files matches the reported SHA256 / 664,306 bytes. The closest one I found is jsDelivr's ESM build of@castleio/castle-js@2.8.2(https://cdn.jsdelivr.net/npm/@castleio/castle-js@2.8.2/+esm): 664,054 bytes, 8 lines,export { EK as default }at the end, sha2568c041920539125c1a3ea76fdde7c8187336f58a964b6f0475b495b4527192fd0. It is not byte-identical to the reported file./usr/bin/time -l, parent process; the worker is a separate process).provider_timeoutand adetails.partial_observationthat has anevidence_id. No analysis worker was left running afterwards.javascript_worker_parseand thenjavascript_worker_static. Current main reports worker phases, so the stall is located after parsing.Where the time goes (in-process CPU profile, static phase, first 30 s)
The parse took about 0.2 s. Of the 30 s of samples, 88.5% are under
indexJavaScriptAmbientWritesSteps, in the reference-store fixpoint (pendingStores/dependents) aroundcreateAmbientPathResolver(state, true, …). The top self frames are the resolver closure (40%),electronMemberPath(13%) andjavaScriptExpressionWrapperTarget(12%).semanticEffectTiming/statementPosition(#4601) and member-mutation traversal (#6146) do not appear.Counters I added to the build output (not committed):
t[<computed>] = <function / object / call>on one large objectt.Minimal synthetic reproducer (no third-party code)
t[k[i]] = {v:i}t[k[i]] = function(){…}t[k[i]] = [i]t.p_i = function(){…}(static key)t[k[i]] = i(primitive)Doubling n multiplies the time by about 8, which is cubic. At n = 500 the static phase alone did not finish within 40 s. Through the public CLI with
--analysis-timeout-ms 30000:provider_timeoutat 31.3 s.indexSemanticAmbientWritesStepsalso runs in the semantic phase and inanalyze_web_bundle(webBundleAnalyzerInspection.ts), so the same cost can show up in both places.Cause, read from the source (not verified at runtime)
The cause is in the fixpoint in
indexJavaScriptAmbientWritesSteps:source.target) without caching (possibleWrites = true).[].storesfacts grow as O(n²). Each walk is O(n) to O(n²), and each new store into the shared object re-queues every dependent source. That gives about O(n³) in total.[]"slot occupant" identities also look broader than the runtime semantics: overwritingt[k]does not mutate the object that previously occupied the slot.Lowering the semantic node/unknown limits doesn't help, because this index runs before those limits apply. That matches the "semantic limits = 1" row in the report.
Why there is no PR yet
A fix needs a decision on what this owner should return. Options:
__proto__→prototypeand copied initializers.["global", null], recorded as a reported resource limit.#6477 also restructures this file. I'd rather settle on the approach before writing a change that conflicts with it.
Not run: the reporter's exact file (no matching hash found), Node 22, or the analysis without a deadline. Completion time without a deadline is unknown. The fixpoint works over a finite lattice and kept making progress in every sample, so my conclusion that it eventually finishes is based on reading the source, not on a measured run.
🤖 Generated with Claude Code
@kaoru0822-kitauji commented on GitHub (Oct 25, 2026):
Update: #7128 fixes the cubic slot-occupant cost described above. A synthetic file of n stores
t[k[i]] = {…}now finishes in about 2 s through the CLI. Before the change, n=500 took 97 s and n=1000 took 618 s. The CastleIO 2.8.2 ESM build still hits the deadline, so #7128 usesRefs, notFixes.What remains (profiled on the #7128 build, Node 26.5.0, macOS arm64):
staticphase: 901 s wall, 970 s user CPU, 1.65 GB peak RSS for a single process.indexJavaScriptAmbientWritesSteps. By fixpoint iteration 4,000, 148.25M of the 148.5M resolver worklist pops were for any-depth (undefined) projections.[]) that store arrays inside each other. A projection first reaches them at[null,null]and then at[null,null,null], so it widens to any depth. This widening is legitimate, not the slot-occupant aliasing #7128 removes.Likely fix direction: a shared summary for widened regions, so that each store does not get its own entries and closure walk. That is a representation change in the same owner, so I'm leaving it out of #7128.
🤖 Generated with Claude Code