Skip to content
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

sessionLock: don't sendLocked when session lock has already been destoyed #7150

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

PaideiaDilemma
Copy link
Contributor

Describe your PR, what does it fix/add?

Fixes the following crash that can happen when the lock object is destroyed, but the session is still locked:

#0  0x00007fd7752767dc in __pthread_kill_implementation () from /nix/store/m71p7f0nymb19yn1dascklyya2i96jfw-glibc-2.39-52/lib/libc.so.6
#1  0x00007fd775224516 in raise () from /nix/store/m71p7f0nymb19yn1dascklyya2i96jfw-glibc-2.39-52/lib/libc.so.6
#2  0x00007fd77520c935 in abort () from /nix/store/m71p7f0nymb19yn1dascklyya2i96jfw-glibc-2.39-52/lib/libc.so.6
#3  0x00000000005e9b04 in handleUnrecoverableSignal(int) ()
#4  <signal handler called>
#5  0x00000000008aa750 in CSessionLock::sendLocked() ()
#6  0x00000000007cd21f in CSessionLockManager::onLockscreenRenderedOnMonitor(unsigned long) ()
#7  0x00000000009698d7 in CHyprRenderer::renderLockscreen(CMonitor*, timespec*, Hyprutils::Math::CBox const&) ()
#8  0x0000000000971a0c in CHyprRenderer::renderMonitor(CMonitor*) ()

Second commit (checking for m_pSessionLock->lock->good()) would fix it alone as well, but resetting m_pSessionLock on destroy seems the right thing to do and i did not find any problems with it.

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

When Hyprland is in the state where no lock screen client is present but the session is locked, m_pSessionLock will be a nullptr. The code already handles that by checking m_pSessionLock in the relevant places.

Is it ready for merging, or does it need work?

Ready.

@vaxerski vaxerski merged commit 592b4a7 into hyprwm:main Aug 2, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants