Giter Site home page Giter Site logo

libimobiledevice / usbmuxd Goto Github PK

View Code? Open in Web Editor NEW
1.4K 77.0 339.0 741 KB

A socket daemon to multiplex connections from and to iOS devices

Home Page: https://libimobiledevice.org

License: GNU General Public License v2.0

Shell 0.61% C 94.04% Makefile 0.88% M4 4.47%
usbmuxd daemon libimobiledevice library c usb ios

usbmuxd's Introduction

usbmuxd

A socket daemon to multiplex connections from and to iOS devices.

build

Features

usbmuxd stands for "USB multiplexing daemon". This daemon is in charge of multiplexing connections over USB to an iOS device.

To users, it means you can use various applications to interact with your device.

To developers, it means you can connect to any listening localhost socket on the device.

Some key features are:

  • Implementation: Open-Source implementation of proprietary usbmuxd daemon
  • Cross-Platform: Tested on Linux, macOS, Windows and Android platforms
  • Linux: Supports udev and systemd for automatic activation
  • Compatibility: Supports latest device firmware releases
  • Scalability: Supports multiple connections to different ports in parallel

usbmuxd is not used for tethering data transfers which uses a dedicated USB interface to act as a virtual network device.

The higher-level layers, especially if you want to write an application to interact with the device, are handled by libimobiledevice.

The low-level layer is handled by libusbmuxd.

Installation / Getting started

Debian / Ubuntu Linux

First install all required dependencies and build tools:

sudo apt-get install \
	build-essential \
	pkg-config \
	checkinstall \
	git \
	autoconf \
	automake \
	libtool-bin \
	libplist-dev \
	libusbmuxd-dev \
	libimobiledevice-dev \
	libimobiledevice-glue-dev \
	libusb-1.0-0-dev \
	udev

If systemd is not installed and should control spawning the daemon use:

sudo apt-get install \
	systemd

Then clone the actual project repository:

git clone https://github.com/libimobiledevice/usbmuxd.git
cd usbmuxd

Now you can build and install it:

./autogen.sh
make
sudo make install

If you require a custom prefix or other option being passed to ./configure you can pass them directly to ./autogen.sh like this:

./autogen.sh --prefix=/opt/local --without-preflight --without-systemd
make
sudo make install

To output a list of available configure options use:

./autogen.sh --help

Usage

The daemon is automatically started by udev or systemd depending on what you have configured upon hotplug of an iOS device and exits if the last device was unplugged.

When usbmuxd is running it provides a socket interface at /var/run/usbmuxd that is designed to be compatible with the socket interface that is provided on macOS.

You should also create an usbmux user that has access to USB devices on your system. Alternatively, just pass a different username using the -U argument.

The daemon also manages pairing records with iOS devices and the host in /var/lib/lockdown (Linux) or /var/db/lockdown (macOS).

Ensure proper permissions are setup for the daemon to access the directory.

For debugging purposes it is helpful to start usbmuxd using the foreground -f argument and enable verbose mode -v to get suitable logs.

Please consult the usage information or manual page for a full documentation of available command line options:

usbmuxd --help
man usbmuxd

Contributing

We welcome contributions from anyone and are grateful for every pull request!

If you'd like to contribute, please fork the master branch, change, commit and send a pull request for review. Once approved it can be merged into the main code base.

If you plan to contribute larger changes or a major refactoring, please create a ticket first to discuss the idea upfront to ensure less effort for everyone.

Please make sure your contribution adheres to:

  • Try to follow the code style of the project
  • Commit messages should describe the change well without being too short
  • Try to split larger changes into individual commits of a common domain
  • Use your real name and a valid email address for your commits

We are still working on the guidelines so bear with us!

Links

License

This library and utilities are licensed under the GNU General Public License v3.0, also included in the repository in the COPYING.GPLv3 file.

Credits

The initial usbmuxd daemon implementation was authored by Hector Martin.

Apple, iPhone, iPad, iPod, iPod Touch, Apple TV, Apple Watch, Mac, iOS, iPadOS, tvOS, watchOS, and macOS are trademarks of Apple Inc.

usbmuxd is an independent software application and has not been authorized, sponsored, or otherwise approved by Apple Inc.

README Updated on: 2022-04-04

usbmuxd's People

Contributors

ailike avatar balkanmadman avatar blefish avatar davidsansome avatar e7appew avatar exioreed avatar funkym avatar gh2o avatar gothi3 avatar hadess avatar hatstand avatar jbeich avatar lekensteyn avatar macalinao avatar marcan avatar mexmer avatar moschlar avatar mrmacete avatar nikias avatar qmfrederik avatar renaudcerrato avatar rickmark avatar sladen avatar sohgoh avatar williamspatrick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

usbmuxd's Issues

./autogen.sh cannot work for OS X10.9/Xcode5.1

"libtoolize: command not found"
"Alternatively, you may set the environment variables libplist_CFLAGS
and libplist_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details."

Meaning of this error

I have several devices plugged in and a client program that I'm writing, when running the usbmuxd daemon with (this was noticed during development)

$ usbmuxd  -f 

I get:

 Client 14 output buffer full (2444 bytes) while sending message 8 (638 bytes)

1 ) Does this mean that usbmuxd's internal output buffer is full or it can't communicate to my client's connected socket?
2) What are the advantages of running udev ? the -u flag.

Device 3-16 RX aborted due to error or disconnect

I'm using the latest versions:
iPad 7.0.4
and Gentoo Linux:

  • libimobiledevice-1.1.5
  • usbmuxd-1.0.8
  • libusb-1.0.9

The error appears right after I press "trust this computer" button. It seems that usb driver is getting re-initializated right after that.

usbmuxd (running as root with udev disabled):

usbmuxd -v -v -f 
[16:45:06.503][3] usbmuxd v1.0.8 starting up
[16:45:06.504][4] Creating socket
[16:45:06.504][5] client_init
[16:45:06.504][5] device_init
[16:45:06.504][4] Initializing USB
[16:45:06.504][5] usb_init for linux / libusb 1.0
[16:45:06.505][4] Found new device with v/p 05ac:12ab at 3-16
[16:45:06.505][4] Found interface 1 with endpoints 04/85 for device 3-16
[16:45:06.506][4] Using wMaxPacketSize=512 for device 3-16
[16:45:06.506][3] Connecting to new device on location 0x30010 as ID 1
[16:45:06.506][4] 1 device detected
[16:45:06.506][3] Initialization complete
[16:45:06.506][3] Connected to v1.0 device 1 on location 0x30010 with serial number eccebd628de5136ccb2f1dfcb4b728636d1f6c87
[16:45:06.506][5] client_device_add: id 1, location 0x30010, serial eccebd628de5136ccb2f1dfcb4b728636d1f6c87
[16:45:14.828][4] Device 3-16 RX aborted due to error or disconnect
[16:45:14.828][3] Removed device 1 on location 0x30010
[16:45:14.828][5] client_device_remove: id 1
[16:45:15.526][4] Found new device with v/p 05ac:12ab at 3-17
[16:45:15.528][4] Found interface 1 with endpoints 04/85 for device 3-17
[16:45:15.528][4] Using wMaxPacketSize=512 for device 3-17
[16:45:15.528][3] Connecting to new device on location 0x30011 as ID 2
[16:45:15.529][3] Connected to v1.0 device 2 on location 0x30011 with serial number xxx
[16:45:15.529][5] client_device_add: id 2, location 0x30011, serial ecxxx

dmesg

[ 4325.281257] usb 3-2: new high-speed USB device number 10 using xhci_hcd
[ 4325.294830] usb 3-2: ep 0x2 - rounding interval to 8 microframes, ep desc says 10 microframes
[ 4325.294838] usb 3-2: ep 0x81 - rounding interval to 8 microframes, ep desc says 10 microframes
[ 4325.296413] usb 3-2: ep 0x2 - rounding interval to 8 microframes, ep desc says 10 microframes
[ 4325.296422] usb 3-2: ep 0x81 - rounding interval to 8 microframes, ep desc says 10 microframes
[ 4331.552668] usb 3-2: USB disconnect, device number 10
[ 4331.965626] usb 3-2: new high-speed USB device number 11 using xhci_hcd
[ 4331.979914] usb 3-2: ep 0x2 - rounding interval to 8 microframes, ep desc says 10 microframes
[ 4331.979919] usb 3-2: ep 0x81 - rounding interval to 8 microframes, ep desc says 10 microframes
[ 4331.981115] usb 3-2: ep 0x2 - rounding interval to 8 microframes, ep desc says 10 microframes
[ 4331.981121] usb 3-2: ep 0x81 - rounding interval to 8 microframes, ep desc says 10 microframes
[ 4351.188064] usb 3-2: USB disconnect, device number 11

I've also tested it with ehci_hcd driver on usb2.0 port, the error is similar.
Would you have any ideas what could be wrong?

*** Error in `usbmuxd': double free or corruption (fasttop): 0x00007f65b0002d50 ***

Dear Guys:
Recently, I encounter with this error in usbmuxd, the environment is we use a program to detect the USB plugin and plugout, which could inspect the device type, if it is Apple device, it will initialize a new class which calling the libimobiledevice library to install app for iOS devices.
when the log show No iOS device plugged in, we restart the usbmuxd to see the log, and found this.

--------------------------------Log follows--------------------------------
[09:11:53.878][3] usbmuxd v1.1.1 starting up
[09:11:53.880][3] Connecting to new device on location 0x3001b as ID 1
[09:11:53.880][3] Initialization complete
[09:11:53.880][3] Connected to v2.0 device 1 on location 0x3001b with serial number a6172659b141365634ba7946d0829197df9050c7
[09:11:56.165][1] Receive from client fd 15 failed: Connection reset by peer
[09:11:58.190][3] Removed device 1 on location 0x3001b
[09:11:58.216][2] Attempted to connect to nonexistent device 1
[09:12:03.564][3] Connecting to new device on location 0x3001c as ID 2
[09:12:03.565][3] Connected to v2.0 device 2 on location 0x3001c with serial number a6172659b141365634ba7946d0829197df9050c7
*** Error in `usbmuxd': double free or corruption (fasttop): 0x00007f65b0002d50 ***

New devices not discovered by udev add on Linux

On the udev add event on Linux, usbmuxd does successfully signal the main usbmuxd process to check for new devices, and usb_discover is called, but usb_discover appears to be called too soon, and libusb does not return it in the list of devices. I am resorting to running in polling mode instead of udev mode.

usbmuxd depends 2 local function of libimobiledevice.

Dear,

I found the latest usbmuxd depends 2 local function (I think)of libimobiledevice.
Could you fix header files of libimobiledevice, or move implementations of 2 local function to appropriate library (ex. libplist)?

  1. Theare are not implementations of 2 functions in usbmuxd,
    - plist_read_from_filename
    - plist_write_to_filename
    but src/util.h in usbmuxd has declared them.
  2. There are implementations of 2 functions in libmobiledevice,
    but they are not exported.

I suppose it is correct that all plist_* functions are provided from libplist library.

FYR:
This topic are commented in Debian developer ML.Then I feed back to you.
( http://lists.alioth.debian.org/pipermail/pkg-gtkpod-devel/2014-May/002954.html )

Regards,
Takahide Nojima

unable to compile due to circular dependencies

the latest HEAD fails to compile with the following error:

checking for libimobiledevice... no
configure: error: preflight worker support requested but libimobiledevice could not befound

In turn, I'm unable to compile libimobiledevice-1.1.6:

checking for libusbmuxd... no
configure: error: Package requirements (libusbmuxd >= 1.0.9) were not met:
Requested 'libusbmuxd >= 1.0.9' but version of libusbmuxd is 1.0.8

please release a stable version

Many distro refuses to support an unreleased software.
The latest release of usbmuxd was 2 years ago and it doesn't work with ios7.

Please release it at some point

Cheksum mismatch for usb

Hello,

Sorry, i've a problem with the install of usbmuxd,

Check that :

--->  Verifying checksums for usbmuxd
Error: Checksum (md5) mismatch for usbmuxd-1.0.7.tar.bz2
Error: Checksum (sha1) mismatch for usbmuxd-1.0.7.tar.bz2
Error: Checksum (rmd160) mismatch for usbmuxd-1.0.7.tar.bz2
Error: org.macports.checksum for port usbmuxd returned: Unable to verify file checksums
Please see the log file for port usbmuxd for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_usbmuxd/usbmuxd/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port usbmuxd failed

Do you have a solution for this problem ?

Thanks for advance, :)

Mark

iphone 5c, 5s IOS8 disconnect

When trying to copy files from iphone 5c,5s the device disconnects and only the first few images are copied.
Here is the info from journalctl
Apr 25 16:47:23 djara usbmuxd[28888]: [1] RX transfer overflow for device 4-11
Apr 25 16:47:23 djara usbmuxd[28888]: [3] Removed device 7 on location 0x4000b
Apr 25 16:47:23 djara org.gtk.vfs.Daemon[2024]: Shutting down AFC backend for device uuid 19ef6688ce17b41f377c4b1a0551f8cbf7f66e7c
Apr 25 16:47:23 djara org.gtk.Private.AfcVolumeMonitor[2024]: removing volume for device uuid '19ef6688ce17b41f377c4b1a0551f8cbf7f66e7c'

Fedora 21 3.19.4-200.fc21.x86_64
usbmuxd 1.1.1
libimobiledevice-1.1.7-1.fc21.x86_64

usbmuxd does not work on macOS Sierra (10.12.5)

I build usbmuxd on macOS Sierra (10.12.5), everything is fine, but when I connect my iphone 7(iOS 10.2.1) it falls into neverending loop
writing such logs:

[08:32:55.406][3] usbmuxd v1.1.1 starting up
[08:32:55.407][4] Creating socket
[08:32:55.407][3] Successfully dropped privileges to 'hj'
[08:32:55.407][4] Initializing USB
[08:32:55.413][4] Registering for libusb hotplug events
[08:32:55.414][4] 0 devices detected
[08:32:55.414][3] Initialization complete
[08:33:10.215][4] New client on fd 7
[08:33:10.217][4] Client 7 connection closed
[08:33:10.217][4] Disconnecting client fd 7
[08:33:15.398][4] New client on fd 7
[08:33:15.398][2] Attempted to connect to nonexistent device 2
[08:33:15.398][4] Client 7 connection closed
[08:33:15.398][4] Disconnecting client fd 7
[08:33:15.399][4] New client on fd 7
[08:33:15.399][4] Client 7 connection closed
[08:33:15.399][4] Disconnecting client fd 7
[08:33:15.402][4] New client on fd 7
[08:33:15.402][2] Attempted to connect to nonexistent device 2
[08:33:15.402][4] Client 7 connection closed
[08:33:15.402][4] Disconnecting client fd 7

only one device discovers on Arch Linux

Hello guys,
i tried to restore 2 iphones on arch linux but usbmuxd detects only one device which is plugged in first, and rest of the devices are ignored .. idevice_id -l also list single device which is connected first.

i tried to figure out it might be some signaling issue but its not..
actually,
here
at line no 204 ppoll doesn't return -1 second time so maybe thats why it fails
cnt = ppoll(pollfds.fds, pollfds.count, &tspec, &empty_sigset);
usbmuxd_log(LL_FLOOD, "poll() returned %d", cnt);
if(cnt == -1) {
}

are those libraries tested on arch linux ??
any help appreciated
Thanks

usbmuxd error on iOS 11

01:56:55 lockdown.c:675 lockdownd_client_new(): device udid: <udid>
01:56:55 lockdown.c:405 lockdownd_query_type(): called
01:56:55 property_list_service.c:128 internal_plist_send(): sending 284 bytes
01:56:55 service.c:140 service_send(): sending 4 bytes
01:56:55 service.c:140 service_send(): sending 284 bytes
01:56:55 property_list_service.c:133 internal_plist_send(): sent 284 bytes
01:56:55 property_list_service.c:134 internal_plist_send(): printing 284 bytes plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>idevicepair</string>
	<key>Request</key>
	<string>QueryType</string>
</dict>
</plist>
01:56:55 property_list_service.c:193 internal_plist_receive_timeout(): initial read=4
01:56:55 property_list_service.c:202 internal_plist_receive_timeout(): 297 bytes following
01:56:55 property_list_service.c:215 internal_plist_receive_timeout(): received 297 bytes
01:56:55 property_list_service.c:241 internal_plist_receive_timeout(): printing 297 bytes plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Request</key>
	<string>QueryType</string>
	<key>Type</key>
	<string>com.apple.mobile.lockdown</string>
</dict>
</plist>
01:56:55 lockdown.c:421 lockdownd_query_type(): success with type com.apple.mobile.lockdown
01:56:55 property_list_service.c:128 internal_plist_send(): sending 4924 bytes
01:56:55 service.c:140 service_send(): sending 4 bytes
01:56:55 service.c:140 service_send(): sending 4924 bytes
01:56:55 property_list_service.c:133 internal_plist_send(): sent 4924 bytes
01:56:55 property_list_service.c:134 internal_plist_send(): printing 4924 bytes plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>idevicepair</string>
	<key>PairRecord</key>
	<dict>
		<key>DeviceCertificate</key>
		<data>
		*KEY*
		</data>
		<key>HostCertificate</key>
		<data>
		*KEY*
		</data>
		<key>RootCertificate</key>
		<data>
		*KEY*
		</data>
		<key>SystemBUID</key>
		<string>...</string>
		<key>HostID</key>
		<string>...</string>
		<key>EscrowBag</key>
		<data>
		*KEY*
		</data>
		<key>WiFiMACAddress</key>
		<string>...</string>
	</dict>
	<key>Request</key>
	<string>ValidatePair</string>
	<key>ProtocolVersion</key>
	<string>2</string>
</dict>
</plist>
01:56:55 idevice.c:399 internal_connection_receive_timeout(): ERROR: usbmuxd_recv_timeout returned -11 (Success)
01:56:55 service.c:163 service_receive_with_timeout(): could not read data
01:56:55 property_list_service.c:193 internal_plist_receive_timeout(): initial read=0
01:56:55 property_list_service.c:195 internal_plist_receive_timeout(): initial read failed!
ERROR: Device <udid> returned unhandled error code -8

Maybe something has been changed in the protocol?
I'm using Debian 9 and I'm using the latest version of libimobiledevice and usbmuxd.
Before updating to iOS 11, I hadn't any trouble with iOS 10.

iPhone is not recognized after upgrade to Fedora 20

After upgrading to Fedora 20 the iphone was no longer found when plugin. In log:

янв 21 15:24:49 mk-hp usbmuxd[5719]: [15:24:49.938][3] usbmuxd v1.0.9 starting up
янв 21 15:24:49 mk-hp usbmuxd[5719]: [15:24:49.939][3] Successfully dropped privileges to 'usbmuxd'
янв 21 15:24:49 mk-hp usbmuxd[5719]: [15:24:49.942][3] Could not get old configuration descriptor for device 2-4: -5
янв 21 15:24:49 mk-hp usbmuxd[5719]: [15:24:49.979][3] Connecting to new device on location 0x20004 as ID 1
янв 21 15:24:49 mk-hp usbmuxd[5719]: [15:24:49.979][3] Initialization complete
янв 21 15:24:49 mk-hp usbmuxd[5719]: [15:24:49.980][3] Connected to v1.0 device 1 on location 0x20004 with serial number 18c6e131038e60b16a515187ec901304eca6edd4
янв 21 15:24:50 mk-hp usbmuxd[5719]: [15:24:50.044][1] preflight_worker_handle_device_add: Could not get ProductVersion string from device 18c6e131038e60b16a515187ec901304eca6e

segfault on startup when approximately10 or more iOS devices connected

We're using libuxbmuxd on a hub with 27 iOS devices connected. All devices are running iOS 8.4

I am testing master/HEAD from the git repos of libplist, libuxbmuxd, usbmuxd, libimobiledevice. Target is Debian Wheezy on ARM. I checked out the source with git clone and then configured, built, and installed as per the instructions.

When more than approximately 10 devices are plugged in, starting usbmuxd crashes immediately. This happens whether using foreground or background mode. Here is the command line session. (I will attach the logs to the ticket.)

With fewer than ~10 devices it starts OK, and usually allows the devices to be plugged in one at a time without crashing.

root@ts7400-4a3ffe:~# usbmuxd -U root -vv -f 2> crash2.txt
Segmentation fault
root@ts7400-4a3ffe:~# usbmuxd -U root -vv -f 2> crash3.txt
Segmentation fault
root@ts7400-4a3ffe:~# usbmuxd -U root -vv -f 2> crash4.txt
Segmentation fault
root@ts7400-4a3ffe:~# usbmuxd -U root -vv -f 2> crash5.txt
Segmentation fault
root@ts7400-4a3ffe:~# usbmuxd -U root -vv -f 2> crash6.txt
Segmentation fault
root@ts7400-4a3ffe:~# usbmuxd -U root -vv -f 2> crash7.txt
Segmentation fault
root@ts7400-4a3ffe:~# usbmuxd -U root -vv -f 2> crash8.txt
glibc detected *** usbmuxd: free(): invalid pointer: 0x0028bdc0 ***
Aborted
root@ts7400-4a3ffe:~# usbmuxd -U root -vv -f 2> crash9.txt
Segmentation fault
root@ts7400-4a3ffe:~# usbmuxd -U root -vv -f 2> crash10.txt
Segmentation fault
root@ts7400-4a3ffe:~# usbmuxd -U root -vv -f 2> crash11.txt
Segmentation fault

The log files generated by the session reported above (with --vv flag) can be downloaded here:
http://rossbencina.com/static/junk/usbmuxd_crashlogs_20150730.tar.gz

This worked without crashes with libusbmuxd 1.0.7. It works with occasional crashes with the latest "official" tarballs on the website (libplist-1.12.tar.bz2 libusbmuxd-1.0.10.tar.bz2 usbmuxd-1.0.9.tar.bz2 libimobiledevice-1.1.7.tar.bz2).

Please let me know:

  • Should we be using something other than master/HEAD for the latest code.
  • Where to start looking to debug this

We would like to use the version that is most compatible with iOS 8.4.

usbmuxd core dumps

Hi,

given the "Trust" issue and latest versions not quite working yet either, I updated to all-git versions in my FreeBSD system. Running against an iPad mini usbmuxd silently ends; running it as -f -vvv shows this at the end:

....
[13:18:25.228][5] reading key HostID from config_file /var/lib/lockdown/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.plist
[13:18:25.228][6] update_connection: sendable 49124, events 1, flags 1
[13:18:25.228][4] New client on fd 12
[13:18:25.228][6] TX callback dev 1-2 len 28 -> 28 status 0
[13:18:25.228][5] Client command in fd 12 len 501 ver 1 msg 8 tag 2
[13:18:25.228][5] reading key SystemBUID from config_file /var/lib/lockdown/SystemConfiguration.plist
[13:18:25.228][5] got SystemBUID xxxxxxxxxxxxxxxxxxxxxxxxxx
[13:18:25.228][5] using xxxxxx-xxxxxx-.... as SystemBUID
[13:18:25.229][5] send_pkt fd 12 tag 2 msg 8 payload_length 260
[13:18:25.229][6] client_process in CONNECTED state
[13:18:25.229][6] device_client_process (1)
[13:18:25.229][6] client_read fd 10 buf 0x28d59000 len 49124
[13:18:25.229][5] [OUT] dev=1 sport=1 dport=62078 seq=285 ack=302 flags=0x10 window=131072[512] len=439
[13:18:25.229][6] send_packet(1, 0x6, 0xbfbfe9d8, 0x28d59000, 439)
[13:18:25.229][6] update_connection: sendable 49124, events 1, flags 0
[13:18:25.229][6] TX callback dev 1-2 len 467 -> 467 status 0
[13:18:25.233][6] RX callback dev 1-2 len 32 status 0
[13:18:25.233][6] Mux data input for device 0x28c0f130: 0x28c47000 len 32
[13:18:25.233][5] [IN] dev=1 sport=62078 dport=1 seq=302 ack=724 flags=0x10 window=131072[512] len=4
[13:18:25.233][6] update_connection: sendable 49124, events 5, flags 0
[13:18:25.233][5] [OUT] dev=1 sport=1 dport=62078 seq=724 ack=302 flags=0x10 window=131072[512] len=0
[13:18:25.233][6] send_packet(1, 0x6, 0xbfbfe8f8, 0x0, 0)
[13:18:25.233][6] update_connection: sendable 49124, events 5, flags 0
[13:18:25.233][6] TX callback dev 1-2 len 28 -> 28 status 0
[13:18:25.233][6] RX callback dev 1-2 len 382 status 0
[13:18:25.233][6] Mux data input for device 0x28c0f130: 0x28c4b000 len 382
[13:18:25.233][5] [IN] dev=1 sport=62078 dport=1 seq=306 ack=724 flags=0x10 window=131072[512] len=354
[13:18:25.233][6] update_connection: sendable 49124, events 5, flags 0
[13:18:25.233][5] [OUT] dev=1 sport=1 dport=62078 seq=724 ack=302 flags=0x10 window=131072[512] len=0
[13:18:25.233][6] send_packet(1, 0x6, 0xbfbfe8f8, 0x0, 0)
[13:18:25.233][6] update_connection: sendable 49124, events 5, flags 0
[13:18:25.233][6] client_process in CONNECTED state
[13:18:25.233][6] device_client_process (4)
[13:18:25.233][6] client_write fd 10 buf 0x28d69000 len 358
[13:18:25.234][6] update_connection: sendable 49124, events 1, flags 1
[13:18:25.234][4] New client on fd 14
[13:18:25.234][5] Client command in fd 14 len 591 ver 1 msg 8 tag 3
[13:18:25.234][5] send_pkt fd 14 tag 3 msg 8 payload_length 12816
[13:18:25.234][6] TX callback dev 1-2 len 28 -> 28 status 0
Segmentation fault (core dumped)

Does this ring a bell? Is there anything I can help to debug this?

usbmuxd segfaults when new device connects with other devices are present

Description:
usbmuxd crashes with high probability when new device gets connected with other present

Way to reproduce reliably:
Connect 4 to 7 idevices to usb hub and connect hub to PC.

Additional information:
Related to #39 most likely, as I see the same output in syslog.

gdb attach output at the moment of crash:

[New Thread 0x7f8bad7fa700 (LWP 26075)]
[New Thread 0x7f8bacff9700 (LWP 26081)]
[New Thread 0x7f8b97fff700 (LWP 26082)]
[New Thread 0x7f8b977fe700 (LWP 26083)]
[New Thread 0x7f8b96ffd700 (LWP 26084)]
[New Thread 0x7f8b967fc700 (LWP 26085)]
[Thread 0x7f8b96ffd700 (LWP 26084) exited]
[Thread 0x7f8bad7fa700 (LWP 26075) exited]
[New Thread 0x7f8bad7fa700 (LWP 26086)]
[New Thread 0x7f8b96ffd700 (LWP 26087)]

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7f8bacff9700 (LWP 26081)]
0x00007f8bb762c107 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb)
Continuing.
[Thread 0x7f8bad7fa700 (LWP 26086) exited]
[Thread 0x7f8b96ffd700 (LWP 26087) exited]
[Thread 0x7f8b977fe700 (LWP 26083) exited]
[Thread 0x7f8b97fff700 (LWP 26082) exited]
[Thread 0x7f8bacff9700 (LWP 26081) exited]
[Thread 0x7f8bb549c700 (LWP 24282) exited]
[Thread 0x7f8bb4c9b700 (LWP 24286) exited]
[Thread 0x7f8baffff700 (LWP 24287) exited]
[Thread 0x7f8baf7fe700 (LWP 24289) exited]
[Thread 0x7f8baeffd700 (LWP 24292) exited]
[Thread 0x7f8bae7fc700 (LWP 24297) exited]
[Thread 0x7f8badffb700 (LWP 24298) exited]
[Thread 0x7f8bb840c700 (LWP 24280) exited]

"Trust This Computer?" prompt shows when connecting multiple iOS devices.

Hi, I've been getting some strange behavior, and wondering if I could get any insight.

I am testing using an iPhone iOS 8.0 and 9.0 device on Linux. I've built the following packages from HEAD as well: libimobiledevice, ideviceinstaller, libusbmuxd, libplist, usbmuxd.

Both iOS devices have previously been plugged in and paired with the host via idevicepair pair. I can see the .plist files for each device in /var/lib/lockdown. The lockdown folder is owned by usbmux. For good measure, I've also chmod 777 -R on the folder. Each device works perfectly fine when plugged in separately. However, I encounter issues when plugging them both in at the same time.

Senario 1:

  1. No devices plugged in; usbmuxd is not running.
  2. Plug Device A in.
  3. Plug Device B in.
  4. Trust dialogue appears on Device B. Regardless of this, both devices respond properly to idevicedate (even without accepting the dialogue).

Scenario 2:

  1. No devices plugged in; usbmuxd is not running.
  2. Start usbmuxd manually (sudo usbmuxd -v --user usbmux --foreground)
  3. Plug Device A in.
  4. Plug Device B in.
  5. No trust dialogues appear on either device, and both devices respond properly to idevicedate

So essentially, I need to manually start usbmuxd, otherwise a trust dialogue appears on the second device. However, I don't want to manually start usbmuxd.

I don't know if this is relevant, but if I start usbmuxd manually without sudo, I get:

[23:16:48.155][3] usbmuxd v1.1.1 starting up
[23:16:48.155][0] Could not open lockfile

Any help is appreciated. Thanks!

ACK packets sometimes sent twice

While testing, I've noticed that sometimes ACK packets were sent twice in a row. After going through the code, I think I've found the reason:
In device_tcp_input, when data is received from the device on a TCP connection, an ACK is sent (a call to send_tcp_ack was added in a recent commit). But, since the connection's tx_ack is only increased in device_client_process (after the data is actually sent to the client), the ACK doesn't ACK the data received. So in my case, another ACK was sent in the next iteration because of a timeout (after the data was sent to the client).
I think it would be better to send the ACK after increasing tx_ack, either in device_tcp_input or in device_client_process. What do you think?

make fails for usbmuxd

On Raspberry Pi, running rasbian.
After running ./autogen.sh

root@raspberrypi:/iphone_libs/usbmuxd# make
make all-recursive
make[1]: Entering directory '/iphone_libs/usbmuxd'
Making all in src
make[2]: Entering directory '/iphone_libs/usbmuxd/src'
CCLD usbmuxd
/usr/bin/ld: usbmuxd-utils.o: undefined reference to symbol 'clock_gettime@@GLIBC_2.4'
//lib/arm-linux-gnueabihf/librt.so.1: error adding symbols: DSO missing from command line
collect2: ld returned 1 exit status
Makefile:349: recipe for target 'usbmuxd' failed
make[2]: *** [usbmuxd] Error 1
make[2]: Leaving directory '/iphone_libs/usbmuxd/src'
Makefile:353: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/iphone_libs/usbmuxd'
Makefile:284: recipe for target 'all' failed
make: *** [all] Error 2
root@raspberrypi:/iphone_libs/usbmuxd#

help please?

Client command received in the wrong state

usbmuxd keeps throwing this error message and restarts after 1024 seconds

Client 143 command received in the wrong state
Client 144 command received in the wrong state
Client 145 command received in the wrong state

After enabling verbose, it shows this error message

Sep 29 12:43:42 foo usbmuxd[7516]: [12:43:42.858][4] New client on fd 753
Sep 29 12:43:42 foo usbmuxd[7516]: [12:43:42.858][5] Client command in fd 753 len 16 ver 0 msg 3 tag 1
Sep 29 12:43:42 foo usbmuxd[7516]: [12:43:42.858][5] send_pkt fd 753 tag 1 msg 1 payload_length 4
Sep 29 12:43:42 foo usbmuxd[7516]: [12:43:42.858][5] Client 753 now LISTENING
Sep 29 12:43:42 foo usbmuxd[7516]: [12:43:42.858][5] send_pkt fd 753 tag 0 msg 4 payload_length 268
Sep 29 12:43:42 foo usbmuxd[7516]: [12:43:42.858][5] send_pkt fd 753 tag 0 msg 4 payload_length 268
Sep 29 12:43:42 foo usbmuxd[7516]: [12:43:42.860][4] New client on fd 754
Sep 29 12:43:42 foo usbmuxd[7516]: [12:43:42.861][5] Client command in fd 754 len 16 ver 0 msg 3 tag 1
Sep 29 12:43:42 foo usbmuxd[7516]: [12:43:42.861][5] send_pkt fd 754 tag 1 msg 1 payload_length 4
Sep 29 12:43:42 foo usbmuxd[7516]: [12:43:42.861][5] Client 754 now LISTENING
Sep 29 12:43:42 foo usbmuxd[7516]: [12:43:42.861][5] send_pkt fd 754 tag 0 msg 4 payload_length 268
Sep 29 12:43:42 foo usbmuxd[7516]: [12:43:42.861][5] send_pkt fd 754 tag 0 msg 4 payload_length 268
Sep 29 12:43:42 foo usbmuxd[7516]: [12:43:42.863][5] Client command in fd 754 len 24 ver 0 msg 2 tag 2
Sep 29 12:43:42 foo usbmuxd[7516]: [12:43:42.863][1] Client 754 command received in the wrong state
Sep 29 12:43:42 foo usbmuxd[7516]: [12:43:42.863][5] send_pkt fd 754 tag 2 msg 1 payload_length 4
Sep 29 12:43:42 foo usbmuxd[7516]: [12:43:42.863][4] Disconnecting client fd 754
Sep 29 12:43:43 foo usbmuxd[7516]: [12:43:43.157][6] usb_discover: scanning 15 devices

Static build fails

I have configured latest master code as follows:

$ ./configure --enable-static --disable-shared

Final configuration:

Configuration for usbmuxd 1.1.1:
-------------------------------------------

  install prefix ............: /usr/local
  preflight worker support ..: yes
  activation method .........: systemd
  systemd unit directory ....: /lib/systemd/system
  udev rules directory ......: /lib/udev/rules.d
  compiler ..................: gcc

Then make fails with:

# make
/usr/bin/make  all-recursive
make[1]: Entering directory '/root/src/usbmuxd-master'
Making all in src
make[2]: Entering directory '/root/src/usbmuxd-master/src'
  CC       usbmuxd-client.o
  CC       usbmuxd-device.o
  CC       usbmuxd-preflight.o
  CC       usbmuxd-log.o
  CC       usbmuxd-usb.o
  CC       usbmuxd-utils.o
  CC       usbmuxd-conf.o
  CC       usbmuxd-main.o
  CCLD     usbmuxd
/usr/local/lib/libimobiledevice.a(utils.o): In function `string_concat':
/root/src/libimobiledevice-master/common/utils.c:71: multiple definition of `string_concat'
usbmuxd-utils.o:/root/src/usbmuxd-master/src/utils.c:171: first defined here
/usr/local/lib/libimobiledevice.a(utils.o): In function `buffer_read_from_filename':
/root/src/libimobiledevice-master/common/utils.c:204: multiple definition of `buffer_read_from_filename'
usbmuxd-utils.o:/root/src/usbmuxd-master/src/utils.c:215: first defined here
/usr/local/lib/libimobiledevice.a(utils.o): In function `buffer_write_to_filename':
/root/src/libimobiledevice-master/common/utils.c:235: multiple definition of `buffer_write_to_filename'
usbmuxd-utils.o:/root/src/usbmuxd-master/src/utils.c:245: first defined here
/usr/local/lib/libimobiledevice.a(utils.o): In function `plist_read_from_filename':
/root/src/libimobiledevice-master/common/utils.c:246: multiple definition of `plist_read_from_filename'
usbmuxd-utils.o:/root/src/usbmuxd-master/src/utils.c:256: first defined here
/usr/local/lib/libimobiledevice.a(utils.o): In function `plist_write_to_filename':
/root/src/libimobiledevice-master/common/utils.c:271: multiple definition of `plist_write_to_filename'
usbmuxd-utils.o:/root/src/usbmuxd-master/src/utils.c:281: first defined here
collect2: error: ld returned 1 exit status
Makefile:407: recipe for target 'usbmuxd' failed
make[2]: *** [usbmuxd] Error 1
make[2]: Leaving directory '/root/src/usbmuxd-master/src'
Makefile:411: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/src/usbmuxd-master'
Makefile:342: recipe for target 'all' failed
make: *** [all] Error 2

I'm building in armhf Debian Jessie chrooted. Both libplist, libimobiledevice and libuxmuxd are built as static with --disable-shared and --enable-static flags. I have CC='gcc -static' in environment.

Device not recognized

This happens when starting the service with an iPhone in recovery mode connected:

usbmuxd.service - iOS USB Muxer
   Loaded: loaded (/usr/lib/systemd/system/usbmuxd.service; static)
   Active: active (running) since Mon 2014-04-21 19:19:00 ART; 2s ago
 Main PID: 2660 (usbmuxd)
   CGroup: /system.slice/usbmuxd.service
           └─2660 /sbin/usbmuxd -v -v -u -U usbmuxd

Apr 21 19:19:00 sebita systemd[1]: Started iOS USB Muxer.
Apr 21 19:19:00 sebita usbmuxd[2660]: [3] usbmuxd v1.0.9 starting up
Apr 21 19:19:00 sebita usbmuxd[2660]: [4] Creating socket
Apr 21 19:19:00 sebita usbmuxd[2660]: [3] Successfully dropped privileges to 'usbmuxd'
Apr 21 19:19:00 sebita usbmuxd[2660]: [4] Initializing USB
Apr 21 19:19:00 sebita usbmuxd[2660]: [4] 0 devices detected
Apr 21 19:19:00 sebita usbmuxd[2660]: [3] Initialization complete
Apr 21 19:19:00 sebita usbmuxd[2660]: [4] New client on fd 14

Zero devices detected.
I (force) erased libusbx from official repos and installed libusb from github directly. Same happens. Official repo version says 1.0.18
Fedora 20.

problem in setup

As mentioned in setup instructions, i have tried to running "./autogen.sh", but i get following error as:

./configure: line 15332: syntax error near unexpected token libusb,' ./configure: line 15332:PKG_CHECK_MODULES(libusb, libusb-1.0 >= 1.0.3)'

Circular reference error with libimobiledevice while building

Hi, I downloaded git repositories for ifuse, libusbmuxd and libimobiledevice.
ifuse built successfully.

But for both libusbmuxd and libimobiledevice, the autogen.sh fails, complaining the other bit is not there. So you cannot run autogen.sh for either libusbmuxd or libimobiledevice.

Please can someone guide me how to build these? Thanks.

OS: Ubuntu 16.04 64 bit

Timeouts should not be calculated using gettimeofday()

Timeouts in usbmuxd are calculated using gettimeofday(). This can cause invalid timeout durations to be calculated if the time is changed.

Our fix was to use this function instead of gettimeofday():

 void gettickcount(struct timeval * tv)
 {
    struct timespec ts;
    if(0 == clock_gettime(CLOCK_MONOTONIC, &ts)) {
        tv->tv_sec = ts.tv_sec;
        tv->tv_usec = ts.tv_nsec / 1000;
    }
    else {
        gettimeofday(tv, NULL);
    }
}

Windows: libusb_get_pollfds failed

I've built and run usbmuxd with cygwin.

$ ./usbmuxd -f
[06:35:05.513][3] usbmuxd v1.1.0 starting up
[06:35:05.633][3] Initialization complete
[06:35:05.633][1] libusb_get_pollfds failed
[06:35:06.755][1] libusb_get_pollfds failed
[06:35:07.866][1] libusb_get_pollfds failed
...

libusb_get_pollfds always returns NULL on Windows and that's ok.

Is there any configuration I missed before building usbmuxd or any of its dependence?

Dependencies I used:
libplist-1.12
libimobiledevice-1.1.7
libusbmuxd-1.0.10

I tried usbmuxd-1.1.0 and the latest from master branch as well.

config.log

Please let me know if I didn't provide something necessary to understand the issue. Thanks.

USBMUX fails to send TCP ACK when bombarded with data

Almost certainly related to #19 I have observed an issue where USBMUXd will fail to send back TCP ACKs when bombarded with data from the iOS device faster than the server application can read from it.

We're able to reproduce this issue 100% of the time when sending 100MB of data, broken down into 4KB chunks. The iOS device will write as fast as it can, up until its output buffer fills up. Examining the code I see two potential issues:

https://github.com/libimobiledevice/usbmuxd/blob/master/src/device.c#L328

If the ib_size is 0, shouldn't we be sending an ACK here?

https://github.com/libimobiledevice/usbmuxd/blob/master/src/device.c#L672

Shouldn't the ACK be the sequence + 1?

could not create Makefile

......
checking whether make supports nested variables... (cached) yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
awk: illegal statement
source line number 165
config.status: error: could not create Makefile

Documentation/Explanation.

I'm interested in knowing how usbmuxd actually does its jobs in terms of low-level details. I see this link has tons of information, https://www.theiphonewiki.com/wiki/Usbmux as well.

Specifically interested in:

When a idevice is plugged in, does the device immediately start trying to make TCP or Unix socket connection attempts to /var/run/usbmuxd? or does usbmuxd first write something to a usb device, with libusb, and what does it write?

Say that such a connection is created, then what happens?

Any explanations are greatly appreciated.

Segmentation fault on latest version

I have everything related built from source, with debug symbols detached (splitdebug feature in Gentoo). I re-built libplist, libusbmuxd, and usbmuxd to make sure everything was synced.

I unlocked the devices and tapped Trust on the dialog. I also deleted the contents of /var/lib/lockdown just in case.

Devices:

  • iPhone 5S on iOS 7.0.6
  • iPad Air on iOS 7.0.6

Tried multiple USB ports. It seems that a NULL pointer (the node argument) is passed in to libplist's plist_get_string_val() function. https://github.com/libimobiledevice/usbmuxd/blob/master/src/client.c#L479

libplist fails on its assertion:
https://github.com/libimobiledevice/libplist/blob/master/src/plist.c#L582

# gdb usbmuxd
GNU gdb (Gentoo 7.6.2 p1) 7.6.2
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /usr/sbin/usbmuxd...Reading symbols from /usr/lib64/debug/usr/sbin/usbmuxd.debug...done.
done.
(gdb) set args --udev -U usbmux -f -vvvvvvvvvvvvvvv
(gdb) r
Starting program: /usr/sbin/usbmuxd --udev -U usbmux -f -vvvvvvvvvvvvvvv
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[02:22:37.361][3] usbmuxd v1.0.9 starting up
[02:22:37.361][4] Creating socket
[02:22:37.361][5] initialized config_dir to /var/lib/lockdown
[02:22:37.380][3] Successfully dropped privileges to 'usbmux'
[02:22:37.380][5] client_init
[02:22:37.380][5] device_init
[02:22:37.380][4] Initializing USB
[02:22:37.380][5] usb_init for linux / libusb 1.0
[New Thread 0x7ffff32c4700 (LWP 19135)]
[02:22:37.386][6] usb_discover: scanning 22 devices
[02:22:37.386][4] Found new device with v/p 05ac:12a8 at 10-7
[02:22:37.386][4] Found interface 1 with endpoints 04/85 for device 10-7
[02:22:37.388][4] Using wMaxPacketSize=512 for device 10-7
[02:22:37.388][3] Connecting to new device on location 0xa0007 as ID 1
[02:22:37.388][6] send_packet(1, 0x0, 0x7fffffffd5f0, (nil), 0)
[02:22:37.388][5] All 3 RX loops started successfully
[02:22:37.388][4] 1 device detected
[02:22:37.388][3] Initialization complete
[02:22:37.388][5] usb polling enable: 0
[02:22:37.388][7] main_loop iteration
[02:22:37.388][7] USB timeout is 100000 ms
[02:22:37.388][7] Device timeout is 100000 ms
[02:22:37.388][7] fd count is 5
[02:22:37.388][7] poll() returned 1
[02:22:37.388][6] TX callback dev 10-7 len 20 -> 20 status 0
[02:22:37.388][7] main_loop iteration
[02:22:37.388][7] USB timeout is 100000 ms
[02:22:37.388][7] Device timeout is 100000 ms
[02:22:37.389][7] fd count is 5
[02:22:37.389][7] poll() returned 1
[02:22:37.389][6] RX callback dev 10-7 len 20 status 0
[02:22:37.389][6] Mux data input for device 0x629ca0: 0x61e530 len 20
[02:22:37.389][3] Connected to v1.0 device 1 on location 0xa0007 with serial number 5748c65d375cd2fd5ad8e130cbf9747f0968f2d2
[New Thread 0x7ffff2ac3700 (LWP 19136)]
[02:22:37.390][7] main_loop iteration
[02:22:37.390][4] preflight_worker_handle_device_add: Starting preflight on device 5748c65d375cd2fd5ad8e130cbf9747f0968f2d2...
[02:22:37.390][7] USB timeout is 100000 ms
[02:22:37.390][7] Device timeout is 100000 ms
[02:22:37.390][7] fd count is 5
[02:22:37.390][7] poll() returned 1
[02:22:37.390][4] New client on fd 19
[02:22:37.390][7] main_loop iteration
[02:22:37.390][7] USB timeout is 100000 ms
[02:22:37.390][7] Device timeout is 100000 ms
[02:22:37.390][7] fd count is 6
[02:22:37.390][7] poll() returned 1
[02:22:37.390][7] main_loop iteration
[02:22:37.390][7] USB timeout is 100000 ms
[02:22:37.390][7] Device timeout is 100000 ms
[02:22:37.390][7] fd count is 6
[02:22:37.390][7] poll() returned 1
[02:22:37.390][5] Client command in fd 19 len 204 ver 1 msg 8 tag 1

Program received signal SIGSEGV, Segmentation fault.
strlen () at ../sysdeps/x86_64/strlen.S:106
106     ../sysdeps/x86_64/strlen.S: No such file or directory.
(gdb) bt
#0  strlen () at ../sysdeps/x86_64/strlen.S:106
#1  0x00007ffff77a0330 in plist_get_string_val (node=0x0, val=val@entry=0x7fffffffd688) at plist.c:586
#2  0x00000000004058b0 in client_command (hdr=0x64e1a0, client=0x6144b0) at client.c:479
#3  process_recv (client=0x6144b0) at client.c:714
#4  client_process (fd=<optimized out>, events=1) at client.c:740
#5  0x0000000000404607 in main_loop (listenfd=8) at main.c:235
#6  main (argc=<optimized out>, argv=<optimized out>) at main.c:642

ListDevice not supported

Hi!
I can't use ideviceinfo nor idevicerestore on an iPhone 3G and an iPad 2. I'm using Fedora 20, usbmuxd.service is running with no issues. ideviceinfo and idevicerestore produce this output on systemd log:

Apr 12 21:00:38 sebita usbmuxd[23035]: [1] Unexpected command 'ListDevices' received!

I stopped usbmuxd.service and started usbmuxd manually with verbose mode on. usbmuxd starts and shows it's listening. Then opened another terminal and tried using ideviceinfo. Same error appeared on usbmuxd terminal session.
idevicerestore puts correctly the phone in RestoreOs mode (Apple logo with progress bar below) but then enters an infinite wait for device ("Attempt x to connect to restore mode device..."). At the same time, another error of ListDevices command appears on systemd log.
libplist 1.11, usbmuxd 1.0.8 from Fedora repos, libusbx 1.0.18.

Segfaulting except when run in foreground

kernel: usbmuxd[13528]: segfault at 8 ip 00007f00e421620a sp 00007fff937fb048 error 4 in libc-2.19.so[7f00e...0+1b0000]

From system journal after plugging an ios7 Iphone4S It had trused before and things seemed to work long enought for it to connect.
If the program is run in the forground it does not segfault and appears to function normally

Could not get lockdownd type from device, lockdown error -3

I am unable to mount my iphone 6+, iOS 9 on Ubuntu 14.04

usbmuxd outputs:

[07:36:28.003][3] usbmuxd v1.1.1 starting up
[07:36:28.005][3] Initialization complete
[07:36:57.999][3] Connecting to new device on location 0x30006 as ID 1
[07:36:57.999][3] Connected to v2.0 device 1 on location 0x30006 with serial number f1e1598b8da7d0e594dc42dacce57f7d66e56e1d
[07:37:08.007][1] preflight_worker_handle_device_add: ERROR: Could not get lockdownd type from device f1e1598b8da7d0e594dc42dacce57f7d66e56e1d, lockdown error -3

idevicepair pair

No device found, is it plugged in?

Not sure what is happening here, any help is appreciated.

can't compile with libplist 1.11

i can't compile from source on debian testing. installed sid versions of all dependencies using apt. i'm showing libusbmuxd 1.0.9 and libplist 1.11. i did git clone on the repo to download usbmuxd source, autogen, then at make i get the following error:

usbmuxd-conf.o: In function internal_get_value': /opt/usbmuxd/src/conf.c:289: undefined reference toplist_read_from_filename'

any hints? been hanging out in irc trying to get help but no luck.i need the newest usbmuxd to run libimobiledevice 1.1.6. only usbmuxd 1.0.8 is available in the debian repos.

thanks in advance

tethering not working any more

Hello,

I have been using happily for some time the iphone tethering. At some point recently (it worked apparently on 2014-11-22, now on 2014-11-26 it does not anymore), I got the following behavior :

  • No more tethering (enabled on ios of course)
  • ios says it has connection working (flashing alert message on phone)
  • gnome/network-manager reports cable as unplugged in USB device
  • journalctl reports things such as following :
nov. 26 16:04:07 fiona kernel: usb 3-2: New USB device found, idVendor=05ac, idProduct=1294
nov. 26 16:04:07 fiona kernel: usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
nov. 26 16:04:07 fiona kernel: usb 3-2: Product: iPhone
nov. 26 16:04:07 fiona kernel: usb 3-2: Manufacturer: Apple Inc.
nov. 26 16:04:07 fiona kernel: usb 3-2: SerialNumber: 6f66ec7d5b4d31d7089cd29be72b483827cd95c8
nov. 26 16:04:07 fiona kernel: usb 3-2: ep 0x2 - rounding interval to 8 microframes, ep desc says 10 microframes
nov. 26 16:04:07 fiona kernel: usb 3-2: ep 0x81 - rounding interval to 8 microframes, ep desc says 10 microframes
nov. 26 16:04:07 fiona mtp-probe[3457]: checking bus 3, device 3: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2"
nov. 26 16:04:07 fiona mtp-probe[3457]: bus: 3, device: 3 was not an MTP device
nov. 26 16:04:07 fiona colord[604]: Device added: sysfs-Apple_Inc.-iPhone
nov. 26 16:04:07 fiona org.gtk.Private.GPhoto2VolumeMonitor[1155]: (process:1298): GVFS-GPhoto2-WARNING **: device (null) has no BUSNUM property, ignoring
nov. 26 16:04:07 fiona colord[604]: Device added: sysfs-(null)
nov. 26 16:04:07 fiona colord[604]: device removed: sysfs-(null)
nov. 26 16:04:07 fiona gnome-session[1111]: (gnome-settings-daemon:1176): color-plugin-WARNING **: failed to connect to device: Failed to connect to missing device /org/freedesktop/ColorManager/devices/sysfs__null_
nov. 26 16:04:07 fiona gnome-session[1111]: (gnome-settings-daemon:1176): color-plugin-WARNING **: failed to connect to device: Failed to connect to missing device /org/freedesktop/ColorManager/devices/sysfs__null_
nov. 26 16:04:07 fiona usbmuxd[3468]: [16:04:07.788][3] usbmuxd v1.1.0 starting up
nov. 26 16:04:07 fiona usbmuxd[3468]: [16:04:07.789][3] Successfully dropped privileges to 'usbmux'
nov. 26 16:04:07 fiona usbmuxd[3468]: [16:04:07.791][3] Could not get old configuration descriptor for device 3-3: -5
nov. 26 16:04:07 fiona org.gtk.Private.GPhoto2VolumeMonitor[1155]: (process:1298): GVFS-GPhoto2-WARNING **: device (null) has no BUSNUM property, ignoring
nov. 26 16:04:07 fiona colord[604]: Device added: sysfs-(null)
nov. 26 16:04:07 fiona kernel: usb 3-2: ep 0x2 - rounding interval to 8 microframes, ep desc says 10 microframes
nov. 26 16:04:07 fiona kernel: usb 3-2: ep 0x81 - rounding interval to 8 microframes, ep desc says 10 microframes
nov. 26 16:04:07 fiona org.gtk.Private.GPhoto2VolumeMonitor[1155]: (process:1298): GVFS-GPhoto2-WARNING **: device (null) has no BUSNUM property, ignoring
nov. 26 16:04:07 fiona colord[604]: (colord:604): Cd-WARNING **: CdMain: failed to emit DeviceAdded: failed to register object: Un objet est déjà exporté pour l'interface « org.freedesktop.ColorManager.Device » en « /org/freedesktop/ColorManager/devices/sysfs__null_ »
nov. 26 16:04:07 fiona org.gtk.Private.GPhoto2VolumeMonitor[1155]: (process:1298): GVFS-GPhoto2-WARNING **: device (null) has no BUSNUM property, ignoring
nov. 26 16:04:07 fiona colord[604]: (colord:604): Cd-WARNING **: CdMain: failed to emit DeviceAdded: failed to register object: Un objet est déjà exporté pour l'interface « org.freedesktop.ColorManager.Device » en « /org/freedesktop/ColorManager/devices/sysfs__null_ »
nov. 26 16:04:07 fiona usbmuxd[3468]: [16:04:07.933][3] Connecting to new device on location 0x30003 as ID 1
nov. 26 16:04:07 fiona usbmuxd[3468]: [16:04:07.933][3] Initialization complete
nov. 26 16:04:07 fiona usbmuxd[3468]: [16:04:07.933][3] Enabled exit on SIGUSR1 if no devices are attached. Start a new instance with "--exit" to trigger.
nov. 26 16:04:07 fiona usbmuxd[3468]: [16:04:07.934][3] Connected to v2.0 device 1 on location 0x30003 with serial number 6f66ec7d5b4d31d7089cd29be72b483827cd95c8
nov. 26 16:04:07 fiona kernel: ipheth 3-2:4.2: Apple iPhone USB Ethernet device attached
nov. 26 16:04:07 fiona NetworkManager[550]: <info> (eth1): carrier is OFF
nov. 26 16:04:07 fiona NetworkManager[550]: <info> (eth1): new Ethernet device (driver: 'ipheth' ifindex: 5)
nov. 26 16:04:07 fiona NetworkManager[550]: <info> (eth1): exported as /org/freedesktop/NetworkManager/Devices/4
nov. 26 16:04:07 fiona NetworkManager[550]: <info> (eth1): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
nov. 26 16:04:07 fiona NetworkManager[550]: <info> (eth1): preparing device
nov. 26 16:04:07 fiona kernel: IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
nov. 26 16:04:07 fiona NetworkManager[550]: <info> devices added (path: /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:4.2/net/eth1, iface: eth1)
nov. 26 16:04:07 fiona NetworkManager[550]: <info> device added (path: /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:4.2/net/eth1, iface: eth1): no ifupdown configuration found.
nov. 26 16:04:08 fiona org.gtk.Private.AfcVolumeMonitor[1155]: creating volume for device uuid '6f66ec7d5b4d31d7089cd29be72b483827cd95c8'
nov. 26 16:04:08 fiona gnome-session[1111]: (tracker-miner-fs:1314): Tracker-WARNING **: Could not find parent node for URI:'afc://6f66ec7d5b4d31d7089cd29be72b483827cd95c8/'
nov. 26 16:04:08 fiona gnome-session[1111]: (tracker-miner-fs:1314): Tracker-WARNING **: NOTE: URI theme may be outside scheme expected, for example, expecting 'file://' when given 'http://' prefix.
nov. 26 16:04:08 fiona gnome-session[1111]: (tracker-miner-fs:1314): Tracker-CRITICAL **: Could not set mount point in database 'urn:nepomuk:datasource:6f66ec7d5b4d31d7089cd29be72b483827cd95c8', GDBus.Error:org.freedesktop.Tracker1.SparqlError.Internal: UNIQUE constraint failed: nie:DataObject.nie:url (strerror of errno (not necessarily related): Ressource temporairement non disponible)
nov. 26 16:04:08 fiona org.gtk.vfs.Daemon[1155]: ** (process:1436): CRITICAL **: g_vfs_backend_afc_query_info: assertion 'self->connected' failed
nov. 26 16:04:10 fiona gnome-session[1111]: (gnome-shell:1216): Gjs-WARNING **: JS ERROR: TypeError:  is null
nov. 26 16:04:10 fiona gnome-session[1111]: ContentTypeDiscoverer<._onContentTypeGuessed/<@resource:///org/gnome/shell/ui/components/autorunManager.js:133
nov. 26 16:04:10 fiona gnome-session[1111]: _proxyInvoker/asyncCallback@resource:///org/gnome/gjs/modules/overrides/Gio.js:86
nov. 26 16:04:10 fiona ModemManager[533]: <warn>  Couldn't find support for device at '/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2': not supported by any plugin

Versions of packages usbmuxd depends on:

  • adduser 3.113+nmu3
  • libc6 2.19-13
  • libimobiledevice5 1.1.7+dfsg-1
  • libplist3 1.12-1
  • libusb-1.0-0 2:1.0.19-1

I would like to investigate the problem, but I have no clue. Any idea?

unable to compile with libplist-1.11

I'm trying to compile the latest HEAD version with ./configure --without-preflight (due to issue #10)
The compilation fails with the following error:

libtool: link: x86_64-pc-linux-gnu-gcc -g -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -I../src -I/usr/include/libxml2 -I/usr/include/libusb-1.0 -march=core2 -mtune=generic -O2 -pipe -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -o usbmuxd usbmuxd-client.o usbmuxd-device.o usbmuxd-preflight.o usbmuxd-log.o usbmuxd-usb-linux.o usbmuxd-utils.o usbmuxd-conf.o usbmuxd-main.o  -lplist -lusb-1.0 -lpthread
usbmuxd-conf.o: In function `internal_get_value':
/var/tmp/portage/app-pda/usbmuxd-1.0.8_p20140325/work/src/conf.c:289: undefined reference to `plist_read_from_filename'
usbmuxd-conf.o: In function `internal_set_value':
/var/tmp/portage/app-pda/usbmuxd-1.0.8_p20140325/work/src/conf.c:234: undefined reference to `plist_read_from_filename'
collect2: error: ld returned 1 exit status
make[2]: *** [usbmuxd] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.