Subject: bug#23499: 24.5; emacs --daemon hangs randomly when emacsclient -c used repeatedly

From: Eli Zaretskii <[email-masked]>
Date: Tue, 10 May 2016 05:39:10 +0300

> From: "Robert Lange" <[email-masked]>
> Date: Mon, 09 May 2016 16:32:31 -0400
> 
> #0 require_socket (dpy=0xf98ba0) at ../../src/xcb_io.c:60
> #1 0x00007ffff5fb8b0e in poll_for_event (dpy=dpy@entry=0xf98ba0) at ../../src/xcb_io.c:251
> #2 0x00007ffff5fb8cfc in poll_for_response (dpy=dpy@entry=0xf98ba0) at ../../src/xcb_io.c:289
> #3 0x00007ffff5fb9147 in _XReadEvents (dpy=dpy@entry=0xf98ba0) at ../../src/xcb_io.c:424
> #4 0x00007ffff5fa1751 in XIfEvent (dpy=0xf98ba0, event=event@entry=0x7fffffff83f0, predicate=predicate@entry=0x7ffff5fe7790 <_CheckCMEvent>, arg=arg@entry=0xf50340 "\200\365*\366\377\177")
>  at ../../src/IfEvent.c:68
> #5 0x00007ffff5fe7f24 in _XimXRead (im=0xf50340, recv_buf=0x7fffffff8dd0 "", buf_len=2048, ret_len=0x7fffffff851c) at ../../../../modules/im/ximcp/imTrX.c:476
> #6 0x00007ffff5fe8b80 in _XimReadData (im=im@entry=0xf50340, len=len@entry=0x7fffffff857e, buf=buf@entry=0x7fffffff8dd0 "", buf_size=buf_size@entry=2048) at ../../../../modules/im/ximcp/imTransR.c:165
> #7 0x00007ffff5fe8e71 in _XimRead (im=im@entry=0xf50340, len=len@entry=0x7fffffff85ce, buf=buf@entry=0x7fffffff8dd0 "", buf_size=buf_size@entry=2048, 
>  predicate=predicate@entry=0x7ffff5fd6c80 <_XimDestroyICCheck>, arg=arg@entry=0x161a370 " \365*\366\377\177") at ../../../../modules/im/ximcp/imTransR.c:235
> #8 0x00007ffff5fd70e8 in _XimProtoDestroyIC (xic=0x161a370) at ../../../../modules/im/ximcp/imDefIc.c:914
> #9 0x00007ffff5fc58d2 in XDestroyIC (ic=0x161a370) at ../../../src/xlibi18n/ICWrap.c:265
> #10 0x000000000054c6d6 in free_frame_xic (f=0x139e798) at xfns.c:2087
> #11 0x00000000005455c5 in x_free_frame_resources (f=0x139e798) at xterm.c:9275
> #12 0x0000000000545c11 in x_destroy_window (f=0x139e798) at xterm.c:9383
> #13 0x000000000042826b in delete_frame (frame=..., force=...) at frame.c:1387
> #14 0x0000000000541ff3 in x_connection_closed (dpy=0xf98ba0, error_message=0x7fffffff9940 "X protocol error: BadPixmap (invalid Pixmap parameter) on protocol request 55") at xterm.c:7635
> #15 0x00000000005422b7 in x_error_quitter (display=0xf98ba0, event=0x7fffffff9af0) at xterm.c:7747
> #16 0x0000000000542209 in x_error_handler (display=0xf98ba0, event=0x7fffffff9af0) at xterm.c:7717
> #17 0x00007ffff5fbb54b in _XError (dpy=dpy@entry=0xf98ba0, rep=rep@entry=0xf76d70) at ../../src/XlibInt.c:1463
> #18 0x00007ffff5fb85e7 in handle_error (dpy=0xf98ba0, err=0xf76d70, in_XReply=<optimized out>) at ../../src/xcb_io.c:213
> #19 0x00007ffff5fb8695 in handle_response (dpy=dpy@entry=0xf98ba0, response=0xf76d70, in_XReply=in_XReply@entry=1) at ../../src/xcb_io.c:325
> #20 0x00007ffff5fb9578 in _XReply (dpy=dpy@entry=0xf98ba0, rep=rep@entry=0x7fffffff9cb0, extra=extra@entry=0, discard=discard@entry=0) at ../../src/xcb_io.c:627
> #21 0x00007ffff5faf4cf in XQueryColor (dpy=0xf98ba0, cmap=32, def=0x7fffffff9d10) at ../../src/QuColor.c:49
> #22 0x00007ffff6b8c50c in Xaw3dComputeTopShadowRGB () from /usr/lib/x86_64-linux-gnu/libXaw3d.so.6

This is some kind of X error.  Please run the daemon in X synchronous
mode (etc/DEBUG tells how to do that), and repeat the experiment.
Then the X error should be triggered immediately by whatever operation
errors out, and we will see a more helpful backtrace.  In that case,
please tell what the value of X error is.