Clean-up: coverity warns of uncaught exception during logging
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 6 Jan 2023 17:01:53 +0000 (12:01 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 9 Jan 2023 19:13:13 +0000 (14:13 -0500)
commit88277a52069ed0135254ce29da617ebb6ecddbb8
treeacc0797ae38bcacbeb89077a93967b73846bb838
parent57b90af7b1977684094706818e387433f50b7d48
Clean-up: coverity warns of uncaught exception during logging

Coverity reports:

  1502349 Uncaught exception If the exception is ever thrown, the
  program will crash.

  In lttng::​file_descriptor::​~file_descriptor(): A C++ exception is
  thrown but never caught (CWE-248)

and

  1502348 Uncaught exception If the exception is ever thrown, the
  program will crash.

  In main: A C++ exception is thrown but never caught (CWE-248)

Both have the same cause: libfmt should not be used in "final" catch
blocks before returning to non exception-safe code in order to contain
all exceptions.

As we add custom formaters, it could be interesting to revisit this and
provide a noexcept wrapper for fmt::format. For the moment not much is
lost (beyond format string type safety) from using the existing logging
macros directly.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ia70505517678ae182f6479feeb264c9402aa1381
src/common/file-descriptor.hpp
src/common/uuid.cpp
This page took 0.024482 seconds and 4 git commands to generate.