Skip to content

ci: [DO-NOT-MERGE] capture spindump/lsappinfo/AE-debug for #51462 hung esm fixture - #51483

Closed
MarshallOfSound wants to merge 2 commits into
mainfrom
sattard/debug-51462-spindump
Closed

MarshallOfSound wants to merge 2 commits into
mainfrom
sattard/debug-51462-spindump

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

DO NOT MERGE — debug instrumentation only.

What this does

Per investigation in #51462, the import-meta esm fixture child reaches applicationWillFinishLaunching: but AppKit never posts applicationDidFinishLaunching: on macOS-x64 shard 2, so app.whenReady() never resolves. This branch captures the system state at the moment of hang.

Changes

  • Disable Linux, Windows, macOS-arm64 builds (failure is macOS-x64 only) — saves runner spend while iterating.
  • spec/esm-spec.ts: when a fixture child is still alive at 20s, capture to spec/artifacts/esm-diag/ (uploaded as test_artifacts_darwin_x64_2):
    • lsappinfo list / visibleProcessList / info pid=<child> — LaunchServices registrations (look for stale Electron entries from earlier specs)
    • launchctl print for launchservicesd / appleeventsd
    • ps -Af and Electron-only process list
    • sample <pid> 3
    • sudo spindump <pid> 5 10
    • log show --last 5m for com.apple.launchservices / com.apple.appleevents
    • then SIGKILL the child so the suite continues instead of leaking
  • AE debug: fixtures are spawned with AEDebugSends=1 AEDebugReceives=1 AEDebugVerbose=1 so the child's stderr shows whether kAEOpenApplication ever arrives. Every fixture's stderr is saved so the hung one can be diffed against passing ones.
  • Baseline: lsappinfo list and ps are captured before any esm fixture runs.
  • Fixture markers: import-meta/main.mjs logs TOP / WILL / DID to stderr.

What to look at when this runs

  1. *-child-stderr.txt for the hung fixture — does AEDebugReceives show a oapp/kAEOpenApplication event? Compare to a passing fixture's stderr.
  2. *-lsappinfo-list.txt vs baseline-lsappinfo-list.txt — extra/stale Electron ASNs?
  3. *-ps-electron.txt — leaked children from api-utility-process-spec.ts?
  4. *-spindump.txt — main thread should be idle in __CFRunLoopRun; check appleeventsd/launchservicesd stacks in the same dump.
  5. *-log-ls.txt — any errors from launchservicesd around the child's launch time.

Refs #51462

Notes: none

DO-NOT-MERGE debug branch.

- Disable Linux, Windows, and macOS-arm64 builds (failure is macOS-x64 only)
- Instrument spec/esm-spec.ts runFixture to, on a 20s child hang:
  - capture lsappinfo list / visibleProcessList / info pid=
  - capture launchctl print for launchservicesd / appleeventsd
  - capture ps -Af and Electron-only process list
  - sample the hung child for 3s
  - sudo spindump the hung child for 5s
  - log show last-5m for launchservices/appleevents subsystems
  - then SIGKILL the child so the suite continues
- Spawn fixtures with AEDebugSends/Receives/Verbose so the child's stderr
  shows every Apple Event it receives (or doesn't)
- Persist every fixture's stderr to spec/artifacts/esm-diag/ so passing
  fixtures' AE logs can be diffed against the hung one
- Capture baseline lsappinfo/ps before any esm fixture runs
- Add WILL/DID stderr markers to the import-meta fixture

Refs #51462
…oreState A/B for #51462

Spindump from the previous run shows the child blocked in a nested modal
event loop inside AppKit's _handleAEOpen* handler — not idle. This adds:

- Saved Application State dir listing + restorecount/windows.plist dump
  (baseline + at-hang) to test the persistent-UI / 'reopen windows' theory
- screencapture of the full screen at hang time so any modal alert is visible
- CGWindowListCopyWindowInfo for the hung pid and for all on-screen windows
- atos symbolication of the unsymbolicated AppKit frames parsed out of the
  spindump we just wrote (load address + addrs extracted dynamically)
- defaults read com.github.Electron
- talagentd / com.apple.PersistentUI added to the unified-log predicate

A/B inside the single import-meta test (kept as one it-block so
split-tests.js shard assignment is unchanged):
  A: stock (expected to hang)
  B: with -ApplePersistenceIgnoreState YES -NSQuitAlwaysKeepsWindows NO
  C: after rm -rf ~/Library/Saved Application State/com.github.Electron.savedState
Result written to spec/artifacts/esm-diag/ab-summary.txt.

Refs #51462
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant