以下是我使用AI的诊断结果,经AI修复,目前我本地的版本已可以正常使用
问题描述
Windows 上 Gopeed 1.9.3(最新版,含安装版与 portable 版)打开后约 0.5 秒即闪退,无任何窗口、无日志输出。与 #1324 症状一致。
环境
Windows 11 (build 26200.9168),AtlasOS 定制版(Windows 10 22H2 上同样复现,见 更新最新版 1.9.3 打开程序就闪退 #1324 )
Gopeed 1.9.3+1 (windows-amd64 安装版)
复现步骤
使用工具将 Windows 推送通知服务禁用(很多精简版/优化版系统默认如此):
WpnService(Windows Push Notifications System Service)
WpnUserService_*(Windows Push Notifications User Service,如 WpnUserService_964d1)
启动 gopeed.exe → 立即闪退
根因分析
进程实际退出码为 -1073740791(0xC0000409 = STATUS_STACK_BUFFER_OVERRUN),即 MSVC 运行时的 fail-fast 崩溃(未处理 C++ 异常 → terminate → RaiseFailFastException)。
用 Process Monitor 抓取启动轨迹,崩溃前最后的操作序列是:
通知插件初始化:写入 HKCU\Software\Classes\AppUserModelId\com.gopeed.gopeed(DisplayName/IconUri/CustomActivator)、临时图标文件 notification_icon.ico
激活 WinRT Windows.UI.Notifications.ToastNotificationManager
读取 WPN 端点注册表 HKLM\SYSTEM\CurrentControlSet\Control\Notifications\...
随后进程 fail-fast 崩溃
对照插件源码(gopeed 使用 flutter_local_notifications 20.1.0,FFI 实现),崩溃点在这里:
flutter_local_notifications_windows/src/ffi_api.cpp:33-34
plugin->notifier = plugin->hasIdentity
? ToastNotificationManager::CreateToastNotifier()
: ToastNotificationManager::CreateToastNotifier(plugin->aumid);
CreateToastNotifier() 没有 try/catch:当 WPN 服务(特别是用户级 WpnUserService)不可用时,WinRT 调用抛出的异常直接跨 FFI 边界,进程 fail-fast 崩溃,Dart 层无法捕获。
验证
将 flutter_local_notifications_windows.dll 从安装目录改名/移除后,Gopeed 可正常启动运行(仅无通知功能,Dart 层会打印一条动态库加载失败的错误但不再崩溃)
启用 WpnService + WpnUserService_* 并重新登录后,Gopeed 恢复正常
建议修复
ffi_api.cpp 中 init() 用 try/catch 包裹 CreateToastNotifier()(以及 ToastNotificationManager::History()),失败时返回 false,由 Dart 层降级处理而不是让整个进程崩溃:
try {
plugin->notifier = plugin->hasIdentity
? ToastNotificationManager::CreateToastNotifier ()
: ToastNotificationManager::CreateToastNotifier (plugin->aumid );
} catch (winrt::hresult_error const & e) {
// WPN 服务不可用时降级处理,不要崩溃
return false ;
}
另外建议 gopeed 侧在 notification_service.dart 的 _initNotifications() 对 initialize() 加 try/catch,双保险。
相关
以下是我使用AI的诊断结果,经AI修复,目前我本地的版本已可以正常使用
问题描述
Windows 上 Gopeed 1.9.3(最新版,含安装版与 portable 版)打开后约 0.5 秒即闪退,无任何窗口、无日志输出。与 #1324 症状一致。
环境
复现步骤
WpnService(Windows Push Notifications System Service)WpnUserService_*(Windows Push Notifications User Service,如WpnUserService_964d1)根因分析
进程实际退出码为
-1073740791(0xC0000409= STATUS_STACK_BUFFER_OVERRUN),即 MSVC 运行时的 fail-fast 崩溃(未处理 C++ 异常 → terminate → RaiseFailFastException)。用 Process Monitor 抓取启动轨迹,崩溃前最后的操作序列是:
HKCU\Software\Classes\AppUserModelId\com.gopeed.gopeed(DisplayName/IconUri/CustomActivator)、临时图标文件notification_icon.icoWindows.UI.Notifications.ToastNotificationManagerHKLM\SYSTEM\CurrentControlSet\Control\Notifications\...对照插件源码(gopeed 使用 flutter_local_notifications 20.1.0,FFI 实现),崩溃点在这里:
flutter_local_notifications_windows/src/ffi_api.cpp:33-34CreateToastNotifier() 没有 try/catch:当 WPN 服务(特别是用户级 WpnUserService)不可用时,WinRT 调用抛出的异常直接跨 FFI 边界,进程 fail-fast 崩溃,Dart 层无法捕获。
验证
建议修复
ffi_api.cpp 中 init() 用 try/catch 包裹 CreateToastNotifier()(以及 ToastNotificationManager::History()),失败时返回 false,由 Dart 层降级处理而不是让整个进程崩溃:
另外建议 gopeed 侧在 notification_service.dart 的 _initNotifications() 对 initialize() 加 try/catch,双保险。
相关