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

From: "Robert Lange" <[email-masked]>
Date: Tue, 10 May 2016 12:40:36 -0400

Same setup as before.

(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, 
 args=args@entry=0x7fffffffa3c0, num_args=num_args@entry=3, typed_args=typed_args@entry=0x0, num_typed_args=num_typed_args@entry=0) at ../../src/Create.c:570
#14 0x00007ffff66f2b0e in XtCreateWidget (name=0x703028 "verticalScrollBar", widget_class=0x7ffff6dac1c0 <scrollbarClassRec>, parent=0xff6940, args=0x7fffffffa3c0, num_args=3) at ../../src/Create.c:589
#15 0x000000000053c417 in x_create_toolkit_scroll_bar (f=0xffed38, bar=0x134e3b8) at xterm.c:4768
#16 0x000000000053c937 in x_scroll_bar_create (w=0x13b0940, top=686, left=1, width=16, height=19) at xterm.c:4960
#17 0x000000000053d167 in XTset_vertical_scroll_bar (w=0x13b0940, portion=0, whole=0, position=0) at xterm.c:5205
#18 0x000000000046b064 in set_vertical_scroll_bar (w=0x13b0940) at xdisp.c:15905
#19 0x000000000046fcfa in redisplay_window (window=..., just_this_one_p=false) at xdisp.c:16947
#20 0x00000000004644f2 in redisplay_window_0 (window=...) at xdisp.c:14373
#21 0x00000000006173df in internal_condition_case_1 (bfun=0x4644b0 <redisplay_window_0>, arg=..., handlers=..., hfun=0x46447f <redisplay_window_error>) at eval.c:1372
#22 0x000000000046445d in redisplay_windows (window=...) at xdisp.c:14353
#23 0x0000000000463204 in redisplay_internal () at xdisp.c:13949
#24 0x0000000000463db4 in redisplay_preserve_echo_area (from_where=12) at xdisp.c:14206
#25 0x0000000000674157 in wait_reading_process_output (time_limit=30, nsecs=0, read_kbd=-1, do_display=true, wait_for_cell=..., wait_proc=0x0, just_wait_proc=0) at process.c:4821
#26 0x0000000000422d0c in sit_for (timeout=..., reading=true, display_option=1) at dispnew.c:5867
#27 0x0000000000576bff in read_char (commandflag=1, map=..., prev_event=..., used_mouse_menu=0x7fffffffd7c5, end_time=0x0) at keyboard.c:2810
#28 0x00000000005858f4 in read_key_sequence (keybuf=0x7fffffffd9f0, bufsize=30, prompt=..., dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false)
 at keyboard.c:9089
#29 0x0000000000573161 in command_loop_1 () at keyboard.c:1453
#30 0x000000000061726e in internal_condition_case (bfun=0x572d8a <command_loop_1>, handlers=..., hfun=0x57253d <cmd_error>) at eval.c:1348
#31 0x0000000000572a28 in command_loop_2 (ignore=...) at keyboard.c:1178
#32 0x00000000006166f1 in internal_catch (tag=..., func=0x572a05 <command_loop_2>, arg=...) at eval.c:1112
#33 0x00000000005729dc in command_loop () at keyboard.c:1157
#34 0x0000000000572069 in recursive_edit_1 () at keyboard.c:778
#35 0x0000000000572239 in Frecursive_edit () at keyboard.c:849
#36 0x000000000057017b in main (argc=7, argv=0x7fffffffddb8) at emacs.c:1642

Lisp Backtrace:
"redisplay_internal (C function)" (0xd553f0)

(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'
}