Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 910706 - app-pda/usbmuxd: freezes/hangs when Apple device is attached on OpenRC
Summary: app-pda/usbmuxd: freezes/hangs when Apple device is attached on OpenRC
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal critical (vote)
Assignee: zurabid2016
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-23 06:32 UTC by zurabid2016
Modified: 2024-01-16 20:28 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
lsusb_info (ipad.txt,15.96 KB, text/plain)
2024-01-15 16:44 UTC, Anton Bolshakov
Details
udevadm monitor -p (udevadm_monitor,9.05 KB, text/plain)
2024-01-16 03:06 UTC, Anton Bolshakov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zurabid2016 2023-07-23 06:32:23 UTC
**Important** This only happens on OpenRC
Once usbmuxd was merged, I tried attaching iPhone to the computer. While the little phone icon has appeared at the control panel of KDE desktop environment, it brings me to a Dolphin page saying there was some error reading/connecting to the device. Further information (backtrace, emerge log, etc) will be provided soon.
Possible workaround is https://github.com/libimobiledevice/usbmuxd/commit/e55e6e7c6cdcd7954de339be286b3818da69cddd, but 1) it isn't backported to 1.1.1, 2) I haven't got the chance to check whether it actually does anything.

By the way, if this hanged running instance is killed by SIGKILL, and the device is reattached, everything works beautifully (without any issues) before the computer is restarted.

Reproducible: Always

Steps to Reproduce:
1. Launch PC
2. Attach Apple device
Actual Results:  
Usbmuxd hangs

Expected Results:  
Everything works as intended — the device shows in a file explorer and I can browse its files
Comment 1 zurabid2016 2023-07-23 06:33:20 UTC
Please, assign to me (I am the usbmuxd maintainer)
Comment 2 zurabid2016 2023-08-29 08:40:08 UTC
The issue has been (re)opened on the upstream bug tracker: https://github.com/libimobiledevice/usbmuxd/issues/210
Comment 3 Anton Bolshakov 2024-01-15 16:42:05 UTC
FYI, usbmuxd doesn't start here with both original and the patched version.
That could be it:
https://github.com/libusb/libusb/issues/850
bConfigurationValue     0 <----- USB spec violation

Here is the debug log:

[00:33:05.442][3] usbmuxd v1.1.1 starting up
[00:33:05.442][3] usbmuxd v1.1.1 starting up
[00:33:05.442][4] Creating socket
[00:33:05.443][3] Successfully dropped privileges to 'usbmux'
[00:33:05.443][4] Initializing USB
[00:33:05.443][3] Using libusb 1.0.26
[00:33:05.447][4] Registering for libusb hotplug events
[00:33:05.447][4] Found new device with v/p 05ac:12ab at 1-46
[00:33:05.543][4] Setting configuration for device 1-46, from 1 to 4
[00:33:05.550][4] Found interface 1 with endpoints 04/85 for device 1-46
[00:33:05.551][4] Using wMaxPacketSize=512 for device 1-46
[00:33:05.551][4] USB Speed is 480 MBit/s for device 1-46
[00:33:05.551][4] 1 device detected
[00:33:05.551][3] Initialization complete
[00:33:05.442][3] usbmuxd v1.1.1 starting up

As you can see, it's getting called 3 times, but doesn't stay in the memory for some reason.

it works fine if I start it manually using the same command.
Comment 4 Anton Bolshakov 2024-01-15 16:44:56 UTC
Created attachment 882351 [details]
lsusb_info
Comment 5 Anton Bolshakov 2024-01-16 03:06:40 UTC
Created attachment 882371 [details]
udevadm monitor -p
Comment 6 Anton Bolshakov 2024-01-16 03:48:07 UTC
btw, I'm openrc user, and the following PR may be required too:
https://github.com/libimobiledevice/usbmuxd/issues/210
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-01-16 04:03:38 UTC
I assume you mean https://github.com/libimobiledevice/usbmuxd/pull/227?
Comment 8 zurabid2016 2024-01-16 20:28:04 UTC
I have rebased my patch onto 1.1.1 tag and published draft ebuild[1] (of -r2) with which issue seems to be gone. Could you test it? The overlay is here: https://gitlab.com/BalkanMadman/pidruchniki
The patch is still a bit dirty, but that will be worked on.

[1]: https://gitlab.com/BalkanMadman/pidruchniki/-/blob/master/app-pda/usbmuxd/usbmuxd-1.1.1-r2.ebuild