All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Venture <venture@google.com>
To: OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: is_method_error versus call() errors
Date: Mon, 10 Sep 2018 09:17:45 -0700	[thread overview]
Message-ID: <CAO=notz1BPmjSTmcLBKOs1Cv9FNqGCi5zYBw24jufDjXdPHR7g@mail.gmail.com> (raw)

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

             reply	other threads:[~2018-09-10 16:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-10 16:17 Patrick Venture [this message]
2018-09-10 21:49 ` is_method_error versus call() errors 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAO=notz1BPmjSTmcLBKOs1Cv9FNqGCi5zYBw24jufDjXdPHR7g@mail.gmail.com' \
    --to=venture@google.com \
    --cc=openbmc@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.