-
Notifications
You must be signed in to change notification settings - Fork 16
fix: fix ddm crash on treeland crash #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi @calsys456. 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. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds null checks around Treeland connector cleanup to prevent crashes when disconnecting, and ensures internal pointers are reset after teardown. Updated class diagram for TreelandConnector disconnect lifecycleclassDiagram
class TreelandConnector {
- void* m_display
- QSocketNotifier* m_notifier
- DdmClient* m_ddm
+ void connect(QString socketPath)
+ void disconnect()
}
%% Key behavioral changes in disconnect()
TreelandConnector : disconnect() checks m_display before teardown
TreelandConnector : disconnect() checks m_notifier before setEnabled(false)
TreelandConnector : disconnect() checks m_notifier before delete
TreelandConnector : disconnect() sets m_display to nullptr after wl_display_disconnect
TreelandConnector : disconnect() sets m_ddm to nullptr after teardown
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - I've left some high level feedback:
- After deleting
m_notifier, consider settingm_notifiertonullptras well to avoid dangling pointers and make the cleanup pattern consistent withm_displayandm_ddm. - The repeated
if (m_notifier)checks can be simplified by wrapping bothsetEnabled(false)anddeletein a single block or helper, improving readability and reducing the chance of future divergence. - The
if (m_ddm)guard beforem_ddm = nullptr;is unnecessary since assigningnullptris safe even if it is alreadynullptr, so you can drop the condition to simplify the logic.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- After deleting `m_notifier`, consider setting `m_notifier` to `nullptr` as well to avoid dangling pointers and make the cleanup pattern consistent with `m_display` and `m_ddm`.
- The repeated `if (m_notifier)` checks can be simplified by wrapping both `setEnabled(false)` and `delete` in a single block or helper, improving readability and reducing the chance of future divergence.
- The `if (m_ddm)` guard before `m_ddm = nullptr;` is unnecessary since assigning `nullptr` is safe even if it is already `nullptr`, so you can drop the condition to simplify the logic.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes crashes that occur when Treeland (the Wayland compositor used as greeter) crashes by adding null pointer checks to the disconnect() method in TreelandConnector. The changes prevent dereferencing null pointers during cleanup and ensure proper state reset for reconnection.
Changes:
- Added null pointer checks before accessing
m_notifierin the disconnect method - Reset
m_displayandm_ddmpointers to nullptr after cleanup to support safe reconnection
3f618d8 to
19273a3
Compare
19273a3 to
2c772a7
Compare
The problem is caused by reckless cleanup process. Check those pointers carefully to make reconnection works.
2c772a7 to
c7f2e0f
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: calsys456, wineee, zccrs 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 |
The problem is caused by reckless cleanup process. Check those pointers carefully to make reconnection works.
Summary by Sourcery
Guard Treeland connection teardown to prevent crashes during disconnect and allow safe reconnection.
Bug Fixes: