All of lore.kernel.org
 help / color / mirror / Atom feed
* is_method_error versus call() errors
@ 2018-09-10 16:17 Patrick Venture
  2018-09-10 21:49 ` William Kennington
  0 siblings, 1 reply; 6+ messages in thread
From: Patrick Venture @ 2018-09-10 16:17 UTC (permalink / raw)
  To: OpenBMC Maillist

Given:

_public_ int sd_bus_message_is_method_error(sd_bus_message *m, const
char *name) {
        assert_return(m, -EINVAL);
        if (m->header->type != SD_BUS_MESSAGE_METHOD_ERROR)
                return 0;
        if (name && (!m->error.name || !streq(m->error.name, name)))
                return 0;
        return 1;
}

The failures from call() don't always set the reply (maybe don't ever,
but I didn't read it closely).  Which means, is_method_error() can
happen when the bus call itself was fine, so we need to check both IFF
we're going to read the response.

I'm working on eliminating the new crashes from phosphor-host-ipmid
and other repositories, now that sdbusplus can except, which is not
caught even though there's an error case for is_method_error()
immediately after the call.

In phosphor-pid-control, I dropped the is_method_error() check, but I
think it's still valid before trying to read() a message -- so I will
likely throw a patch adding that check.

Patrick

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-09-11 21:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-10 16:17 is_method_error versus call() errors Patrick Venture
2018-09-10 21:49 ` William Kennington
2018-09-11  0:13   ` Kun Yi
2018-09-11  7:44     ` William Kennington
2018-09-11  9:51   ` Thomaiyar, Richard Marian
2018-09-11 21:40     ` William Kennington

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.