Subject: bug#1666: 23.0.60; Emacs goes in a malloc loop

From: Chong Yidong <[email-masked]>
Date: Sat, 27 Dec 2008 10:00:09 -0500

> Following is the piece of Emacs Lisp code, which I tried to execute in
> Emacs's *scratch* buffer to close all buffers except the buffer named
> "buffer-name".
>
> ,----
> | (dolist (buffer (buffer-list))
> |         (unless (string-match "buffer-name" (buffer buffer))
> |                 (kill-buffer buffer)))
> `----
>
> Executing above Emacs Lisp code increases CPU usage and Emacs keeps on
> allocating memory. This bug is reproducible always.

I assume that by

  (string-match "buffer-name" (buffer buffer))

you mean

  (string-match "buffer-name" (buffer-name buffer))

However, I cannot reproduce this bug on 23.0.60.1 (i686-pc-linux-gnu, X
toolkit, Xaw3d scroll bars), or on 23.0.60.1 (i686-pc-linux-gnu, GTK+
Version 2.14.4).

Do you see this bug when Emacs is compiled with GTK support?  Try also
compiling without some of the other configuration flags---do they make a
difference?