Skip to content

fix(cdpmonitor): stop attaching to shared workers - #496

Closed
RyoKusnadi wants to merge 1 commit into
kernel:mainfrom
RyoKusnadi:fix/skip-shared-worker-targets
Closed

RyoKusnadi wants to merge 1 commit into
kernel:mainfrom
RyoKusnadi:fix/skip-shared-worker-targets

Conversation

@RyoKusnadi

@RyoKusnadi RyoKusnadi commented Oct 30, 2026 •

Copy link
Copy Markdown

What

The CDP network monitor no longer tracks shared_worker targets.

Why

As described in the issue, the monitor attaches a DevTools session to every shared worker. Chrome can then crash (SEGV in SharedWorkerDevToolsAgentHost) when the page owning the worker closes while the session is attached. Shared workers add little to network telemetry, so I took the option the issue suggests and left them out by default.

Changes

  • cdpmonitor/monitor.go: remove shared_worker from WithAdditionalTargets, with a comment saying why.
  • monitor_test.go: the discovery filter no longer lists shared_worker.
  • The two Chrome e2e worker tests drop their shared_worker case, since it is no longer tracked.

Testing

go test ./lib/cdpmonitor/... ./lib/browsersurface/... passes. I did not run the Chrome e2e tests, so the crash itself is not reproduced here.

Fixes #485


Note

Medium Risk
Narrows which worker targets receive network telemetry and interaction hooks, but avoids a known Chrome crash path; dedicated and service workers remain covered.

Overview
Stops the CDP monitor from discovering and attaching DevTools sessions to shared_worker targets, leaving worker, service_worker, and background_page tracked as before.

The change is driven by a Chrome crash (SEGV in SharedWorkerDevToolsAgentHost) when the owning page closes while a session remains attached; shared workers are excluded because they add little network telemetry. monitor.go documents that rationale in a comment next to WithAdditionalTargets.

Unit and Chrome e2e tests are updated so target discovery expectations and worker coverage no longer assume shared_worker is monitored.

Reviewed by Cursor Bugbot for commit ad22e12. Bugbot is set up for automated code reviews on this repo. Configure here.

Attaching a DevTools session to a shared_worker target can crash Chrome
(SEGV in SharedWorkerDevToolsAgentHost) when the page that owns the worker
closes. Drop shared_worker from the monitor's tracked target types and from
the e2e worker cases that relied on it.

Signed-off-by: Ryo Kusnadi <ryokusnadi@gmail.com>
@RyoKusnadi RyoKusnadi closed this by deleting the head repository Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cdpmonitor attaches to shared workers, which makes Chrome crash (SEGV in SharedWorkerDevToolsAgentHost); no way to turn it off

1 participant