Solved Corruption in $HOME/.cache -> WM crash -> titleless X11 windows

Today when I booted and logged in and ran "startxfce4", I got a broken XFCE desktop session, where windows had no borders or titles, no keyboard focus, etc.

This kind of problem was known to me, and can otherwise be reproduced, by eg. setting the LIBGL_DRIVERS_PATH environment variable to the 32 bit path I use for Wine apps, but this time that variable was unset.

I ran the usual checks. No system or package updates were done. All the required packages were installed, I was in the "video" group. "pkg check -s -a" returned no package checksum errors. "kldstat" showed i915kms graphics driver was loaded, Xorg.0.log reported nothing strange, "dmesg" and /var/log/messages looked ok, etc.

To try distinguish whether the error was with the system or my user account, I tried creating another user account, adding it to the "video" group, and running "startxfce4" from there. To my relief, I got a perfectly working desktop session. That's when I knew the problem wasn't the hardware or system (driver or X11 or Mesa), but rather something in my user account.

I tried renaming some of the XDG directories that could store corrupt files. Renaming $HOME/.config had no effect, I got a different looking but still broken desktop.

It was deleting $HOME/.cache that fixed everything.

At the same time, deleting $HOME/.cache also lost my browser tabs, previously saved desktop session, and so on. So if you ever experience this, rather rename subdirectory by subdirectory to isolate the corrupt file, instead of deleting everything.



Cause: the XFCE session was probably saved incorrectly to somewhere in $HOME/.cache, corrupting its settings in a way that caused xfwm4 to crash next time it started up and tried to restore the session. The core file for xfwm4:
Code:
Program terminated with signal SIGTRAP, Trace/breakpoint trap.
Breakpoint.
#0  0x000000082f78e24a in g_log_writer_default () from /usr/local/lib/libglib-2.0.so.0
[Current thread is 1 (LWP 100869)]
(gdb) bt
#0  0x000000082f78e24a in g_log_writer_default () at /usr/local/lib/libglib-2.0.so.0
#1  0x000000082f78d7e7 in g_log_structured_array () at /usr/local/lib/libglib-2.0.so.0
#2  0x000000082f78e043 in g_log_structured_standard () at /usr/local/lib/libglib-2.0.so.0
#3  0x00000008296bb9eb in  () at /usr/local/lib/libgdk-3.so.0
#4  0x00000008296c938c in  () at /usr/local/lib/libgdk-3.so.0
#5  0x0000000832a9ca45 in _XError () at /usr/local/lib/libX11.so.6
#6  0x0000000832a99e18 in _XReply () at /usr/local/lib/libX11.so.6
#7  0x0000000832a7c454 in XGetWindowProperty () at /usr/local/lib/libX11.so.6
#8  0x0000000832a7cbb9 in XGetTextProperty () at /usr/local/lib/libX11.so.6
#9  0x0000000832a7b5d4 in XGetCommand () at /usr/local/lib/libX11.so.6
#10 0x000000000023f51e in  ()
#11 0x00000000002503b2 in  ()
#12 0x000000082eb17a46 in g_closure_invoke () at /usr/local/lib/libgobject-2.0.so.0
#13 0x000000082eb2fe3d in  () at /usr/local/lib/libgobject-2.0.so.0
#14 0x000000082eb30f26 in g_signal_emit_valist () at /usr/local/lib/libgobject-2.0.so.0
#15 0x000000082eb31356 in g_signal_emit () at /usr/local/lib/libgobject-2.0.so.0
#16 0x0000000827956aef in  () at /usr/local/lib/libxfce4ui-2.so.0
#17 0x00000008250a62e1 in _SmcProcessMessage () at /usr/local/lib/libSM.so.6
#18 0x0000000825e15e15 in IceProcessMessages () at /usr/local/lib/libICE.so.6
#19 0x00000008279567d5 in  () at /usr/local/lib/libxfce4ui-2.so.0
#20 0x000000082f784034 in g_main_context_dispatch () at /usr/local/lib/libglib-2.0.so.0
#21 0x000000082f784373 in  () at /usr/local/lib/libglib-2.0.so.0
#22 0x000000082f7846aa in g_main_loop_run () at /usr/local/lib/libglib-2.0.so.0
#23 0x000000082b671c5b in gtk_main () at /usr/local/lib/libgtk-3.so.0
#24 0x0000000000241f52 in  ()
#25 0x0000000000220a70 in  ()
#26 0x0000000000220970 in  ()
#27 0x0000000000000000 in  ()
and the error it tried to log was apparently the X11 BadWindow error:
Code:
(gdb) x/5s $rdi
0x85df10800:    "\n(xfwm4:2672): Gdk-\033[1;31mERROR\033[0m **: \033[34m20:39:12.551\033[0m: The program 'xfwm4' received an X Window System error.\nThis probably reflects a bug in the program.\nThe error was 'BadWindow (invalid Win"...
0x85df108c8:    "dow parameter)'.\n  (Details: serial 35519134 error_code 3 request_code 20 (core protocol) minor_code 0)\n  (Note to programmers: normally, X errors are reported asynchronously;\n   that is, you will rec"...
0x85df10990:    "eive the error a while after causing it.\n   To debug your program, run it with the GDK_SYNCHRONIZE environment\n   variable to change this behavior. You can then get a meaningful\n   backtrace from your"...
0x85df10a58:    " debugger if you break on the gdk_x_error() function.)"
0x85df10a8f:    "\377\377\377\001"

Hope this helps someone.
 
Last edited by a moderator:
Back
Top