From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#29170: 26.0.90; Emacs freezes when capturing an org-template Date: Fri, 02 Oct 2020 16:30:45 +0200 Message-ID: <87blhkwvhm.fsf@gnus.org> References: <87fu9rwksm.fsf@omecha.info> <87lfgpxl4m.fsf@gnus.org> <83sgaxf6eb.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1688"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: daimrod@omecha.info, 29170@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 02 16:31:21 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kOM5h-0000L5-9V for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 02 Oct 2020 16:31:21 +0200 Original-Received: from localhost ([::1]:57098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOM5g-0006Q6-89 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 02 Oct 2020 10:31:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOM5O-0006Dn-V2 for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2020 10:31:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58921) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kOM5O-00038J-LS for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2020 10:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kOM5O-00032Q-J2 for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2020 10:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Oct 2020 14:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29170 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 29170-submit@debbugs.gnu.org id=B29170.160164905711667 (code B ref 29170); Fri, 02 Oct 2020 14:31:02 +0000 Original-Received: (at 29170) by debbugs.gnu.org; 2 Oct 2020 14:30:57 +0000 Original-Received: from localhost ([127.0.0.1]:42234 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOM5I-000327-Lw for submit@debbugs.gnu.org; Fri, 02 Oct 2020 10:30:56 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:44386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOM5H-00031u-M0 for 29170@debbugs.gnu.org; Fri, 02 Oct 2020 10:30:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=BY+Dnsh3bpszdFKSGXLL5LVy2tEXqNkRqmQxRI/XkCQ=; b=i1YbPaTxuw7zesIm04P90C2I+5 khTrotoeQ8iJBuIV8zTsY4IAktBIbgOdVe1ZNc4oCkh4LGRD/kGKPYyMcp/Xq67s7tnSFRJxqd+w9 nX77KCNG4BRfhGofngSBw9PYlYlYlSikPSvIugUrAh2uMadLNxFhS8El0Wos0xo12QGM=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kOM59-0004Pq-1V; Fri, 02 Oct 2020 16:30:49 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEUgCA9THyGdZ1Zq S0jTvbf///8dkPdbAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+QKAg4GDYPN1S8AAAG2SURBVDjLdZRr FuMgCIXhZAMSN1AxC/DRDYx1/2sawGhq54w/mlO+IHC9BuBrnc4BOCDQ5/c6ggUEUN0J2S8qWTE/ w0C1pLziWGRv+4ucgcY7RORZAFYtgefnTkbytfQrCldAhcMA5C/m3jtncijFSsgwuitX19U4G+AX gFUj7mO1bDU4zUavG3SuWv79L/ggJektOvR5z3DS11EJ8MANtExLlB1EP2WRJz6g8wS1ahpvAJfM WL5ABhTRKBs5x1589aZAkshqAF7WUYlX88nEtgxJPSUuUnbWDAGi99321SOdfLV2io4royZ4S1kX ubdC4NMRLANLENAKNykuolA4E6ks5BVIzDrjUGrOuhXqSa7ZQ3aivFaRc+npAUmPHW0OLM0t8IHh BxuwRFjgpVONFBEkPCANCW1qQJFnljCbLHPCfwA8oNUfMGsoSFsGTzPADo55gBmO/ZIR1QnSXoS8 uTqMAb+KkJ1ufIkP0+HrfWtF+bfuFEWSI3HJZiu14mzKFEw6yugBHw1Xn+MxHffnF3i+L9sPQLmo g9in5PGuxNd53IOoe0is1h8wXjanlucavGwDp+AvqG13L9fgKPcAAAAldEVYdGRhdGU6Y3JlYXRl ADIwMjAtMTAtMDJUMTQ6MDY6MTMrMDA6MDBDsZlzAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTEw LTAyVDE0OjA2OjEzKzAwOjAwMuwhzwAAAABJRU5ErkJggg== X-Now-Playing: Jane Siberry's _When I Was A Boy_: "Sweet Incarnadine" In-Reply-To: <83sgaxf6eb.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 02 Oct 2020 10:12:28 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:189652 Archived-At: Eli Zaretskii writes: > Can you debug the cause which causes the freeze? What is the code > that freezes? I haven't debugged it, but Manuel said previously in this thread that the following patch sort of fixes the problem (included below), but it then leads to other issues. But the problem is in that area, I take it. ----- Here is a patch against HEAD to avoid the hang in infinite loop. The 'x-selection-timeout' pause will still be there even with this patch. My understandings: On OpenBSD, most of the time, the function "xselect.c/x_get_foreign_selection" won't get a SelectNotify with (SECONDARY, TEXT) as arguments (that I did not understand and it might never happen on other oses). But then, while waiting at most 'x-selection-timeout' into "process.c/wait_reading_process_output" the 'now' variable won't have a chance of being invalidated or updated and that is what cause the infinite loop. Someone more knowledgeable of "process.c/wait_reading_process_output" might have a better solution to this problem. diff --git a/src/process.c b/src/process.c index fc46e74332..25bd28a82b 100644 --- a/src/process.c +++ b/src/process.c @@ -5115,8 +5115,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, /* Exit if already run out. */ if (wait == TIMEOUT) { - if (!timespec_valid_p (now)) - now = current_timespec (); + now = current_timespec (); if (timespec_cmp (end_time, now) <= 0) break; timeout = timespec_sub (end_time, now); -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no