[systemd-devel] Exception safety od sd-bus

Norbert Lange nolange79 at gmail.com
Thu Jul 22 13:15:57 UTC 2021


Am Do., 22. Juli 2021 um 14:04 Uhr schrieb Stanislav Angelovič
<angelovic.s at gmail.com>:
>
> Hi guys!
>
> Assuming sd-bus is used in a C++ application, is sd-bus safe against exceptions flying from e.g. a sd-bus vtable callback handler (provided by the C++ application) and catching them in the caller of sd_bus_process() (which is the same C++ app)?
>
> Or this is not supported (so leaks or whatever obscure situations may happen then)?

It should be "supported" in the way that exceptions will *not*
propagate in C libraries, and your program will call std::terminate
should one callback throw an exception.
Mark your callbacks with 'noexcept', statical analysis might be able
to warn if you potentially create exceptions.

Norbert


More information about the systemd-devel mailing list