Subject: bug#16058: 24.3.50; X protocol error: BadAlloc...

From: Dmitry Antipov <[email-masked]>
Date: Thu, 05 Dec 2013 10:51:31 +0400

On 12/05/2013 09:51 AM, Thierry Volpiatto wrote:

> Start emacs -Q
>
> M-x icomplete-mode
>
> C-x C-f <backspace> <backspace> <backspace> <right>
>
> --8<---------------cut here---------------start------------->8---
> X protocol error: BadAlloc (insufficient resources for operation) on protocol request 53
> [Thread 0x7fffefbbd980 (LWP 9875) exited]
> [Inferior 1 (process 9875) exited with code 0106]
> --8<---------------cut here---------------end--------------->8---

Reproduced.  Could you please obtain the backtrace? Currently I'm seeing:

#0  __fprintf (stream=0x3869dbb1e0 <_IO_2_1_stderr_>, format=0x67de08 "%s\n") at fprintf.c:27
#1  0x000000000050635e in x_connection_closed (dpy=0x13dcfa0,
     error_message=0x7fffffffa990 "X protocol error: BadAlloc (insufficient resources for operation) on protocol request 53")
     at ../../trunk/src/xterm.c:7590
#2  0x0000000000506484 in x_error_quitter (display=0x13dcfa0, event=0x7fffffffac40) at ../../trunk/src/xterm.c:7660
#3  0x00000000005063e5 in x_error_handler (display=0x13dcfa0, event=0x7fffffffac40) at ../../trunk/src/xterm.c:7630
#4  0x000000386d243c2b in _XError (dpy=dpy@entry=0x13dcfa0, rep=rep@entry=0xddf3e0) at XlibInt.c:1463
#5  0x000000386d240c87 in handle_error (dpy=0x13dcfa0, err=0xddf3e0, in_XReply=<optimized out>) at xcb_io.c:213
#6  0x000000386d240d35 in handle_response (dpy=dpy@entry=0x13dcfa0, response=0xddf3e0, in_XReply=in_XReply@entry=0) at xcb_io.c:325
#7  0x000000386d241675 in _XEventsQueued (dpy=dpy@entry=0x13dcfa0, mode=mode@entry=2) at xcb_io.c:364
#8  0x000000386d2337dd in XPending (dpy=0x13dcfa0) at Pending.c:55
#9  0x000000000050502c in XTread_socket (terminal=0xff3cb0, hold_quit=0x7fffffffaec0) at ../../trunk/src/xterm.c:6907
#10 0x0000000000538d9f in gobble_input () at ../../trunk/src/keyboard.c:6841
#11 0x00000000005391bf in handle_async_input () at ../../trunk/src/keyboard.c:7081
#12 0x00000000005391de in process_pending_signals () at ../../trunk/src/keyboard.c:7095
#13 0x000000000060a960 in wait_reading_process_output (time_limit=2, nsecs=0, read_kbd=1, do_display=true, wait_for_cell=12746930,
     wait_proc=0x0, just_wait_proc=0) at ../../trunk/src/process.c:4321
#14 0x000000000041f7e3 in sit_for (timeout=8, reading=false, display_option=2) at ../../trunk/src/dispnew.c:5800
#15 0x000000000052ea85 in command_loop_1 () at ../../trunk/src/keyboard.c:1414
#16 0x00000000005bcc23 in internal_condition_case (bfun=0x52e7f9 <command_loop_1>, handlers=12798402, hfun=0x52e111 <cmd_error>)
     at ../../trunk/src/eval.c:1344
#17 0x000000000052e556 in command_loop_2 (ignore=12746930) at ../../trunk/src/keyboard.c:1170
#18 0x00000000005bc435 in internal_catch (tag=12871090, func=0x52e530 <command_loop_2>, arg=12746930) at ../../trunk/src/eval.c:1108
#19 0x000000000052e4b6 in command_loop () at ../../trunk/src/keyboard.c:1141
#20 0x000000000052dd0c in recursive_edit_1 () at ../../trunk/src/keyboard.c:777
#21 0x000000000056632c in read_minibuf (map=13228406, initial=13401201, prompt=9518737, expflag=false, histvar=12814626, histpos=0,
     defalt=12863441, allow_props=false, inherit_input_method=false) at ../../trunk/src/minibuf.c:664
#22 0x0000000000566ba2 in Fread_from_minibuffer (prompt=9518737, initial_contents=13401201, keymap=13228406, read=12746930,
     hist=12814626, default_value=12863441, inherit_input_method=12746930) at ../../trunk/src/minibuf.c:954
[...skip...]

> Configured using:
>   `configure --with-x-toolkit=lucid --without-toolkit-scroll-bars
>   --without-gconf --without-gsettings'

Note that I can't reproduce this with a minimal Lucid build, i.e. 'configure --with-x-toolkit=lucid
--without-all'. We can have a nasty clash with some external library; it would be nice if you can
shrink your configuration from `--without-gconf --without-gsettings' to `--without-all', library
by library, and find a minimal configuration where the problem still exists.

Dmitry