mirror of
https://github.com/codexu/note-gen.git
synced 2026-04-25 21:05:55 +03:00
[GH-ISSUE #845] [bug] macOS 下调用 AppHandle::restart 导致主线程死锁(tauri_plugin_store) #626
Labels
No labels
bug
duplicate
feature
platform: Android
platform: Linux
platform: Windows
platform: iOS
platform: macOS
priority: high
priority: low
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/note-gen#626
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 @HansYeoh on GitHub (Jan 10, 2026).
Original GitHub issue: https://github.com/codexu/note-gen/issues/845
详细描述这个 Bug
问题概述
在mac上导入配置文件的时候,出现卡死情况。
通过分析报错信息,确认在 macOS 环境下,NoteGen 0.24.0 在调用
tauri_plugin_process::restart时会出现 确定性的卡死(deadlock,而非 crash)。卡死发生在 主线程(UI 线程),系统 stackshot 已明确标记为死锁。
环境信息
关键现象(系统级证据)
macOS Stackshot 明确指出:
主线程阻塞位置
主线程在执行 restart 过程中被阻塞,调用路径如下:
即:在主线程中同步执行 Store::save,并尝试获取 Mutex。
后台线程状态(形成死锁闭环)
与此同时,Tokio runtime 后台线程处于以下状态:
这表示后台线程正在 等待主线程 RunLoop 执行回调。
死锁机理分析
形成了典型的闭环等待关系:
Store::save()中同步等待 Mutex由于主线程被 Mutex 阻塞,RunLoop 无法继续执行,
最终导致 主线程与后台线程相互等待,形成确定性死锁。
备注
NoteGen 版本
0.24.0
操作系统
macOS
报错日志
No response
@codexu commented on GitHub (Jan 19, 2026):
5df3bae801已修复