Repository navigation
sync: from linuxdeepin/dde-session-shell - #551
deepin-ci-robot wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepin-ci-robot 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 guide (collapsed on small PRs)Reviewer's GuideSynchronizes the lock-screen sources with upstream, including a desktop-entry update and an X11 I/O error handler that exits the process when the X connection fails. Sequence diagram for lock screen X11 failure handlingsequenceDiagram
participant LockApp as dde-lock
participant XServer as X11 Display
LockApp->>XServer: app->exec()
XServer--xLockApp: X11 I/O failure
LockApp->>LockApp: x11IOErrorHandler(Display *)
LockApp->>LockApp: _exit(0)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/app/dde-lock.cpp" line_range="36" />
<code_context>
+static int x11IOErrorHandler(Display *)
+{
+ _exit(0);
+}
+
</code_context>
<issue_to_address>
**Lock screen stays closed after X11 recovers**
When the X server drops dde-lock’s connection after the handler is installed and dde-lock.service uses Restart=on-failure, `x11IOErrorHandler` calls `_exit(0)` without logging, so systemd records a clean stop and does not restart dde-lock. After the X server recovers, the locked session has no lock-screen surface until another caller launches it, and operators see no journal diagnostic for the X11 failure.
Log the X11 failure and exit unsuccessfully so systemd can restart dde-lock.
</issue_to_address>|
|
||
| static int x11IOErrorHandler(Display *) | ||
| { | ||
| _exit(0); |
There was a problem hiding this comment.
🟡 Medium · Lock screen stays closed after X11 recovers
When the X server drops dde-lock’s connection after the handler is installed and dde-lock.service uses Restart=on-failure, x11IOErrorHandler calls _exit(0) without logging, so systemd records a clean stop and does not restart dde-lock. After the X server recovers, the locked session has no lock-screen surface until another caller launches it, and operators see no journal diagnostic for the X11 failure.
Log the X11 failure and exit unsuccessfully so systemd can restart dde-lock.
Prompt for AI agents
In `src/app/dde-lock.cpp` at line 36:
**Lock screen stays closed after X11 recovers**
When the X server drops dde-lock’s connection after the handler is installed and dde-lock.service uses Restart=on-failure, `x11IOErrorHandler` calls `_exit(0)` without logging, so systemd records a clean stop and does not restart dde-lock. After the X server recovers, the locked session has no lock-screen surface until another caller launches it, and operators see no journal diagnostic for the X11 failure.
Log the X11 failure and exit unsuccessfully so systemd can restart dde-lock.b32da4c to
8264dcb
Compare
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#100
8264dcb to
a61d247
Compare
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 语法正确,逻辑清晰,无需修改 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题:
建议: 建议为 x11IOErrorHandler 函数添加注释,说明在 X11 IO 错误(如显示服务器断开连接)时调用 _exit(0) 进行安全退出的原因,以及为何使用 _exit 而非 exit 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 性能良好,无需优化 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 安全合规,无需加固 💡 改进建议代码示例// X11 IO 错误处理函数
// 当 X11 连接发生致命 IO 错误(如显示服务器崩溃/断开)时被调用
// 使用 _exit(0) 而非 exit() 以避免调用 atexit 处理器和静态析构函数,
// 防止在异常状态下执行清理操作导致二次崩溃
static int x11IOErrorHandler(Display *)
{
_exit(0);
}本报告由 AI 代码审查工具自动生成 |
Synchronize source files from linuxdeepin/dde-session-shell.
Source-pull-request: linuxdeepin/dde-session-shell#100
Summary by Sourcery
Synchronize session-shell sources and improve lock-screen behavior on X11 connection failures.
Bug Fixes:
Enhancements:
Chores: