GNU bug report logs - #29170
Emacs freezes when doing a gui-get-selection on OpenBSD

Previous Next

Package: emacs;

Reported by: daimrod <at> omecha.info (Grégoire Jadi)

Date: Mon, 6 Nov 2017 14:22:02 UTC

Severity: normal

Tags: confirmed

Merged with 45544

Found in versions 26.0.90, 27.1.90

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #70 received at 29170 <at> debbugs.gnu.org (full text, mbox):

From: Grégoire Jadi <gjadi <at> omecha.info>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, jca <at> wxcvbn.org, 29170 <at> debbugs.gnu.org
Subject: Re: bug#29170: 26.0.90; Emacs freezes when capturing an org-template
Date: Sun, 08 Aug 2021 16:33:48 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

Hi,

We (jca@ in Cc is the OpenBSD's maintainer of emacs) finally found a
solution to this bug.  The issue is in the broken SIGIO management.

This option was enabled on OpenBSD in 2011 as a workaround but it is not
required anymore.  We have disabled emacs_broken_SIGIO in OpenBSD's
ports tree and received lots of positive feedbacks (no more hang, some
operations are faster).

So we think it is safe to backport this change upstream.

diff --git a/configure.ac b/configure.ac
index c924634d5b..740f6d79a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4884,7 +4884,7 @@ AC_DEFUN
 
 case $opsys in
   dnl SIGIO exists, but the feature doesn't work in the way Emacs needs.
-  hpux* | nacl | openbsd | solaris | unixware )
+  hpux* | nacl | solaris | unixware )
     emacs_broken_SIGIO=yes
     ;;
 
Please note that the real issue is not fixed.  The issue is in the
broken SIGIO code itself.  I was able to reproduce the bug by enabling
emacs_broken_SIGIO on Ubuntu LTS 20.04.  I didn't take the time to find
a fix though.


Best,

> <daimrod <at> omecha.info> 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.  

-- 
gjadi
PGP : AF26 E9C2 A1C8 8D32 A868  4386 1373 5477 2B65 1894




This bug report was last modified 3 years and 338 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.