Subject: bug#22214: 25.0.50; lock up with gui dialogs and clipmon-mode

From: Joseph Mingrone <[email-masked]>
Date: Sun, 24 Apr 2022 10:23:43 -0300

I stopped using clipmon shortly after this bug was reported, but I just
cloned the repository and ran

% emacs -Q
(load "/path/to/clipmon/clipmon.el")
(run-at-time nil 2 (lambda () (gui-get-primary-selection)))
(menu-set-font)

When I dismissed the dialog box, sometimes things were fine, but other
times, Emacs started to use 100% CPU and would not respond to input.
Now I am able to kill the run-away emacs process and regain control of
the system.  Below is information about my current installation.

In GNU Emacs 29.0.50 (build 1, amd64-portbld-freebsd14.0, GTK+ Version 3.24.33, cairo version 1.17.4)
Repository revision: 1fed6e7
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: 14.0-CURRENT

Configured using:
 'configure --disable-build-details --localstatedir=/var
 --without-libsystemd --without-selinux --with-x --enable-acl
 --with-cairo --without-dbus --without-gconf --with-gif --with-gnutls
 --without-gsettings --with-x-toolkit=gtk3 --with-harfbuzz --with-jpeg
 --with-json --with-file-notification=kqueue --with-lcms2
 --without-m17n-flt --without-imagemagick --without-mailutils
 --with-modules --with-native-compilation --with-sound=oss
 --without-libotf --without-pgtk --with-png --with-toolkit-scroll-bars
 --with-sqlite3 --with-rsvg --with-threads --with-tiff --with-webp
 --without-xft --with-xim --with-xml2 --without-xpm --without-xwidgets
 --x-libraries=/usr/local/lib --x-includes=/usr/local/include
 --prefix=/usr/local --mandir=/usr/local/man --disable-silent-rules
 --infodir=/usr/local/share/emacs/info/
 --build=amd64-portbld-freebsd14.0 'CFLAGS=-O2 -pipe
 -fstack-protector-strong -isystem /usr/local/include
 -fno-strict-aliasing ' 'CPPFLAGS=-isystem /usr/local/include' 'LDFLAGS=
 -L/usr/local/lib/gcc11 -fstack-protector-strong -L/usr/local/lib ''

Configured features:
ACL CAIRO FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2
MODULES NATIVE_COMP NOTIFY KQUEUE PDUMPER PNG RSVG SOUND SQLITE3 THREADS
TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM GTK3 ZLIB

On Sat, 2022-04-23 at 16:06, Lars Ingebrigtsen <[email-masked]> wrote:

> Joseph Mingrone <[email-masked]> writes:

>> Here is the simplest example I can come up with that causes the problem.

>> ;; substitute x-get-selection-value for 24.x
>> (run-at-time nil 2 (gui-get-primary-selection))
>> (menu-set-font)

> (I'm going through old bug reports that unfortunately weren't resolved
> at the time.)

> Skimming this bug report, there were different cases for reproduction,
> but I tried this one (well actually

>  (run-at-time nil 2 (lambda () (gui-get-primary-selection)))
>  (menu-set-font)

> , since that's valid code), and I couldn't reproduce the lock up.

> Are you still seeing this problem in recent Emacs versions?