Skip to content

fix(windows): 修复事件循环目标跨线程克隆导致的闪退 - #1312

Merged
H-Chris233 merged 6 commits into
Open-Less:betafrom
HKLHaoBin:fix/issue-1266-windows-unresponsive
Oct 31, 2026
Merged

H-Chris233 merged 6 commits into
Open-Less:betafrom
HKLHaoBin:fix/issue-1266-windows-unresponsive

Conversation

@HKLHaoBin

@HKLHaoBin HKLHaoBin commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

摘要

Fixes #1266。
关联 #1261、#1227(相关 Windows 堆损坏/静默退出现场,不宣称全部报告具有同一根因)。

修复 Windows Tauri event-loop target 经跨线程 runtime handle 克隆时的所有权问题。提交者已收到用户反馈:使用 ee89696cb780ee464b75a8928bd1967bae4ccdcf 修复构建后,原闪退问题不再复现,因此将已测试分支提交上游 beta。这是用户反馈的现场验收;未提供新的观察时长、录音次数或转储,不补造这些数据,也不将所有无响应/原生崩溃归为同一原因。

修复 / 新增 / 改进

  • 固定并 vendor tauri-runtime-wry 2.12.2,Windows event-loop target 仅由所属线程的 TLS registration 持有;跨线程 handle 只克隆安全元数据,不再跨线程复制 Tao target 内部的非原子 Rc。
  • 在 owner 线程查找并保活 target,回调前释放 registry borrow;退出/展开时退休 registration,迟到的调用返回 EventLoopClosed,覆盖 consuming run 和 run iteration 生命周期。
  • 保留默认关闭的 issue-1266-diagnostics feature 与 P1–P6 诊断边界,并增加真实 handle clone、派发来源/线程及父操作关联;普通构建不启用诊断 writer。
  • 增加 owner-thread helper、真实 Windows runtime 生命周期、feature off/on、EXE/PDB 配对与静态契约门禁;手动诊断打包附准确 SHA、provenance 和符号配对 manifest。

兼容

  • 不包含:更改 DSP、WASAPI、ASR、IME 重放/超时策略、按键 FIFO、录音清理策略,或宣称解决所有堆损坏根因。
  • 对现有用户:Windows runtime 的 target 所有权修复始终生效;诊断文件 writer 仍需显式 feature 开启,不默认采集。
  • 对非 Windows:保留原有 target/display 行为。
  • 对构建:应用通过本地 Cargo patch 选用附带原始许可证和来源记录的 pinned runtime;诊断分支构建不会发布 Release。
  • 此 PR 仅提交审查,不自动合并或发布。

测试计划

  • 用户反馈:ee89696c 修复构建后原闪退不再复现(由提交者转述,不夸大观察范围)。
  • 原修复 SHA 的 fork CI / 桌面 Windows、macOS arm64、macOS Intel / Android 构建通过,Windows EXE/PDB 配对通过:见 [windows] 更新后使用中无响应,需重启恢复(日志静默中断,根因待定位) #1266 中该修复构建说明。
  • 最终 head a89a4176d39b46425ecf147853fa687d2f977955 对 beta 的合并结果通过上游自动触发的全部适用 CI:CI run 41176286989(attempt 2)。Windows/macOS、MSRV、Android、Harmony、Linux 测试/打包、原生胶囊与 Chromium/WebKit 门禁均成功;PR 不发布 Release,publish-linux-egui 按设计跳过。
  • 已解决 tauri_coordinator_host.rs 与 beta 的布局监听冲突,保留上游 handle-free timer、主线程取胶囊,以及本分支 P2 LayoutDispatch 观察。
  • 首轮契约测试暴露的函数截取边界问题已在 a89a4176 修正,增加邻接函数/缺失边界 fixture,未削弱原断言;最终候选经独立限域审查,结果 no bug found。
  • 本轮 UI 任务首次在未修改的 WebKit 开关采样测试中失败;trace 证实状态改变、约 17.6px 位移和 180ms transform 完成,但中间采样为空。保留失败证据、未改产品/断言,单次原样重跑该任务后成功。不宣称已经修复这个既有采样时序问题。
  • 命令与门禁:.github/workflows/ci.yml 中的跨平台编译、前端/契约、独立诊断、owner-thread、真实 Windows runtime 生命周期及符号格式测试。
  • 证据路径:docs/research/issue-1266.md、docs/research/issue-1266-feedback-6416406209.md、docs/research/issue-1266-diagnostics.md、openless-all/app/src-tauri/vendor/tauri-runtime-wry/OPENLESS_PATCH.md。
  • 本次交付不在本地编译、测试、安装依赖或打包;使用 GitHub Actions 验证合并候选。

HKLHaoBin and others added 4 commits October 25, 2026 02:29
Observe host gates, main dispatch, bridge handling, IME submission, recorder shutdown and lifecycle without changing business policies. Add a bounded typed session sink, independent health, remote-only tests and immutable Windows symbol provenance. Keep diagnostic artifacts separate from ordinary branch builds; do not claim a root-cause fix.

Co-Authored-By: Claude Opus 5 <[email protected]>
Resolve E0616 from the opt-in production feature compilation in CI. Keep the run label internal to the diagnostic module hierarchy.

Co-Authored-By: Claude Opus 5 <[email protected]>
Keep existing host coverage and observe capsule, mirror and layout tasks at the same main-queue boundary. Track real execution context and opaque producer thread labels; preserve behavior and the single diagnostic writer. Add deterministic tracer tests and classify the issue 1227 feedback against PR 1267 without claiming a crash fix.

Co-Authored-By: Claude Opus 5 <[email protected]>
Vendor the pinned runtime-wry 2.12.2 source and keep Windows event-loop targets in owner-local storage. Transferable handles clone metadata only; retain callback and consuming-loop lifetimes. Preserve six diagnostic boundaries and observe pre-dispatch handle cloning for the A1 field experiment.

Co-Authored-By: Claude Opus 5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-31T05:51:47.108134Z
We couldn’t complete this review. Comment @codex review to try again.
ee89696 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@H-Chris233 H-Chris233 self-assigned this Oct 31, 2026
@H-Chris233
H-Chris233 merged commit 6487132 into Open-Less:beta Oct 31, 2026
25 of 26 checks passed
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.

[windows] 更新后使用中无响应,需重启恢复(日志静默中断,根因待定位)

2 participants