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

From: Eli Zaretskii <[email-masked]>
Date: Tue, 10 May 2016 19:59:46 +0300

> From: "Robert Lange" <[email-masked]>
> Date: Tue, 10 May 2016 12:40:36 -0400
> 
> (gdb) break x_error_quitter
> (gdb) run -Q -nw -xrm "emacs.synchronous: true" -f server-start
> 
> Breakpoint 3, x_error_quitter (display=0xfd7720, event=0x7fffffff9ac0) at xterm.c:7732
> 7732 {
> (gdb) bt
> #0 x_error_quitter (display=0xfd7720, event=0x7fffffff9ac0) at xterm.c:7732
> #1 0x0000000000542209 in x_error_handler (display=0xfd7720, event=0x7fffffff9ac0) at xterm.c:7717
> #2 0x00007ffff5fbb54b in _XError (dpy=dpy@entry=0xfd7720, rep=rep@entry=0xf97e30) at ../../src/XlibInt.c:1463
> #3 0x00007ffff5fb85e7 in handle_error (dpy=0xfd7720, err=0xf97e30, in_XReply=<optimized out>) at ../../src/xcb_io.c:213
> #4 0x00007ffff5fb8695 in handle_response (dpy=dpy@entry=0xfd7720, response=0xf97e30, in_XReply=in_XReply@entry=1) at ../../src/xcb_io.c:325
> #5 0x00007ffff5fb9578 in _XReply (dpy=dpy@entry=0xfd7720, rep=rep@entry=0x7fffffff9c80, extra=extra@entry=0, discard=discard@entry=0) at ../../src/xcb_io.c:627
> #6 0x00007ffff5faf4cf in XQueryColor (dpy=0xfd7720, cmap=32, def=0x7fffffff9ce0) at ../../src/QuColor.c:49
> #7 0x00007ffff6b8c50c in Xaw3dComputeTopShadowRGB () from /usr/lib/x86_64-linux-gnu/libXaw3d.so.6
> #8 0x00007ffff6b8c600 in ?? () from /usr/lib/x86_64-linux-gnu/libXaw3d.so.6
> #9 0x00007ffff6b8ca6a in ?? () from /usr/lib/x86_64-linux-gnu/libXaw3d.so.6
> #10 0x00007ffff66f1afc in CallInitialize (class=0x7ffff6dae960 <threeDClassRec>, req_widget=req_widget@entry=0x7fffffff9ef0, new_widget=new_widget@entry=0x1655210, args=args@entry=0x7fffffffa3c0, 
>  num_args=3) at ../../src/Create.c:226
> #11 0x00007ffff66f1ac6 in CallInitialize (class=0x7ffff6dac1c0 <scrollbarClassRec>, req_widget=req_widget@entry=0x7fffffff9ef0, new_widget=new_widget@entry=0x1655210, args=args@entry=0x7fffffffa3c0, 
>  num_args=num_args@entry=3) at ../../src/Create.c:221
> #12 0x00007ffff66f2427 in xtCreate (name=name@entry=0x703028 "verticalScrollBar", class=class@entry=0x0, widget_class=widget_class@entry=0x7ffff6dac1c0 <scrollbarClassRec>, parent=parent@entry=0xff6940, 
>  default_screen=0xfb5cb0, args=args@entry=0x7fffffffa3c0, num_args=num_args@entry=3, typed_args=typed_args@entry=0x0, num_typed_args=num_typed_args@entry=0, parent_constraint_class=0x0, 
>  post_proc=post_proc@entry=0x7ffff66f1b40 <widgetPostProc>) at ../../src/Create.c:416
> #13 0x00007ffff66f2840 in _XtCreateWidget (name=name@entry=0x703028 "verticalScrollBar", widget_class=widget_class@entry=0x7ffff6dac1c0 <scrollbarClassRec>, parent=parent@entry=0xff6940, 

So now we know that the error is caused by creation of the vertical
scrollbar.

> (gdb) print event
> $1 = (XErrorEvent *) 0x7fffffff9ac0
> 
> (gdb) print *event
> $2 = {
>  type = 0, 
>  display = 0xfd7720, 
>  resourceid = 0, 
>  serial = 1942, 
>  error_code = 4 '\004', 
>  request_code = 55 '7', 
>  minor_code = 0 '\000'
> }

Error code 4 is BadPixmap, according to my references.  I hope some X
expert will chime in and tell why this happens.  (I actually don't
understand why we try to create the scroll bar when the frame is
iconified.)

Thanks.