From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noah Friedman Newsgroups: gmane.emacs.bugs Subject: bug#19494: 25.0.50; infinite loop in readable_event on master branch Date: Fri, 02 Jan 2015 19:18:03 -0800 (PST) Message-ID: <20150102191803.251212.FMU1084@unexploded-cow.prv.splode.com> Reply-To: Noah Friedman NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1420259058 15366 80.91.229.3 (3 Jan 2015 04:24:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 3 Jan 2015 04:24:18 +0000 (UTC) To: 19494@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 03 05:24:11 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y7GG2-0003vr-Mg for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Jan 2015 05:24:10 +0100 Original-Received: from localhost ([::1]:53464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7GG1-0002Wr-Rv for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Jan 2015 23:24:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7GFy-0002Wl-6H for bug-gnu-emacs@gnu.org; Fri, 02 Jan 2015 23:24:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y7GFv-0002JJ-0X for bug-gnu-emacs@gnu.org; Fri, 02 Jan 2015 23:24:06 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7GFu-0002JE-Tm; Fri, 02 Jan 2015 23:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Y7GFu-0005Of-L6; Fri, 02 Jan 2015 23:24:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Noah Friedman Original-Sender: "Debbugs-submit" Resent-CC: eliz@gnu.org, bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Jan 2015 04:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19494 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: eliz@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.142025901820712 (code B ref -1); Sat, 03 Jan 2015 04:24:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Jan 2015 04:23:38 +0000 Original-Received: from localhost ([127.0.0.1]:35362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y7GFW-0005Nz-Eh for submit@debbugs.gnu.org; Fri, 02 Jan 2015 23:23:38 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55785) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y7GFU-0005Nr-AH for submit@debbugs.gnu.org; Fri, 02 Jan 2015 23:23:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y7GFT-0001xg-5Q for submit@debbugs.gnu.org; Fri, 02 Jan 2015 23:23:36 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:35402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7GFT-0001xc-0s for submit@debbugs.gnu.org; Fri, 02 Jan 2015 23:23:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7GFS-00025D-0Z for bug-gnu-emacs@gnu.org; Fri, 02 Jan 2015 23:23:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y7GFO-0001xH-Pa for bug-gnu-emacs@gnu.org; Fri, 02 Jan 2015 23:23:33 -0500 Original-Received: from [2600:3c01::f03c:91ff:fe96:f92b] (port=45237 helo=splode.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7GFO-0001wI-Hc for bug-gnu-emacs@gnu.org; Fri, 02 Jan 2015 23:23:30 -0500 Original-Received: from unexploded-cow.prv.splode.com (prv.splode.com [173.8.128.9]) (authenticated bits=0) by splode.com (8.14.8/8.14.8) with ESMTP id t033I3ON004169 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO) for ; Fri, 2 Jan 2015 19:18:03 -0800 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.7 (splode.com [74.207.245.10]); Fri, 02 Jan 2015 19:18:04 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:97954 Archived-At: Ever since commit 614beeecf29d16c08f66a4f82b6085be90df8a74 (c. Nov 01 2014) I keep finding "idle" emacs processes running in a tight loop in keyboard.c:readable_event after I come back to my session the following morning. In those cases, kbd_buffer is full of the same event, in my case: $17 = { kind = BUFFER_SWITCH_EVENT, part = scroll_bar_nowhere, code = 0, modifiers = 0, x = 0, y = 0, timestamp = 0, frame_or_window = 12962290, arg = 12962290 } That is, the entire kbd_buffer queue is BUFFER_SWITCH_EVENT events. Because of that, it means the sequence do { .... if (event == kbd_buffer + KBD_BUFFER_SIZE) event = kbd_buffer; } while (event != kbd_store_ptr); in the function readable_event will, at least at times, loop forever. I don't have a trivial or always-reliable test case but I think the offending elisp is the following, running in a (non-idle) timer: (force-mode-line-update 'all) (sit-for 0) ; force redisplay I can change the elisp in question since I wrote it, but I'm not sure what the right way to do it is since it's not just running during idle times. In any case having emacs lock up in a non-recoverable way seems like a bug, since the only way out is to hit C-g and abort, or else go in with gdb on the running process and force a return. Maybe this loop needs some kind of "didn't find any other event" flag to avoid looping, but I thought I'd check with the original committer first in case he has a better idea.