Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lchjvvj 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 |
|
Hi @lchjvvj. Thanks for your PR. 😃 |
Reviewer's GuideThis PR fixes the post-password-login deadlock by registering an at-fork child handler in the PAM path that installs an _exit-based atexit callback, while also adding basic Chinese README documentation and build instructions. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Hi @lchjvvj. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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/daemon/Auth.cpp" line_range="332-333" />
<code_context>
+ // Register a pthread_atfork child handler here so that any
+ // grandchild processes spawned by PAM will have an atexit handler
+ // that runs _exit() first (LIFO), bypassing Qt's broken cleanup.
+ pthread_atfork(nullptr, nullptr, []() {
+ atexit([]() { _exit(0); });
+ });
+
</code_context>
<issue_to_address>
**issue (bug_risk):** The atfork child handler calls `atexit()` after `fork()` in a potentially multithreaded process, but `atexit()` is not async-signal-safe and can acquire a libc lock inherited in a locked state from another thread. The child can therefore deadlock while registering the supposedly protective handler.
**Triggers:** When the session-leader process has multiple threads and another thread holds an exit-handler or libc internal lock during the PAM fork.
**Suggested fix:** Avoid calling `atexit()` from the post-fork child handler; arrange for the PAM child path to call `_exit()` directly or use a fork/exec mechanism that does not run inherited cleanup handlers.
</issue_to_address>
摘要:在 Auth.cpp 的 PAM fork 子进程路径中注册 pthread_atfork child handler,拦截默认的 exit() 调用并替换为 _exit(0),彻底解决因 Qt atexit 清理引发的永久死锁问题。
影响组件:src/daemon/Auth.cpp
Summary by Sourcery
Prevent PAM login deadlocks by ensuring forked session processes bypass inherited cleanup handlers when they terminate.
Bug Fixes:
Enhancements:
Build:
Documentation: