Repository navigation
Conversation
Crash evidence (cores PID 12947 / 65684 / 334006 on V25 aarch64): SIGSEGV inside Dtk::Core::Logger::write on a QtConcurrent worker spawned by IflytekAiAssistant::checkAiExists(), while the main thread is blocked in QCoreApplication::~QCoreApplication -> QThreadPool::waitForDone waiting for that very worker. The worker's blocking D-Bus probe (default timeout 25s) straddles app teardown; its logging / queued callback then hits the half-torn-down log pipeline and crashes. 1. checkAiExists() worker guard (new): bail out when QCoreApplication::instance() is null or closingDown() -- at task entry, after each blocking D-Bus call, and before logging / queued invoke. copilotInstalled() / isCopilotEnabled() also skip their logging once shutting down. 2. EditWrapper teardown ordering (kept from closed PR linuxdeepin#640): delete m_pWaringNotices before m_pTextEdit so the DMessageManager content widget is cleaned up while its parent is still alive. Log: Fixed crash log generated when closing a text document opened from a zip archive, and the same-signature exit crash Influence: 1. Test opening a text document from a zip archive, edit, save, close 2. Test double-clicking a desktop text document with editor running 3. Test quick close of the editor right after startup 4. Run common2 / editwrapper / startmanager unit test suites fix: 退出期 AI 探测线程防护,并保留消息浮层析构顺序修复 崩溃证据(V25 aarch64 上 PID 12947 / 65684 / 334006 三个 core): SIGSEGV 发生在 Dtk::Core::Logger::write,崩溃线程是 IflytekAiAssistant::checkAiExists() 派生的 QtConcurrent 工作线程; 此时主线程正阻塞在 QCoreApplication::~QCoreApplication -> QThreadPool::waitForDone 等待该工作线程收尾。工作线程的阻塞式 D-Bus 探测(默认超时 25 秒)跨越了应用退出过程,随后的日志/ 排队回调命中已半拆除的日志管线导致崩溃。 1. checkAiExists() 工作线程防护(新增):当 QCoreApplication::instance() 为空或 closingDown() 时直接退出—— 覆盖任务入口、每次阻塞 D-Bus 调用返回后、打日志/排队回调前; copilotInstalled() / isCopilotEnabled() 在退出期同样跳过日志。 2. EditWrapper 析构顺序(保留自已关闭的 PR linuxdeepin#640):将 m_pWaringNotices 的删除提前到 m_pTextEdit 之前,使 DMessageManager 的 content 控件在父控件存活期间完成清理。 Log: 修复压缩包打开文本文档关闭后产生崩溃日志的问题,及同签名的退出崩溃 Influence: 1. 测试压缩包中打开文本文档、修改保存后关闭 2. 测试编辑器已打开时双击桌面文本文档 3. 测试编辑器启动后立即关闭 4. 运行 common2 / editwrapper / startmanager 单元测试 PMS: BUG-378881
|
Sorry @pengfeixx, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 1 day and 6 hours by commenting |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pengfeixx The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideThe PR hardens asynchronous AI capability probing against application teardown by rechecking shutdown state around blocking D-Bus work and avoiding late logging or callbacks, while ensuring EditWrapper destroys DMessageManager warning content before its parent text editor. Sequence diagram for shutdown-safe AI capability probingsequenceDiagram
participant App as QCoreApplication
participant Pool as QtConcurrentWorker
participant AI as IflytekAiAssistant
participant DBus as D-Bus backend
participant Log as Logger
Pool->>AI: checkAiExists()
AI->>App: appShuttingDown()
alt application is shutting down
AI-->>Pool: return
else application is running
AI->>DBus: copilot->call(version)
DBus-->>AI: QDBusReply
AI->>App: appShuttingDown()
alt shutdown started during D-Bus call
AI-->>Pool: return
else still running
AI->>Log: qInfo/qWarning/qDebug
AI->>App: appShuttingDown()
alt shutdown started before callback
AI-->>Pool: return
else still running
AI-->>App: queued callback
end
end
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
fix: guard AI probe worker at shutdown, keep message teardown order
Crash evidence (cores PID 12947 / 65684 / 334006 on V25 aarch64):
SIGSEGV inside Dtk::Core::Logger::write on a QtConcurrent worker
spawned by IflytekAiAssistant::checkAiExists(), while the main thread
is blocked in QCoreApplication::~QCoreApplication ->
QThreadPool::waitForDone waiting for that very worker. The worker's
blocking D-Bus probe (default timeout 25s) straddles app teardown;
its logging / queued callback then hits the half-torn-down log
pipeline and crashes.
QCoreApplication::instance() is null or closingDown() -- at task
entry, after each blocking D-Bus call, and before logging /
queued invoke. copilotInstalled() / isCopilotEnabled() also skip
their logging once shutting down.
m_pWaringNotices before m_pTextEdit so the DMessageManager content
widget is cleaned up while its parent is still alive.
Log: Fixed crash log generated when closing a text document opened from a zip archive, and the same-signature exit crash
Influence:
fix: 退出期 AI 探测线程防护,并保留消息浮层析构顺序修复
崩溃证据(V25 aarch64 上 PID 12947 / 65684 / 334006 三个 core):
SIGSEGV 发生在 Dtk::Core::Logger::write,崩溃线程是
IflytekAiAssistant::checkAiExists() 派生的 QtConcurrent 工作线程;
此时主线程正阻塞在 QCoreApplication::~QCoreApplication ->
QThreadPool::waitForDone 等待该工作线程收尾。工作线程的阻塞式
D-Bus 探测(默认超时 25 秒)跨越了应用退出过程,随后的日志/
排队回调命中已半拆除的日志管线导致崩溃。
QCoreApplication::instance() 为空或 closingDown() 时直接退出——
覆盖任务入口、每次阻塞 D-Bus 调用返回后、打日志/排队回调前;
copilotInstalled() / isCopilotEnabled() 在退出期同样跳过日志。
m_pWaringNotices 的删除提前到 m_pTextEdit 之前,使
DMessageManager 的 content 控件在父控件存活期间完成清理。
Log: 修复压缩包打开文本文档关闭后产生崩溃日志的问题,及同签名的退出崩溃
Influence:
PMS: BUG-378881
Summary by Sourcery
Prevent shutdown-time crashes by guarding asynchronous AI probing and preserving safe editor teardown ordering.
Bug Fixes: