[Maintainers] Call for maintenance

Vernon Mauery vernon.mauery at linux.intel.com
Thu Aug 2 05:31:12 AEST 2018


On 01-Aug-2018 10:13 AM, Lei YU wrote:
>On Tue, Jul 31, 2018 at 10:21 PM Tom Joseph <tomjose at linux.vnet.ibm.com> wrote:
>>
>> Hello,
>>
>> I am scrubbing the phosphor-host-ipmid to handle the SdBusError exception.
>>
>> Even though sdbusplus::exception::SdBusError is inherited from
>> std::exception,
>> my observation is that catch statement of std::exception does not catch
>> sdbusplus::exception::SdBusError exception.
>>
>> try
>> {
>>      // Statement throwing sdbusplus::exception::SdBusError exception.
>> }
>> catch (const std::exception& e) // Does not catch
>> sdbusplus::exception::SdBusError
>> {
>>
>> }
>>
>> I think the multiple inheritance from std::exception is causing this.
>>
>
>Yup, I meet the same issue.
>The root cause is multiple inheritance of std::exception:
>
>    struct exception : public std::exception;
>    struct internal_exception : public exception;
>    class SdBusError final : public internal_exception, public
>std::system_error;
>
>SdBusError inherits both internal_exception and std::system_error,
>which both inherit std::exception.
>We can not use virtual inheritance here because std::system_error
>already non-virtually inherits std::exception.
>
>So probably we should not use diamond inheritance here...

I just submitted a patch for review. This allows SdBusError to be caught 
via std::exception:

https://gerrit.openbmc-project.xyz/#/c/openbmc/sdbusplus/+/11726/

There are still packages that may not even be handling std::exceptions 
around sdbusplus calls, but that is a different problem. :)

--Vernon


More information about the openbmc mailing list