zai-org / zai-org/feedback

[Bug] Windows 桌面端 3.8.1:内置浏览器(browser-use)标签页销毁时主进程空指针写入崩溃 0xC0000005 @ ZCode.exe+0x174C2F2(升级后 3 分钟内 2 次)

Open
#342 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

提交前确认 · Pre-submission checklist
  • 我已搜索过现有 issue,确认这不是重复 / I searched existing issues and confirmed this isn't a duplicate.
  • 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category

稳定性 / 崩溃 · Stability / Crash

涉及的 Agent 框架 · Agent framework

不涉及框架 · Not framework-specific(崩溃点在桌面端主进程的内置浏览器/CDP 清理路径)

严重程度 · Severity

阻塞使用 · Blocking(整个桌面端进程崩溃退出)

复现频率 · Reproducibility

偶现 · Sometimes(升级 3.8.1 后 3 分钟内连续发生 2 次,同一会话恢复场景下接近必现)

问题描述 · Description

从 3.7.7 自动升级到 3.8.1 后,桌面端主进程在 3 分钟内连续崩溃 2 次(12:23、12:25 各一次,本机时间),两次均为同一个确定性崩溃点

  • 异常代码 0xC0000005(Access Violation),写入目标地址 0x8(即空指针 + 偏移 8 的成员写入)
  • 崩溃位置:ZCode.exe +0x174C2F2(两份 dump 偏移完全一致,Electron 主进程内)
  • 崩溃线程:dump #1 tid=4584,dump #2 tid=25200

两次崩溃前最后几秒的日志均为同一模式——内置浏览器(browser-use)会话活动后紧跟标签页销毁时的 CDP 清理失败,随后主进程消失:

[browser-use] detachGuest cdp message cleanup failed ... error=Object has been destroyed
[browser-use] detachGuest cdp still attached on destroyed guest ... guestId=2
(约 10~15 秒后主进程崩溃)

且两次崩溃对应同一个被恢复的 browser-use 会话sess_f9de7599):重启后该会话被恢复并再次执行,再次触发同样崩溃。换到新的 browser-use 会话后当前实例稳定运行。

复现步骤 · Steps to reproduce
  1. 使用 3.7.7 桌面端,弹出 3.8.1 升级提示,确认"退出并安装"(12:20:21 完成,应用自动重启进入 3.8.1)
  2. 此前正在使用内置浏览器(browser-use 插件)的会话在重启后被恢复
  3. 内置浏览器标签页销毁(日志出现 detachGuest cdp message cleanup failed ... Object has been destroyed / cdp still attached on destroyed guest
  4. 约 10~15 秒后整个桌面端进程崩溃退出
  5. 重新启动 ZCode,同一 browser-use 会话再次被恢复 → 再次执行同样操作 → 再次在同一点崩溃(重复步骤 3~4)
期望表现 · Expected behavior

内置浏览器标签页在 CDP 仍处于 attached 状态下被销毁时,清理逻辑应安全处理已销毁的 guest(Object has been destroyed),不应导致主进程崩溃;最坏情况也应只影响该浏览器标签页。

实际表现 · Actual behavior

主进程在 ZCode.exe+0x174C2F2 处对空指针 +8 偏移写入,触发 0xC0000005,整个桌面端应用崩溃退出,3 分钟内发生 2 次。

ZCode 版本 · ZCode version

v3.8.1(Windows x64,由 3.7.7 自动升级安装,升级流程本身正常完成)

设备 / 系统 / 浏览器 · Device / OS / Browser

Windows 11 x64(10.0.26200),ZCode 桌面端(Electron)

截图 / 录屏 / 日志 · Screenshots / Recordings / Logs

崩溃转储(Crashpad 已归档,remoteCrashReporterEnabled=true,理论上应已自动上报;如需原始 dump 文件可提供,各约 35MB):

  • C:\Users\<user>\.zcode\v2\crash\archive\d07b9f0b-cf3b-42c5-9009-c7fd3a35c69d.dmp(第一次,12:23)
    • exception code 0xC0000005,address 0x7FF6AEC8C2F2,write to 0x8,faulting module ZCode.exe (+0x174C2F2),tid 4584
  • C:\Users\<user>\.zcode\v2\crash\archive\c6810217-7313-4fba-a8c7-2dd6ccd4bf88.dmp(第二次,12:25)
    • 同一异常地址、同一模块偏移 +0x174C2F2,tid 25200

应用日志 ~/.zcode/v2/logs/2026-08-22.log 关键片段:

12:19:45 [auto-update] initializing, current version: 3.7.7
12:19:46 [auto-update] new version available: 3.8.1
12:20:21 [stability] perf_app_exit reported {"scene":"update_install","exitCode":0}
12:20:57 [auto-update] initializing, current version: 3.8.1   ← 升级后首次启动
# ---- 第一次崩溃前的最后记录 ----
12:23:20.796 [browser-use] detachGuest cdp message cleanup failed tabId=iab-tab:c5fc50d9-... error=Object has been destroyed
12:23:20.797 [browser-use] detachGuest cdp still attached on destroyed guest tabId=iab-tab:c5fc50d9-... guestId=2
12:23:30 [host-log] rpc:call off-peak-task.list OK          ← 此后主进程无任何日志,崩溃
12:23:45 [pid:23012] [crash-capture] restored 1 local dump(s) from previous runs   ← 重启恢复
# ---- 第二次崩溃前的最后记录(同一 browser-use 会话 sess_f9de7599)----
12:25:30.766 [browser-use] detachGuest cdp message cleanup failed tabId=iab-tab:5b9d3006-... error=Object has been destroyed
12:25:30.766 [browser-use] detachGuest cdp still attached on destroyed guest tabId=iab-tab:5b9d3006-... guestId=2
                                                        ← 此后主进程无任何日志,崩溃
12:25:46 [pid:10216] [crash-capture] restored 1 local dump(s) from previous runs   ← 再次重启

补充:Windows 事件日志(Application,Event ID 1000/1001/1002)中无对应记录,崩溃完全由 Crashpad 捕获。3.7.7 下同样的内置浏览器使用未出现过此崩溃,怀疑为 3.8.1 回归。崩溃偏移 +0x174C2F2 在两份 dump 中一致,应可直接定位到具体代码路径(疑似 detachGuest/CDP 清理对已销毁 guest 对象的空指针成员写入)。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the two Crashpad dump paths and the application log at ~/.zcode/v2/logs/2026-08-22.log, focusing on the browser-use detachGuest CDP cleanup messages. Use the repeated ZCode.exe+0x174C2F2 offset and the destroyed guest scenario to trace the relevant desktop main-process entry point. Done means the restored browser-use session can destroy a tab with CDP still attached without crashing the main process.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.