Bug 245329

Summary: kscreenlocker hangs after unlocking the screen
Product: kscreensaver Reporter: Israel J. Pattison <pattison>
Component: lockerAssignee: kscreensaver bugs tracking <kscreensaver-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: crash CC: gilboad, kdelibs-bugs, onizuka92, rdieter
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Output of 'valgrind /usr/lib64/kde4/libexec/kscreenlocker --forcelock'
Valgrind memcheck output
pstack output

Description Israel J. Pattison 2010-07-21 16:30:00 UTC
Version:           unspecified (using Devel) 
OS:                Linux

The screensaver is set to lock the screen sixty seconds after the screensaver starts.  To unlock the screen I enter my password and I the screensaver disappears.  So far, so good!  Now, if I try to lock my screen again using any of the lock icons from the plasma desktop nothing happens.  ps shows a process '/usr/lib64/kde4/libexec/kscreenlocker --forcelock', but SIGINT will not kill the process.  SIGKILL removes the process and we're back at step 1.

Reproducible: Always

Steps to Reproduce:
1.  Use any method (desktop menu, buttons, screensaver autolock, etc.) to lock the screen.
2.  Unlock the screen by activating the password dialog and typing in the password.
3.  Verify that the screen is no longer locked and everything is working.
4.  Attempt to lock the screen again as in step 1.
5.  Notice that there is no change in the desktop after attempting to lock the screen.
6.  In a terminal window, run 'ps -ef | grep [k]screenlocker' and verify that the kscreenlocker process is running.
7.  In the terminal window enter 'pkill kscreenlocker' and run the 'ps' command again.  Notice that the process was not killed.
8.  In the terminal window enter 'pkill -9 kscreenlocker' and run the 'ps' command again.  Notice that the process was killed.
9.  Attempt to lock the screen again as in step 1.  The screen should lock as expected.
10. Repeat the scenario, but instead of doing step 9, run 'strace /usr/lib64/kde4/libexec/kscreenlocker --forclock' from the terminal window.  Unlock the screen and notice that the kscreenlocker process is stuck with the following message:

open("/dev/tty", O_RDWR|O_NOCTTY|O_NONBLOCK) = 13
writev(13, [{"*** glibc detected *** ", 23}, {"/usr/lib64/kde4/libexec/kscreenl"..., 37}, {": ", 2}, {"malloc(): memory corruption (fas"..., 34}, {": 0x", 4}, {"000000000077b0a1", 16}, {" ***\n", 5}], 7*** glibc detected *** /usr/lib64/kde4/libexec/kscreenlocker: malloc(): memory corruption (fast): 0x000000000077b0a1 ***
) = 121
futex(0x7f89e5262e80, FUTEX_WAIT_PRIVATE, 2, NULL


Actual Results:  
Screen can not be locked if it has been locked and unlocked previously.

Expected Results:  
User should be able to lock the screen at any time using the screen lock commands from the desktop.
Comment 1 Oswald Buddenhagen 2010-07-27 11:48:07 UTC
well, this is obviously some memory corruption, so valgrinding instead of stracing would be more helpful.
i would try step 6 after step 2 already.
Comment 2 Israel J. Pattison 2010-07-27 13:15:35 UTC
Created attachment 49525 [details]
Output of 'valgrind /usr/lib64/kde4/libexec/kscreenlocker --forcelock'

I ran the screen locker again using valgrind.  I have attached a text file with the output.
Comment 3 Gilboa Davara 2010-07-29 06:16:11 UTC
I can confirm this bug, I'm seeing it consistently on two machines.
Fedora 13, x86_64, KDE 4.5 rc2 and now rc3.

pstack and valgrin output attached.
Comment 4 Gilboa Davara 2010-07-29 06:20:06 UTC
Created attachment 49612 [details]
Valgrind memcheck output
Comment 5 Gilboa Davara 2010-07-29 06:20:31 UTC
Created attachment 49613 [details]
pstack output
Comment 6 Gilboa Davara 2010-07-29 06:21:42 UTC
P.S. I'm using nVidia proprietary drivers on both machines. (In-case it matters)
Comment 7 Oswald Buddenhagen 2010-08-03 10:01:36 UTC
fwiw, this may be a duplicate of bug #243067
Comment 8 Gilboa Davara 2010-08-03 10:26:45 UTC
The valgrind output does seem to suggest that locker is trashing memory, which could result in weird behaviour and crashes in random places.

Never the less, at least in my case, I can reproduce it every time I unlock my machine and the callstack is far from being random.

- Gilboa
Comment 9 Oswald Buddenhagen 2011-02-27 17:38:24 UTC
seems to be a dupe of bug #243067 (which is a dupe of bug #243540) indeed

*** This bug has been marked as a duplicate of bug 243540 ***