Subject: bug#16027: 24.3; emacs infloop

From: Dmitry Antipov <[email-masked]>
Date: Wed, 04 Dec 2013 20:10:51 +0400

This is very similar to what I've found a few weeks ago in trunk.

Could you please try to run the following code:

$ cat frame-test.el

(defun frame-test ()
   (interactive)
   (dotimes (i 100)
     (let ((frame-list nil))
       (dotimes (j 10)
	(setq frame-list (cons (make-frame) frame-list)))
       (mapcar #'delete-frame frame-list))))

$ emacs -Q -l frame-test.el
M-x frame-test

Emacs probably hangs, with the backtrace similar to:

(gdb) bt
#0  0x000000386a60e3ed in __libc_recv (fd=3, buf=0x147e2f4, n=4096, flags=-1) at ../sysdeps/unix/sysv/linux/x86_64/recv.c:29
#1  0x000000386ca0b8cf in _xcb_in_read () from /lib64/libxcb.so.1
#2  0x000000386ca0a0e7 in _xcb_conn_wait () from /lib64/libxcb.so.1
#3  0x000000386ca0b37f in wait_for_reply () from /lib64/libxcb.so.1
#4  0x000000386ca0b492 in xcb_wait_for_reply () from /lib64/libxcb.so.1
#5  0x000000386d241b47 in _XReply (dpy=dpy@entry=0x147d030, rep=rep@entry=0x7fffc0d8a0f0, extra=extra@entry=0,
     discard=discard@entry=1) at xcb_io.c:602
#6  0x000000386d23d76d in XSync (dpy=0x147d030, discard=0) at Sync.c:44
#7  0x000000000052f212 in x_sync (f=0x2cad258) at ../../trunk/src/xfns.c:4406
#8  0x0000000000524a35 in x_make_frame_visible (f=0x2cad258) at ../../trunk/src/xterm.c:8940
#9  0x000000000041e6f5 in Fmake_frame_visible (frame=...) at ../../trunk/src/frame.c:1695
[...skip...]

Dmitry