From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joel Ray Holveck Newsgroups: gmane.emacs.bugs Subject: bug#23336: 24.3; dbus-register-signal misparses :argN arguments Date: Thu, 21 Apr 2016 20:39:04 -0700 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1461296909 11143 80.91.229.3 (22 Apr 2016 03:48:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Apr 2016 03:48:29 +0000 (UTC) To: 23336@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 22 05:48:13 2016 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 1atS4i-0007Tb-Cq for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Apr 2016 05:48:12 +0200 Original-Received: from localhost ([::1]:53028 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atS4h-0001pF-Cp for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Apr 2016 23:48:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atS4b-0001lA-TL for bug-gnu-emacs@gnu.org; Thu, 21 Apr 2016 23:48:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1atS4Y-0005XZ-KE for bug-gnu-emacs@gnu.org; Thu, 21 Apr 2016 23:48:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atS4Y-0005XP-GI for bug-gnu-emacs@gnu.org; Thu, 21 Apr 2016 23:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1atS4Y-0000ck-48 for bug-gnu-emacs@gnu.org; Thu, 21 Apr 2016 23:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Joel Ray Holveck Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Apr 2016 03:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23336 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14612968532349 (code B ref -1); Fri, 22 Apr 2016 03:48:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Apr 2016 03:47:33 +0000 Original-Received: from localhost ([127.0.0.1]:42774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1atS45-0000bp-3J for submit@debbugs.gnu.org; Thu, 21 Apr 2016 23:47:33 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34205) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1atRwE-0000PW-M7 for submit@debbugs.gnu.org; Thu, 21 Apr 2016 23:39:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1atRw7-0000sM-QW for submit@debbugs.gnu.org; Thu, 21 Apr 2016 23:39:21 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:55889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atRw7-0000sI-Mz for submit@debbugs.gnu.org; Thu, 21 Apr 2016 23:39:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atRw6-0008UN-2n for bug-gnu-emacs@gnu.org; Thu, 21 Apr 2016 23:39:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1atRw1-0000s0-Kg for bug-gnu-emacs@gnu.org; Thu, 21 Apr 2016 23:39:18 -0400 Original-Received: from thor.piquan.org ([64.81.48.72]:16963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atRw0-0000nB-Vv for bug-gnu-emacs@gnu.org; Thu, 21 Apr 2016 23:39:13 -0400 Original-Received: from mail.piquan.org (www@thor.piquan.org [64.81.48.72]) (authenticated bits=0) by thor.piquan.org (8.15.2/8.15.2) with ESMTPSA id u3M3d4BA026393 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Thu, 21 Apr 2016 20:39:05 -0700 (PDT) (envelope-from joelh@piquan.org) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=piquan.org; s=201307; t=1461296345; bh=Tr5ksXyHdbCQbjN6ggg9gmdyv89MvCWh7ibv7W86txU=; h=Date:From:To:Subject; b=F95f4jNBvXbEuUJHQ4zoTdZsl8UT76AcTXZrO0yEfKH28pWW3WskdzMF5otV0E/5r 0dP2tmjK5iSaVAGn3V4YUS31RPl+tYV5xDa3v+/sAUVe85vrKLGlGfpvOwsbC3EIjW OB4TTIZ1zalGRx2c88xr3H8H2qx/8ntDbWIVEjXo= X-Authentication-Warning: thor.piquan.org: Host www@thor.piquan.org [64.81.48.72] claimed to be mail.piquan.org X-Sender: joelh@piquan.org User-Agent: Roundcube Webmail/1.1.4 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Thu, 21 Apr 2016 23:47:30 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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" Xref: news.gmane.org gmane.emacs.bugs:116672 Archived-At: The following expression raises an error of type "wrong-type-argument": (dbus-register-signal :system "com.ubuntu.Upstart" "/com/ubuntu/Upstart/jobs/network_2dinterface" "com.ubuntu.Upstart0_6.Job" "InstanceAdded" 'rwv-handle-intf-up :arg0 "/com/ubuntu/Upstart/jobs/network_2dinterface/cscotun0") (Note that this particular call is incorrect for reasons dealing with the Upstart API, but that is irrelevant to this bug.) If you evaluate the defun for dbus-register-signal (instead of using the .elc's compiled version) and then evaluate that expression, you can easily see where the problem is: Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p "0") <=("0" 63) (and (<= counter 63) (stringp value)) This happens on line 647 of dbus.el. You can see that counter was set on line 644 to a string, but then is compared against an integer. As a workaround, it's possible to use the backward-compatibility no-keywords style for :argN options, but not for :pathN options. The following patch fixes the issue: --- dbus.el.~1~ 2016-04-21 20:28:14.373278122 -0700 +++ dbus.el 2016-04-21 20:28:23.877255431 -0700 @@ -641,7 +641,8 @@ (string-match "^:\\(arg\\|path\\)\\([[:digit:]]+\\)$" (symbol-name key))) - (setq counter (match-string 2 (symbol-name key)) + (setq counter (string-to-number + (match-string 2 (symbol-name key))) args (cdr args) value (car args)) (unless (and (<= counter 63) (stringp value)) In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2014-03-07 on lamiak, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.11501000 System Description: Ubuntu 14.04.4 LTS Configured using: `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes' '--with-x-toolkit=lucid' '--with-toolkit-scroll-bars' '--without-gconf' '--without-gsettings' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'' Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=none locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: eldoc-mode: t minibuffer-electric-default-mode: t mail-abbrevs-mode: t iswitchb-mode: t desktop-save-mode: t savehist-mode: t which-function-mode: t auto-insert-mode: t show-paren-mode: t display-time-mode: t recentf-mode: t msb-mode: t shell-dirtrack-mode: t tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent messages: DBus-Event (dbus-event :system 2 260 org.freedesktop.DBus nil nil nil dbus-call-method-handler :1.0) [3 times] Fdbus_message_internal: DBUS_MESSAGE_TYPE_METHOD_CALL :system org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus AddMatch dbus-call-method-handler Fdbus_message_internal: Parameter3 type='signal',sender=':1.0',interface='com.ubuntu.Upstart0_6.Job',member='InstanceAdded',path='/com/ubuntu/Upstart/jobs/network_2dinterface',arg0='/com/ubuntu/Upstart/jobs/network_2dinterface/cscotun0' xd_signature: s xd_append_arg: s type='signal',sender=':1.0',interface='com.ubuntu.Upstart0_6.Job',member='InstanceAdded',path='/com/ubuntu/Upstart/jobs/network_2dinterface',arg0='/com/ubuntu/Upstart/jobs/network_2dinterface/cscotun0' Fdbus_message_internal: Message sent: (:serial :system 261) xd_read_message_1: Event received: DBUS_MESSAGE_TYPE_METHOD_RETURN 261 org.freedesktop.DBus (null) (null) (null) nil xd_read_message_1: Event stored: (:system 2 261 org.freedesktop.DBus nil nil nil dbus-call-method-handler) DBus-Event (dbus-event :system 2 261 org.freedesktop.DBus nil nil nil dbus-call-method-handler) [3 times] Matching rule "type='signal',sender=':1.0',interface='com.ubuntu.Upstart0_6.Job',member='InstanceAdded',path='/com/ubuntu/Upstart/jobs/network_2dinterface',arg0='/com/ubuntu/Upstart/jobs/network_2dinterface/cscotun0'" created Load-path shadows: ~/src/elisp/loaddefs hides ~/share/emacs/site-lisp/loaddefs /usr/share/emacs/24.3/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup /usr/share/emacs24/site-lisp/cmake-data/cmake-mode hides /usr/share/emacs/site-lisp/cmake-mode ~/src/elisp/loaddefs hides /usr/share/emacs/24.3/lisp/loaddefs /usr/share/emacs/site-lisp/rst hides /usr/share/emacs/24.3/lisp/textmodes/rst /usr/share/emacs24/site-lisp/prolog-el/prolog hides /usr/share/emacs/24.3/lisp/progmodes/prolog Features: (shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils hippie-exp edebug dbus xml debug info org-taskjuggler org-odt org-lparse org-latex org-export-latex org-beamer org-icalendar org-docbook footnote org-ascii cus-edit nroff-mode help-mode org-wl org-w3m org-vm org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html org-exp ob-exp org-exp-blocks org-agenda org-info org-gnus org-docview org-bibtex bibtex org-bbdb grep dired-aux dired-x dired misearch multi-isearch add-log semantic/imenu semantic/sb semantic/db-file data-debug cedet-files vc-git semantic/wisent/python semantic/decorate/include semantic/decorate/mode semantic/decorate pulse semantic/dep semantic/wisent/python-wy semantic/wisent semantic/wisent/wisent python rx eldoc jka-compr minibuf-eldef mailabbrev iswitchb icomplete desktop cus-start cus-load savehist vcursor disp-table org-protocol org ob-tangle ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys org-pcomplete org-list org-faces org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob org-compat org-macs ob-eval org-loaddefs find-func cal-menu calendar cal-loaddefs derived which-func imenu autoinsert cl-macs avoid paren time festival server cl tramp-cache tramp-sh recentf tree-widget msb tramp tramp-compat auth-source gnus-util mm-util mail-prsvr password-cache tramp-loaddefs shell pcomplete format-spec uniquify printing ps-print ps-def lpr midnight slime-autoloads pylint haskell-mode-autoloads ecb warnings edmacro kmacro ecb-symboldef ecb-analyse ecb-compatibility ecb-winman-support ecb-autogen autoload ecb-tod ecb-cycle ecb-eshell ecb-help ecb-jde ecb-method-browser hideshow ecb-semantic ecb-file-browser ecb-speedbar ecb-layout compile comint ansi-color ecb-create-layout advice help-fns cl-lib advice-preload ecb-compilation ecb-common-browser assoc speedbar sb-image dframe ecb-navigate ecb-mode-line ecb-face tree-buffer ecb-upgrade ecb-cedet-wrapper semantic/db-mode semantic/db-find semantic/db-ref semantic/analyze semantic/sort semantic/scope semantic/analyze/fcn semantic/db gv eieio-base semantic/format ezimage semantic/tag-ls semantic/find semantic/ctxt semantic/util-modes easymenu semantic/util semantic semantic/tag semantic/lex semantic/fw eieio byte-opt bytecomp byte-compile cconv mode-local cedet wid-edit ecb-util ring thingatpt devhelp time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting font-render-setting x-toolkit x multi-tty emacs)