ModemManager crashes if modem resets while being initialized
Environment:
- Ubuntu 20.04 LTS
- ModemManager latest from master branch (also seems to happen with 1.16)
- libqmi latest
- Simcom SIM7600G
When the modem has been in inhibit mode and a modem reset (by AT command without MM) is executed, immediately followed by uninhibit, the modem disappears during modem reinitialization and MM crashes.
Possibly this could also be triggered by a well-timed modem removal.
Call stack:
Thread #1 [ModemManager] 121767 [core: 7] (Suspended : Signal : SIGSEGV:Segmentation fault)
mm_gdbus_modem_get_manufacturer() at mm-gdbus-modem.c:26,983 0x7f317a472e7d
mm_broadband_modem_create_device_identifier() at mm-broadband-modem.c:12,528 0x5598efb5e6ec
modem_load_device_identifier() at mm-broadband-modem-qmi.c:689 0x5598efb8777e
interface_initialization_step() at mm-iface-modem.c:5,258 0x5598efb2229a
load_equipment_identifier_ready() at mm-iface-modem.c:4,467 0x5598efb24ca0
0x7f3179eccf49
0x7f3179eccf8d
g_main_context_dispatch() at 0x7f3179ce104e
0x7f3179ce1400
g_main_loop_run() at 0x7f3179ce16f3
<...more frames...>
I've caught this in debugger and the object
pointer passed to mm_gdbus_modem_get_manufacturer()
is NULL, causing the crash.
Full log here: mm_crash_20210518.log
This seems to reproduce quite easily, so I can test any fix candidates.