Subject: bug#29170: 26.0.90; Emacs freezes when capturing an org-template

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 10 Oct 2020 21:57:31 +0200

<[email-masked]> writes:

> So, I tested it on emacs-27.1 with junk disabled and it still freezes.
>
> $ MALLOC_OPTIONS=jj emacs -q
>
> (let ((value 'SECONDARY)
>       (x-selection-timeout 2000))
>   ;;; from org-get-x-clipboard in lisp/org-compat.el
>   (gui-get-selection value 'UTF8_STRING)
>   (gui-get-selection value 'COMPOUND_TEXT)
>   (gui-get-selection value 'STRING)
>   (gui-get-selection value 'TEXT))

Thanks for checking.  So it sounds like we do need something like the
proposed patch (with #ifdef OpenBSD) here, but apparently the patch led
to other problems.

> I've tested your patch on emacs-25-3.1 and it does prevent the infinite
> loop. However, if the user sends input to emacs while it is waiting, it
> raises the following backtrace :
>
> Debugger entered--Lisp error: (error "Timed out waiting for reply from
> selection owner")
>   x-get-selection-internal(SECONDARY STRING nil nil)

So further work is needed here.  

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no