GNU bug report logs - #55651
28.1; Wrong format specifiers in tramp-adb-get-device

Previous Next

Package: emacs;

Reported by: Hayden Shenk <hayden.shenk <at> zetier.com>

Date: Thu, 26 May 2022 05:22:01 UTC

Severity: normal

Found in version 28.1

Fixed in version 28.2

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 55651 in the body.
You can then email your comments to 55651 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#55651; Package emacs. (Thu, 26 May 2022 05:22:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Hayden Shenk <hayden.shenk <at> zetier.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 26 May 2022 05:22:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Hayden Shenk <hayden.shenk <at> zetier.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.1; Wrong format specifiers in tramp-adb-get-device
Date: Wed, 25 May 2022 22:12:35 -0400
[Message part 1 (text/plain, inline)]
Description:
When attempting to open a file on Android devices via tramp using adb
over tcp/ip tramp-adb-get-device throws the following error:

error: "Format specifier doesn’t match argument typex"

Reproducing the bug:
To reproduce the bug set up an android device to connect to over
TCP/IP with adb.  Instructions to do so can be found here:

https://developer.android.com/studio/command-line/adb

In this example, we'll assume the device is listening for adb
connections on 192.168.1.7:7449

Then the bug can be triggered by executing the following bit of elisp:

(find-file "/adb:192.168.1.7#7449:/data/local/tmp")

Patch:
Here is a proposed patch, which fixes the issue on my host:

modified   lisp/net/tramp-adb.el
@@ -1112,9 +1112,9 @@ E.g. a host name \"192.168.1.1#5555\" returns \"
192.168.1.1:5555\"
        tramp-prefix-port-format ":"
        (cond ((member host devices) host)
      ;; This is the case when the host is connected to the default port.
-     ((member (format "%s%s%d" host tramp-prefix-port-format port)
+     ((member (format "%s%s%s" host tramp-prefix-port-format port)
       devices)
-      (format "%s:%d" host port))
+      (format "%s:%s" host port))
      ;; An empty host name shall be mapped as well, when there
      ;; is exactly one entry in `devices'.
      ((and (zerop (length host)) (= (length devices) 1))

In GNU Emacs 28.1 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version
1.16.0, Xaw scroll bars)
 of 2022-05-24 built on papa-XPS-15-9500
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 20.04.4 LTS

Configured using:
 'configure --with-x-toolkit=lucid --with-mailutils --with-modules
 --enable-gcc-warnings --with-json --with-native-compilation --with-jpeg
 --with-png --with-rsvg --with-tiff --with-wide-int --with-imagemagick'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ IMAGEMAGICK
JPEG JSON LIBSELINUX MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM LUCID
ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-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
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map text-property-search seq byte-opt
gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils time-date subr-x cl-loaddefs
cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo x-toolkit
x multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 70504 11007)
 (symbols 48 7157 0)
 (strings 32 21358 1675)
 (string-bytes 1 686899)
 (vectors 16 14101)
 (vector-slots 8 297090 16970)
 (floats 8 25 38)
 (intervals 56 260 0)
 (buffers 992 11))
[Message part 2 (text/html, inline)]

Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Thu, 26 May 2022 16:15:02 GMT) Full text and rfc822 format available.

Notification sent to Hayden Shenk <hayden.shenk <at> zetier.com>:
bug acknowledged by developer. (Thu, 26 May 2022 16:15:02 GMT) Full text and rfc822 format available.

Message #10 received at 55651-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Hayden Shenk <hayden.shenk <at> zetier.com>
Cc: 55651-done <at> debbugs.gnu.org
Subject: Re: bug#55651: 28.1; Wrong format specifiers in tramp-adb-get-device
Date: Thu, 26 May 2022 18:14:35 +0200
Version: 28.2

Hayden Shenk <hayden.shenk <at> zetier.com> writes:

Hi Hayden,

> Description:
> When attempting to open a file on Android devices via tramp using adb
> over tcp/ip tramp-adb-get-device throws the following error:
>
> error: "Format specifier doesn’t match argument typex"

Thanks for reporting!

> Reproducing the bug:
> To reproduce the bug set up an android device to connect to over
> TCP/IP with adb.  Instructions to do so can be found here:
>
> https://developer.android.com/studio/command-line/adb
>
> In this example, we'll assume the device is listening for adb
> connections on 192.168.1.7:7449
>
> Then the bug can be triggered by executing the following bit of elisp:
>
> (find-file "/adb:192.168.1.7#7449:/data/local/tmp")
>
> Patch:
> Here is a proposed patch, which fixes the issue on my host:

Yep. tramp-dissect-file-name returns the port as a string for a long
time already, it was an oversight that this hasn't been changed
here. I've applied the patch in your name to the repositories, will
appear with Emacs 28.2.

Tramp 2.5.2.5, which will be released next days on GNU ELPA, will
contain the patch as well. Closing the bug.

Best regards, Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 24 Jun 2022 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 279 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.