Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
spdlog: do not drop logger in destructor
For static objects, the order of destruction is in reverse of the order of construction, but the latter is hard to control except among static objects defined within the same translation unit. This means that spdlog may be destructed before spdlog::drop() is invoked in the destructor, which leads to a segmentation fault due to memory use-after-free. The spdlog example points out that dropping all loggers via spdlog::shutdown(), which invokes spdlog::drop_all(), is optional. Omit destructor calls of spdlog::drop(), but retain non-destructor calls of spdlog::drop_all() for now since they do not cause any harm. Link: ros2/rclcpp#933 Link: gabime/spdlog#1738 Link: https://github.com/gabime/spdlog/blob/a2b4262090fd3f005c2315dcb5be2f0f1774a005/example/example.cpp#L96 Closes: https://hsdes.intel.com/appstore/article/#/22019839238 Signed-off-by: Peter Colberg <peter.colberg@intel.com>
- Loading branch information