From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.bugs Subject: bug#21313: 25.0.50; Strange errors from dbus-handle-event Date: Sat, 03 Oct 2015 14:06:56 +0200 Message-ID: <87y4fk5f6n.fsf@gnu.org> References: <877foo4nkd.fsf@gnu.org> <87wpvzs4r3.fsf@gnu.org> <87bnd9cf7g.fsf@gnu.org> <831te53zbq.fsf@gnu.org> <871te5cdg7.fsf@gnu.org> <83wpvx2h16.fsf@gnu.org> <87r3lziti9.fsf@gnu.org> <83zj0n7jtl.fsf@gnu.org> <87wpvjovfu.fsf@gnu.org> <877fnikhms.fsf@gmail.com> <87oaguq2yw.fsf@gnu.org> <8737xtt8wt.fsf@gnu.org> <834mi95bx1.fsf@gnu.org> <87twq9roxn.fsf@gnu.org> <83wpv53rjn.fsf@gnu.org> <87h9m9rmgk.fsf@gmx.de> <87wpv4qzm2.fsf@gnu.org> <877fn4ihrb.fsf@gnu.org> <83twq84e5r.fsf@gnu.org> <87y4fkgynh.fsf@gnu.org> <83k2r446sx.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1443874114 9742 80.91.229.3 (3 Oct 2015 12:08:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 3 Oct 2015 12:08:34 +0000 (UTC) Cc: rpluim@gmail.com, michael.albinus@gmx.de, 21313@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 03 14:08:17 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 1ZiLbt-0003kp-0f for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Oct 2015 14:08:17 +0200 Original-Received: from localhost ([::1]:38188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZiLbs-000466-EE for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Oct 2015 08:08:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZiLbh-0003y8-HT for bug-gnu-emacs@gnu.org; Sat, 03 Oct 2015 08:08:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZiLbe-00089r-7D for bug-gnu-emacs@gnu.org; Sat, 03 Oct 2015 08:08:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZiLbe-00089n-3v for bug-gnu-emacs@gnu.org; Sat, 03 Oct 2015 08:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZiLbd-0000Zi-LV for bug-gnu-emacs@gnu.org; Sat, 03 Oct 2015 08:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Oct 2015 12:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21313 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21313-submit@debbugs.gnu.org id=B21313.14438740232119 (code B ref 21313); Sat, 03 Oct 2015 12:08:01 +0000 Original-Received: (at 21313) by debbugs.gnu.org; 3 Oct 2015 12:07:03 +0000 Original-Received: from localhost ([127.0.0.1]:52884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZiLag-0000Y6-LY for submit@debbugs.gnu.org; Sat, 03 Oct 2015 08:07:03 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:49346) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZiLae-0000Xg-DM for 21313@debbugs.gnu.org; Sat, 03 Oct 2015 08:07:01 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E98BB20BE1 for <21313@debbugs.gnu.org>; Sat, 3 Oct 2015 08:06:59 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Sat, 03 Oct 2015 08:06:59 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=3B4DRK1ARfJjun7ooLRPF8jpw/M=; b=hPclS zo9Bu5XlzyEtJCvNztrfTxqhgRCq7VuN7peHOd1eAbkfmGRvNolmKQcIn0Bako1v 84eHAMHQWVRp2wVHTKQggGNzL6FgksnWb7iF426BImqmIS1cESPlHVJGeI6eyjA+ CdYlZH0KSVoydx0Wb/590AHPaQGg/qRZ4ENyn8= X-Sasl-enc: SBjNE7t3FOFOMhyDLJF4A1baKvUHaF9U02k+omC8z8Eg 1443874019 Original-Received: from thinkpad-t440p (unknown [2.160.114.254]) by mail.messagingengine.com (Postfix) with ESMTPA id C4969C00016; Sat, 3 Oct 2015 08:06:58 -0400 (EDT) In-Reply-To: <83k2r446sx.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 03 Oct 2015 12:53:18 +0300") User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) 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: 208.118.235.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:107256 Archived-At: Eli Zaretskii writes: >> I guess that naive approach won't work because make_lispy_event is not >> free of side-effects. It actually modifies the event so calling it >> twice per event has negative consequences. > > Indeed, you probably should construct the Lisp object from the event > by hand. Especially since we suspect some events might be invalid. Uh, well, does "by hand" mean reimplement make_lispy_event? I've tried cheating and calling that on a copy of the actual input_event. At least that compiles, emacs starts, and after some time my th-event-buffer will have the number 7 at index 0, and eventually it'll segfault. But I'm probably barking up the wrong tree anyway. kbd_buffer_store_event doesn't seem to be called very frequently; certainly not for every event. --8<---------------cut here---------------start------------->8--- modified src/keyboard.c @@ -3412,6 +3412,15 @@ kbd_buffer_nr_stored (void) void kbd_buffer_store_event (register struct input_event *event) { + printf ("kbd_buffer_store_event: %d\n", event); + struct input_event event_copy = *event; + printf (" copy: %d\n", &event_copy); + Faset (Vth_event_buffer, Vth_event_buffer_idx, make_lispy_event (&event_copy)); + if (Vth_event_buffer_idx == make_number (99)) + Vth_event_buffer_idx = make_number (0); + else + Vth_event_buffer_idx = call2 (Qplus, Vth_event_buffer_idx, make_number (1)); + kbd_buffer_store_event_hold (event, 0); } @@ -11131,6 +11140,14 @@ syms_of_keyboard (void) defsubr (&Sposn_at_point); defsubr (&Sposn_at_x_y); + DEFVAR_LISP ("th-input-event-buffer", Vth_event_buffer, + doc: /* The last 100 events. */); + Vth_event_buffer = Fmake_vector(make_number (100), Qnil); + + DEFVAR_LISP ("th-input-event-buffer-idx", Vth_event_buffer_idx, + doc: /* Current index in th-event-buffer. */); + Vth_event_buffer_idx = make_number (0); + DEFVAR_LISP ("last-command-event", last_command_event, doc: /* Last input event that was part of a command. */); --8<---------------cut here---------------end--------------->8--- >> Well, I now try following Michaels suggesting of reverting this one >> commit about `unread-command-events'. > > That's okay, but only as a means of switching your attention to the > alternative source of those bogus events (like unread-command-events). > The commit mentioned by Michael is not going to go away, as it fixes a > bad problem. However, it might need some adjustments to prevent > adverse side effects, if indeed reverting it will solve these > problems. Yeah, that commit seems to be unrelated anyway. > > But looking at the changes of this commit, I think the functions it > > touched are not used when editing in a message-mode buffer. > > There's also 30a6b1f81412044aa7dda5573b0142a0a03c4fd3, although it was > supposed to deal only with recording input events for the purposes of > keyboard macros. Ok, I'm running with that being reverted now. Bye, Tassilo