SEGFAULT with MM HEAD when probing

Bjørn Mork bjorn at
Thu Apr 22 06:55:12 UTC 2021

Bjørn Mork <bjorn at> writes:

> Or give me a few days and I might be able to bisect the problem.

A few meetings helps a lot with time for robotic work like bisecting :-)

The winner is:

commit ec375bd959f071ce01533d50a2775e8a6f69607b
Author: Andrew Lassalle <andrewlassalle at>
Date:   Wed Nov 25 13:14:35 2020 -0800

    port-qmi: add support for QRTR
    Extend mm-port-qmi to accept a QRTR node to work with modems using the
    QRTR protocol.

:040000 040000 973a59e3f3652ccf07b9909820238279d9efbbc9 80418a9b0c5af26898d7a6b53e16cd4d720a93e9 M      src


git bisect start
# bad: [e57c59bf88615129efc0241957749102ea8af90d] qmi: Increase qmi_device_open timeout
git bisect bad e57c59bf88615129efc0241957749102ea8af90d
# good: [7a5a49b75301b38c2bac6a94de5afb2f9930cf4e] release: bump version to 1.16.0
git bisect good 7a5a49b75301b38c2bac6a94de5afb2f9930cf4e
# good: [bb5bc9c8c560a24ef2951bdb9e1da18dedd7c5b0] shared-qmi: process all feature checks in SSP response together
git bisect good bb5bc9c8c560a24ef2951bdb9e1da18dedd7c5b0
# good: [7dfe6198e1015c3fcc875d7be17e6b1a925c8e00] iface-modem: publish helper to abort invocation if state not reached
git bisect good 7dfe6198e1015c3fcc875d7be17e6b1a925c8e00
# good: [bf519fcc1b591a1435b727e38ef4a108219bd28b] port-qmi: avoid using QmiDeviceExpectedDataFormat in the port setup
git bisect good bf519fcc1b591a1435b727e38ef4a108219bd28b
# bad: [f7ec13deb88e9bd292d69ec7442dc892e51f3c52] sim-mbim: increase the timeout for the MBIM_CID_HOME_PROVIDER query
git bisect bad f7ec13deb88e9bd292d69ec7442dc892e51f3c52
# bad: [f82f50fb13aa5d0dd85b0b06948cf1a3b1190c66] base-modem: create modem for QRTR subsystem
git bisect bad f82f50fb13aa5d0dd85b0b06948cf1a3b1190c66
# bad: [ec375bd959f071ce01533d50a2775e8a6f69607b] port-qmi: add support for QRTR
git bisect bad ec375bd959f071ce01533d50a2775e8a6f69607b
# good: [312f753046b4ceaddef7b45a676a8880bfc9d89d] port-qmi: initialize endpoint info for all backends
git bisect good 312f753046b4ceaddef7b45a676a8880bfc9d89d
# first bad commit: [ec375bd959f071ce01533d50a2775e8a6f69607b] port-qmi: add support for QRTR

Note that 7dfe6198e1015c3fcc875d7be17e6b1a925c8e00 failed a bit later

[10227]: <debug> [1619071156.121734] [qmimux0] preloading contents and properties...
[10227]: <warn>  [1619071156.122082] [qmimux0] invalid sysfs path read for net/qmimux0
ERROR:kerneldevice/mm-kernel-device-generic.c:235:ptr_array_add_sysfs_attribute_link_basename: assertion failed: (array && sysfs_path && attribute)
Bail out! ERROR:kerneldevice/mm-kernel-device-generic.c:235:ptr_array_add_sysfs_attribute_link_basename: assertion failed: (array && sysfs_path && attribute)

but that's another temporary problem, so it's therefore noted as
"good".  Thanks for keeping this code bisectable, BTW.  Really great to
be able to build and run arbitrary commits in the middle of a series
like this.

I was pessimistic about my ability to fix or revert what I found, but
looking at the failing commit it turned out to be rather obvious and
easy to fix:

@@ -32,6 +33,16 @@
 G_DEFINE_TYPE (MMPortQmi, mm_port_qmi, MM_TYPE_PORT)
+enum {
+    PROP_0,
+static GParamSpec *properties[PROP_LAST];
 typedef struct {
     QmiService     service;
     QmiClient     *client;
@@ -43,6 +54,10 @@ struct _MMPortQmiPrivate {
     QmiDevice *qmi_device;
     GList     *services;
     gchar     *net_driver;
+#if defined WITH_QRTR
+    QrtrNode  *node;

There's a bit of inconsistency between WITH_QRTR and WITH_QMI there...

Verified fix attached


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-port-qmi-fix-crash-when-QRTR-is-disabled.patch
Type: text/x-diff
Size: 1303 bytes
Desc: not available
URL: <>

More information about the ModemManager-devel mailing list