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

From: Eli Zaretskii <[email-masked]>
Date: Sun, 20 Dec 2015 17:54:30 +0200

> From: Joseph Mingrone <[email-masked]>
> Date: Sun, 20 Dec 2015 02:26:57 -0400
> 
> If clipmon-mode is enaled and a gui dialog box is displayed, then
> emacs will lock up and its process will use 100% CPU.  This happens
> with both
> 
> GNU Emacs 25.0.50.1 (amd64-portbld-freebsd10.1, GTK+ Version 2.24.29) of 2015-12-20
> 
> and
> 
> GNU Emacs 25.0.50.3 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23) of 2015-11-11.
> 
> Here is a recipe to repeat the problem:
> 
> % emacs -Q
> evaluate (load "/path/to/clipmon-20150306.1223/clipmon.el")
> S-<down> <down-mouse-1>
> 
> Thanks,
> 
> Joseph
> 
> Sometimes X will lock up and the only way to regain control is to
> switch to a virtual terminal and kill emacs.  Running emacs on a
> remote box, with the same recipe can lock the local window manager.  I
> will bring this to the attention of the clipmon developer in case this
> is a problem with the package.

What is your value of x-selection-timeout?

I think there is indeed a problem in clipmon: it calls
x-get-selection-value from a timer that runs every 2 sec.  But if the
call times out, and the value of x-selection-timeout is more than 2
sec (the default is 5, I think), then this will indeed wedge Emacs
cold, for obvious reasons.  In addition, the function that waits for
the timeout to expire also runs timers, which probably exacerbates the
problem.

Can you attach a debugger to Emacs when it is wedged, and see which
threads run and consume CPU?

Thanks.