<div dir="ltr"><div><div style="font-family:tahoma,sans-serif" class="gmail_default">Package: libusbmuxd-2.0-7<br>Version: 2.1.0-1+b1<br>Severity: important<br>Tags: patch upstream fixed-upstream<br>Control: fixed -1 2.1.1-1<br>Control: affects -1 upower<br><br>Dear Maintainer,<br><br>Summary:<br><br>- Problem: after I connected an iPhone over USB to charge it, upowerd<br>  got stuck using 100% of one CPU core and stopped answering D-Bus<br>  clients.<br>- Cause: in libusbmuxd 2.1.0, usbmuxd_send() returns a positive value<br>  on error. libimobiledevice treats it as "success, 0 bytes sent" and<br>  retries forever.<br>- Fix: one line, already in 2.1.1-1 (sid), upstream commit<br>  bb6a786b676ab5ea6a1a13b5c14ddd965d7583fc<br>  ("Fix usbmuxd_send returning positive value on error"):<br><br>    -           return -num_sent;<br>    +           return num_sent;<br><br>  Please consider it for a trixie point release.<br><br>Details below.<br><br>What I saw:<br><br>"upower -e" printed (locale es_MX; the message means "timeout<br>reached"):<br><br>  libupower-glib-WARNING **: up_client_get_devices failed: Se alcanzó el tiempo de expiración<br>  Failed to get device list<br><br>Over 5 seconds, /proc/<pid>/io counters (wchar, syscw) of upowerd did<br>not change and /proc/<pid>/syscall showed "running". At that point no<br>Apple USB device was present and usbmuxd.service was inactive.<br>I observed this once and did not try to reproduce it on demand.<br><br>Code path (Debian sources, trixie):<br><br>1. libimobiledevice-glue 1.3.1-1, socket_send(): returns -errno on<br>   failure.<br><br>2. libusbmuxd 2.1.0-1, src/libusbmuxd.c, usbmuxd_send():<br>       num_sent = socket_send(sfd, (void*)data, len);   /* -errno */<br>       if (num_sent < 0) {<br>           *sent_bytes = 0;<br>           return -num_sent;                            /* +errno */<br>       }<br><br>3. libimobiledevice 1.3.0+git20250228-2, src/idevice.c,<br>   internal_connection_send(): only "res < 0" is an error, so a<br>   positive value returns IDEVICE_E_SUCCESS with *sent_bytes = 0.<br><br>4. Same file, idevice_connection_send(), lines 705-712:<br>       while (sent < len) {<br>           int s = internal_connection_send(..., &bytes);<br>           if (s < 0) break;<br>           sent += bytes;                               /* += 0 */<br>       }<br>   This never ends.<br><br>Backtrace of the spinning upowerd thread (eu-stack with<br><a href="http://debuginfod.debian.net">debuginfod.debian.net</a>; three samples 1 s apart, all in this path):<br><br>  #5  usbmuxd_send            libusbmuxd.c:1592<br>  #6  internal_connection_send idevice.c:640<br>  #7  idevice_connection_send idevice.c:707<br>  #8  service_send            service.c:145<br>  #9  internal_plist_send     property_list_service.c:133<br>  #10 lockdownd_send          lockdown.c:355<br>  #11 lockdownd_get_value     lockdown.c:423<br>  #12 lockdownd_do_pair       lockdown.c:928<br>  #13 lockdownd_pair          lockdown.c:1069<br>  #14 lockdownd_client_new_with_handshake  lockdown.c:731<br>  #15 up_device_idevice_refresh  up-device-idevice.c:241 (upower 1.90.9-1)<br><br>System: Debian 13 (trixie), kernel 6.12.116+deb13-amd64, amd64,<br>libc6 2.41-12+deb13u4.</div><br></div><div><div style="font-family:tahoma,sans-serif" class="gmail_default">------------------------------------------------</div><div style="font-family:tahoma,sans-serif" class="gmail_default">Package: libusbmuxd-2.0-7<br>Version: 2.1.0-1+b1<br>Severity: important<br>Tags: patch upstream fixed-upstream<br>Control: fixed -1 2.1.1-1<br>Control: affects -1 upower<br><br>Estimado responsable del paquete:<br><br>Resumen:<br><br>- Problema: después de conectar un iPhone por USB para cargarlo,<br>  upowerd se atoró usando el 100 % de un núcleo del procesador y dejó<br>  de responder a los programas que le preguntan por D-Bus.<br>- Causa: en libusbmuxd 2.1.0, usbmuxd_send() devuelve un valor<br>  positivo cuando hay un error. libimobiledevice lo toma como "éxito,<br>  0 bytes enviados" y reintenta para siempre.<br>- Arreglo: una línea, ya incluida en 2.1.1-1 (sid), commit original<br>  bb6a786b676ab5ea6a1a13b5c14ddd965d7583fc<br>  ("Corrige que usbmuxd_send devuelva un valor positivo en error"):<br><br>    -           return -num_sent;<br>    +           return num_sent;<br><br>  Les pido considerarlo para una actualización de trixie.<br><br>Detalles abajo.<br><br>Lo que vi:<br><br>"upower -e" mostró (idioma es_MX; el mensaje significa "se agotó el<br>tiempo"):<br><br>  libupower-glib-WARNING **: up_client_get_devices failed: Se alcanzó el tiempo de expiración<br>  Failed to get device list<br><br>Durante 5 segundos, los contadores de /proc/<pid>/io (wchar, syscw) de<br>upowerd no cambiaron y /proc/<pid>/syscall mostraba "running". En ese<br>momento no había ningún aparato Apple conectado por USB y<br>usbmuxd.service estaba inactivo.<br>Lo observé una vez y no intenté reproducirlo a propósito.<br><br>Ruta del código (fuentes de Debian, trixie):<br><br>1. libimobiledevice-glue 1.3.1-1, socket_send(): si falla, devuelve<br>   -errno (negativo).<br><br>2. libusbmuxd 2.1.0-1, src/libusbmuxd.c, usbmuxd_send():<br>       num_sent = socket_send(...);   /* -errno */<br>       si num_sent < 0:<br>           *sent_bytes = 0;<br>           return -num_sent;          /* +errno: signo al revés */<br><br>3. libimobiledevice 1.3.0+git20250228-2, src/idevice.c,<br>   internal_connection_send(): solo considera error si "res < 0", así<br>   que un valor positivo devuelve ÉXITO con *sent_bytes = 0.<br><br>4. Mismo archivo, idevice_connection_send(), líneas 705-712:<br>       mientras enviado < total:<br>           s = internal_connection_send(...);<br>           si s < 0: salir<br>           enviado += bytes;          /* += 0 */<br>   Esto nunca termina.<br><br>Traza del hilo de upowerd que gira (eu-stack con <a href="http://debuginfod.debian.net">debuginfod.debian.net</a>;<br>tres muestras con 1 s de diferencia, todas en esta ruta):<br><br>  #5  usbmuxd_send             libusbmuxd.c:1592<br>  #6  internal_connection_send idevice.c:640<br>  #7  idevice_connection_send  idevice.c:707<br>  #8  service_send             service.c:145<br>  #9  internal_plist_send      property_list_service.c:133<br>  #10 lockdownd_send           lockdown.c:355<br>  #11 lockdownd_get_value      lockdown.c:423<br>  #12 lockdownd_do_pair        lockdown.c:928<br>  #13 lockdownd_pair           lockdown.c:1069<br>  #14 lockdownd_client_new_with_handshake  lockdown.c:731<br>  #15 up_device_idevice_refresh  up-device-idevice.c:241 (upower 1.90.9-1)<br><br>Sistema: Debian 13 (trixie), kernel 6.12.116+deb13-amd64, amd64,<br>libc6 2.41-12+deb13u4.</div><br></div><div><br></div><div><br clear="all"></div><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Sin mas que decir, quedo a sus ordenes.<div><br></div><div><br></div><div>M.S.C. <span style="font-size:12.8px">Daniel Oswaldo Guerrero Herrera</span></div><div>+52 (565)-157-6916</div><div><a href="mailto:oswalldogrro@gmail.com" target="_blank">oswalldogrro@gmail.com</a></div><div><div><span style="font-size:12.8px"><br></span></div></div></div></div></div>