Hey

On Mon, May 24, 2021 at 7:21 PM Oskar Stenman <os...@cetex.se> wrote:
>
> Replying to myself here again..
>
> Not sure what's going on but noticed laptop running hot and I see 
> ModemManager + mbim-proxy running at 100% cpu.
> Strace  of mbim-proxy only spams infinite lines like:
> write(7, 
> "\3\0\0\0000\0\0\0\237\3\0\0\1\0\0\0\0\0\0\0\242\211\3143\274\273\213O\266\260\23>\302\252\346\337\24\0\0\0\0\0\0\0\0\0\0\0",
>  48) = -1 EAGAIN (Resource temporarily unavailable)
> write(7, 
> "\3\0\0\0000\0\0\0\237\3\0\0\1\0\0\0\0\0\0\0\242\211\3143\274\273\213O\266\260\23>\302\252\346\337\24\0\0\0\0\0\0\0\0\0\0\0",
>  48) = -1 EAGAIN (Resource temporarily unavailable)
> write(7, 
> "\3\0\0\0000\0\0\0\237\3\0\0\1\0\0\0\0\0\0\0\242\211\3143\274\273\213O\266\260\23>\302\252\346\337\24\0\0\0\0\0\0\0\0\0\0\0",
>  48) = -1 EAGAIN (Resource temporarily unavailable)
> write(7, 
> "\3\0\0\0000\0\0\0\237\3\0\0\1\0\0\0\0\0\0\0\242\211\3143\274\273\213O\266\260\23>\302\252\346\337\24\0\0\0\0\0\0\0\0\0\0\0",
>  48) = -1 EAGAIN (Resource temporarily unavailable)
>
> mbim-proxy:
> oskar@oskar-ThinkPad-X1-Nano-Gen-1:~$ sudo ls -la /proc/2275/fd/7
> lrwx------ 1 root root 64 May 24 04:59 /proc/2275/fd/7 -> /dev/wwan0p2MBIM
>
> So it's trying to write to wwanop2MIM
>
> strace ModemManager only seems to spam infinite lines like:
> write(11, 
> "\3\0\0\0000\0\0\0+\2\0\0\1\0\0\0\0\0\0\0\242\211\3143\274\273\213O\266\260\23>"...,
>  48) = -1 EAGAIN (Resource temporarily unavailable)
> write(11, 
> "\3\0\0\0000\0\0\0+\2\0\0\1\0\0\0\0\0\0\0\242\211\3143\274\273\213O\266\260\23>"...,
>  48) = -1 EAGAIN (Resource temporarily unavailable)
> write(11, 
> "\3\0\0\0000\0\0\0+\2\0\0\1\0\0\0\0\0\0\0\242\211\3143\274\273\213O\266\260\23>"...,
>  48) = -1 EAGAIN (Resource temporarily unavailable)
> write(11, 
> "\3\0\0\0000\0\0\0+\2\0\0\1\0\0\0\0\0\0\0\242\211\3143\274\273\213O\266\260\23>"...,
>  48) = -1 EAGAIN (Resource temporarily unavailable)
> write(11, 
> "\3\0\0\0000\0\0\0+\2\0\0\1\0\0\0\0\0\0\0\242\211\3143\274\273\213O\266\260\23>"...,
>  48) = -1 EAGAIN (Resource temporarily unavailable)
> write(11, 
> "\3\0\0\0000\0\0\0+\2\0\0\1\0\0\0\0\0\0\0\242\211\3143\274\273\213O\266\260\23>"...,
>  48) = -1 EAGAIN (Resource temporarily unavailable)
> write(11, 
> "\3\0\0\0000\0\0\0+\2\0\0\1\0\0\0\0\0\0\0\242\211\3143\274\273\213O\266\260\23>"...,
>  48) = -1 EAGAIN (Resource temporarily unavailable)
>
> ModemManager:
> oskar@oskar-ThinkPad-X1-Nano-Gen-1:~$ sudo ls /proc/1363/fd/11 -la
> lrwx------ 1 root root 64 May 24 19:16 /proc/1363/fd/11 -> 'socket:[236731]'
>
> Any ideas?
>

So, I have no idea what led to that setup to return EAGAIN on the
write operation, but the proxy should definitely not get stuck like
that. This is the same issue as these ones in libqmi:
https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/issues/4
https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/issues/59

We should have a maximum number of retries on EAGAIN and error out the
operation if those max retries all fail. In MM we already do that with
TTYs, but the proxies (mbim-proxy and qmi-proxy) don't do it. It's not
a trivial one liner patch though because (IIRC) the main issue is that
GUnixOutputStream handles EAGAIN internally and we cannot decide how
it should behave. We'll need to port to the older GIOChannel API for
this to work. See
https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/issues/59#note_840315

-- 
Aleksander
https://aleksander.es
_______________________________________________
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel

Reply via email to