I have XFCE4 configured to start conky up when I log in. For some months now I have noticed that conky does not start up sometimes - I've finally had enough of this and have investigated.
conky is started correctly, however it quickly fails with the following X error:
X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 3 (X_GetWindowAttributes) Resource id in failed request: 0x4a00001 Serial number of failed request: 121 Current serial number in output stream: 122
When started manually, conky is fine - so clearly its a contention issue during the period where many programs are starting up.
After doing some research I was able to find why conky died (as compared to this just being an error) - default X error handlers were being used, which exit when hit - which is not acceptable to me as a user (good thing I am a programmer ;)).
A backtrace of the exit:
#0 __GI_exit (status=1) at exit.c:99 No locals. #1 0x00007ffff66d1b98 in _XDefaultError () from /usr/lib/x86_64-linux-gnu/libX11.so.6 No symbol table info available. #2 0x00007ffff66d1cdb in _XError () from /usr/lib/x86_64-linux-gnu/libX11.so.6 No symbol table info available. #3 0x00007ffff66ced57 in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6 No symbol table info available. #4 0x00007ffff66cfe12 in _XReply () from /usr/lib/x86_64-linux-gnu/libX11.so.6 No symbol table info available. #5 0x00007ffff66b6ac6 in XGetWindowProperty () from /usr/lib/x86_64-linux-gnu/libX11.so.6 No symbol table info available. #6 0x0000000000419bfc in find_desktop_window (p_desktop=0x673730 <window+16>, p_root=0x673720 <window>) at ../../src/x11.c:130 type = 0 format = 0 i = <optimized out> nitems = 0 bytes = 0 n = 104 root = 703 win = 703 troot = 703 parent = 0 children = 0x6c37c0 buf = 0x0 #7 0x000000000041a09e in init_window (own_window=1, w=10, h=10, set_trans=<optimized out>, back_colour=<optimized out>, argv=argv@entry=0x7fffffffe888, argc=argc@entry=1) at ../../src/x11.c:281 depth = 0 flags = <optimized out> visual = 0x0 #8 0x000000000043281c in X11_create_window () at ../../src/conky.c:4395 No locals. #9 initialisation (argc=argc@entry=1, argv=argv@entry=0x7fffffffe888) at ../../src/conky.c:5812 act = {__sigaction_handler = {sa_handler = 0x6a897f, sa_sigaction = 0x6a897f}, sa_mask = {__val = {0, 0, 0, 0, 0, 17184406103, 4536906, 4521984, 0, 4536906, 4536906, 4536919, 0, 0, 0, 4294967295}}, sa_flags = 0, sa_restorer = 0xf494d6f0} oact = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {1, 140737488346912, 58, 258797660, 140737351927184, 0, 28, 4043713, 140737349680896, 140737349680340, 4536906, 126366, 140737349680896, 6918624, 140737349685432, 6917226}}, sa_flags = -190586008, sa_restorer = 0x0} #10 0x0000000000409a9f in main (argc=1, argv=0x7fffffffe888) at ../../src/conky.c:5953 s = 0x7fffffffee4f "en_GB.UTF-8" temp = <optimized out> x = <optimized out>
I have since implemented a basic X error handler that ignores errors - after 4 X errors occur, conky starts up correctly.
I was about to attach the patch when I noticed that lack of X error handlers was an explicit choice - see conky.c x11_error_handler function, ~line 4345, that is only used when DEBUG is enabled - and even when it is available it promptly aborts!
So, I have to open this ticket up as discussion - why let a non-fatal error kill conky?
conky -V: Conky 1.9.0 compiled Sun Oct 6 18:56:00 BST 2013 for Linux 3.10-3-amd64 (x86_64) Compiled in features: System config file: /usr/local/etc/conky/conky.conf Package library path: /usr/local/lib/conky X11: * Xdamage extension * XDBE (double buffer extension) * Xft * ARGB visual Music detection: * MPD * MOC General: * math * hddtemp * portmon * config-output * apcupsd * iostats * ncurses * Lua Lua bindings: