I am currently running Ubuntu 13.10. I experienced this same issue with Ubuntu 12.04, so I dont believe the following issue is tied to a specific release.
I am using Ubuntu for work, by choice. Id like to stay logged in overnight, so that I can immediately resume my work when I arrive the next morning. Unfortunately, when I arrive the next day, I often get this issue where any mouse movement or keyboard input results in a flashing/flickering screen, and I cant type in my password for gnome-screensaver.
I try going to tty4, restarting unity (which, in 13.10, now says "restart is deprecated" ... derp), restarting lightdm, restarting compiz, you name it. Nothing works. Everything I try either has no effect, or produces some unhelpful error message that equates to "nope." I am always forced to "sudo reboot" from tty4, which isnt the end of the world, but its leaving me thinking Ubuntu 12.04+ is about as reliable as a Microsoft product (I have many other reasons for this opinion).
I have been trying to troubleshoot this issue for about 7 months to no avail. Previously, my employer gave me a craptacular machine which could barely run Ubuntu 12.04. I ended up believing the issue was due to running a modern OS on an outdated machine. I couldnt even run a Virtual Machine for testing software updates, which was my only viable argument in getting a new computer.
I finally convinced my employer to get me a new machine. This one has 8G RAM, brand new 1TB HD, quad core 3.2ghz i7, etc - its decent for work (note: no video card, but that shouldnt matter cuz I just write web dev software). I installed Ubuntu 13.10 on this machine. I still have the same exact problem.
I usually just have sublime text 2, and 3 gnome-terminal sessions open to my internal development server left open overnight. I lock my screen as I leave for the day, and am using gnome-screensaver (the default black screen). Ive gone through debug log, kernel log, syslog, xorg log, lightdm log, apport log, even faillog, and nothing strikes me as out of the ordinary. At most, the syslog prints tons of the following error overnight:
<time> <hostname>: whoopsie[<id>]: online
<time> whoopsie[<id>]: last message repeated <2/3> times
On the old outdated machine (12.04), there were lots of errors with gnome-screensaver, which led me to conclude that the machine diddnt have enough video memory to reload the desktop after some issue with the screensaver (sounds crazy, but hey Im no expert). On this new machine, there are no such logs concerning gnome-screensaver, so there goes my theory.
Another oddity is I have been using Ubuntu for my home workstation since 12.04 was released, and have never experienced this issue. My home machine is pretty heavy duty in regards to video card, memory, disk space, nice motherboard, etc. I am currently running 13.04 at home (afraid to upgrade due to all the bugs in 13.10 that are also said to be present in the upcoming 14.04). If it werent for my positive experience with my home machine, Id ditch Ubuntu altogether. Not being able to keep my machine logged in overnight is driving me away from canonical products. I seriously cant afford to continue losing time at work with buggy operating system issues. Im that 'weirdo' in the office that chooses to use linux, so people arent fond of my technical differences as it is. Fedora / CentOS with Gnome 3 is looking very nice these days.
Can anyone help me figure out why staying logged in overnight results in flickering screen, unusable peripherals, and a broken environment?
{ update 7/17/2014 }
Hadnt had time to look into this for a while (this is my work machine afterall), but last night left my machine on with gnome-screensaver up overnight, and my system monitors showed low memory usage when I left for the evening. Came back today and memory has 1.7G in use and 5.3G cached, which is pretty much all of it. I then examined htop, and sorted the list by memory use.
Sure enough, there are 5 lightdm processes, and each of them uses a ton of memory. Here is the output:
PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command
1078 root 20 0 2880M 2342M 2319M S 0.7 29.6 8:39.44 /usr/bin/X -core :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
1117 root 20 0 2880M 2342M 2319M S 0.7 29.6 0:02.92 /usr/bin/X -core :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
1118 root 20 0 2880M 2342M 2319M S 0.0 29.6 0:01.33 /usr/bin/X -core :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
1119 root 20 0 2880M 2342M 2319M S 0.0 29.6 0:00.74 /usr/bin/X -core :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
1120 root 20 0 2880M 2342M 2319M S 0.0 29.6 0:00.00 /usr/bin/X -core :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
... a few other things with low memory usage follow...
Is this normal? Ill continue monitoring this, but I have a feeling these many lightdm processes are the culprit, and their collective memory usage is startlingly high. Can anyone shed some further light on this (no pun intended) ?
what usually works for me (with similar problem) is
although this completely stops the X server and restarts it
I have a similar system at home, used as a multi-purpose media center, server, cloud, whatever.
Ubuntu 12.04 LTS, Core i7 CPU, 8GB RAM, 1TB HDD. Whenever not in my office, the computer gets locked with ctrl + alt + L, using the same black screen you describe.
Hard drive crashed, upgraded to a 120GB SSD and got a 4TB HDD in return for the under-warranty 1TB drive, and ordered another 8GB of RAM with the SSD while waiting on the replacement drive. Installed Ubuntu 14.04 fresh, same deal: locked when gone, no problems.
I'm using Gnome 3 as my display manager, not sure about what you're using. The only discernible difference between us is your application, "Wally." I would recommend that you completely disable it, restart the machine, and give it about a week, or at least a couple days, then let us know whether it's still going on.
Upgrading to 14.04 seemed to be the solution. This machine has been used extensively and been left logged in for 6 days in a row now, and still runs as responsively and smoothly as a freshly rebooted machine / relogged user. Nothing has changed about my hardware. What I have noticed is that gnome-screensaver wasnt set as the default screen saving action for unity in 14.04. Something appears to have changed in regards to how this system manages memory while the screen is locked. No more apparent memory leak.
Something between lightdm, gmome-screensaver, Xorg, compiz, and unity has been updated enough between 12.* and 14.04 that this issue I was experiencing has been relieved. I also think not having a dedicated graphics card and having a less-than-adequate motherboard were involved in creating the right environmental conditions to cause this problem. My home machine, with a nice graphic card and far faster motherboard, has never exhibited this issue, even with the same exact software-level setup.