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 07:40:05 +0200 Message-ID: <87wpv4qzm2.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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1443850884 17163 80.91.229.3 (3 Oct 2015 05:41:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 3 Oct 2015 05:41:24 +0000 (UTC) Cc: rpluim@gmail.com, 21313@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 03 07:41:12 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 1ZiFZH-0006II-ET for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Oct 2015 07:41:11 +0200 Original-Received: from localhost ([::1]:37073 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZiFZG-0001K2-N2 for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Oct 2015 01:41:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZiFZC-0001Jv-22 for bug-gnu-emacs@gnu.org; Sat, 03 Oct 2015 01:41:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZiFZ8-0003Wr-RD for bug-gnu-emacs@gnu.org; Sat, 03 Oct 2015 01:41:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35469) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZiFZ8-0003Wn-Nx for bug-gnu-emacs@gnu.org; Sat, 03 Oct 2015 01:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZiFZ8-0006kO-1i for bug-gnu-emacs@gnu.org; Sat, 03 Oct 2015 01:41:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <877foo4nkd.fsf@gnu.org> Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Oct 2015 05:41: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.144385081325869 (code B ref 21313); Sat, 03 Oct 2015 05:41:01 +0000 Original-Received: (at 21313) by debbugs.gnu.org; 3 Oct 2015 05:40:13 +0000 Original-Received: from localhost ([127.0.0.1]:52673 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZiFYK-0006jB-Qo for submit@debbugs.gnu.org; Sat, 03 Oct 2015 01:40:13 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:41977) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZiFYI-0006j2-45 for 21313@debbugs.gnu.org; Sat, 03 Oct 2015 01:40:11 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6AE6A205FE for <21313@debbugs.gnu.org>; Sat, 3 Oct 2015 01:40:09 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Sat, 03 Oct 2015 01:40:09 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:message-id :mime-version:references:subject:to:x-sasl-enc:x-sasl-enc; s= smtpout; bh=aXkD1TK+g2qL8j11TgT7whNDZx0=; b=MYYKLboOhv1X43CGmxJ7 hyHEXONU7uxLV7htUQfalc5J3uxSQWVxsE3DN4wiOXPSRrRqoE7gRBPQZBr9uIbV pWODXpjI3cKdbDoNKmxzrrqcXbziT96lIGhWw1hRABhM/3NxTB9h9MepgYn9bR3M Hc5VRO1GpFkmX5lWc4sCB7k= X-Sasl-enc: eFezPK0uENQG+pEtRaOTrToQxjqJ2YKHRB+a515qYo/1 1443850808 Original-Received: from thinkpad-t440p (unknown [2.160.114.254]) by mail.messagingengine.com (Postfix) with ESMTPA id E8AC8C00018; Sat, 3 Oct 2015 01:40:07 -0400 (EDT) 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:107237 Archived-At: Michael Albinus writes: > If you feel that the changes didn't improve the situation, then > reverting them is indeed TRT, IMO. At the very least, the code will > be simpler after the revert. Ok, done that now. >>> the thing passed to `dbus-handle-event' looks like a dbus event >>> except that its contents are bogus. These events are created by >>> xd_read_message_1 in dbusbind.c, however that function is reasonable >>> strict and could not create the bogus event above, e.g., it calls >>> make_number on the event type which becomes the second item in a >>> dbus-event, i.e., the CHARACTER_POSITION above which is no number. >>> >>> So what should that tell us? >> >> Either that the event was not a valid D-Bus event, or that it weasn't >> created by that function? > > From the backtrace I have the feeling that it was created as another > event, and the marker `dbus-event' has been pushed there later. But I > cannot prove this. I have the same feeling as Michael. xd_read_message_1 and inotify_callback / inotifyevent_to_event are the only functions creating dbus and file-notify events here, and they'd all barf if the data they read was screwed. And keep in mind that it's not only about these kinds events. Sometimes keyboard events also get screwed, e.g., in the case where view-lossage tells me that I've typed a key which I actually didn't. Or in the case where I get a crash where probably the event is handled on the C-level where a broken event causes a segfault instead of being gracefully put in the debugger. > > > One idea for investigation would be to write special code that > > > would collect data about these events, from the moment they are > > > detected by pselect until they wind up in the D-bus handler, and > > > put that data into a data structure accessible from Lisp. Then > > > you could examine that data when the problem happens, and analyze > > > it. > > > > Well, yes, but I have no idea how to do that. > > What are your difficulties? > > Basically, the idea is to record the last N events in some Lisp data > structure. I would start with raw events as they are read from the > various sources, and move higher up the "food chain" as you gather > more insight into the problem. My problem is that the search space is not so small. Assuming that events are created correctly at first, I'd probably start recording events at kbd_buffer_store_event but then I'd want to track when, where, and how they are modified. Well, just the first would be better than nothing I guess. I'll try that out. If I had at least a reproducible recipe, I'd just try reverting the changes to keyboard.c of the last months one by one and see if I can find the culprit. But right now (with my invalid reverted in process.c fixes) I'm unable to provoke such an error although I've tried very hard. >> Btw, dbusbind.c seems to have its own debugging facilities, so >> another idea would be to turn them on. > > Yes. Compiling dbusbind.c with the setting MYCPPFLAGS=-DDBUS_DEBUG > enables traces to emacs' STDOUT. Don't hesitate to ask if you need > more information for interpretation of them. > > You can also add more traces in dbusbind.c using the macro > XD_DEBUG_MESSAGE. I'm using that now but as said, I don't think that's where the problem is. Bye, Tassilo