Skip to content

Fixed and uniformized use of Boost::unit_test_framework in LHCbKernel

Marco Clemencic requested to merge marcocle/debug-dd4hep-hanging-tests into master

Some tests in LHCbKernel were configured to link against Boost::unit_test_framework, while other were not linked against it because it was causing segmentation faults.

Debugging a few tests that were hanging when linked against DD4hep, I found the root of the problem to be the wrong use of Boost unit_test.hpp header and and the library Boost::unit_test_framework.

According to Boost documentation, the header boost/test/included/unit_test.hpp is meant to be used when we do not want to link against Boost::unit_test_framework. What the doc does not say is that if you use the standalone header and link against the library you get some double free, which sometimes does not harm and sometimes causes segmentation faults... and in a few special cases was causing a segmentation fault inside malloc itself that ROOT signal handler was trying to report but got stack in a dead lock when invoking malloc (this is the reason for the hanging tests when linking against DD4hep).

This MR puts some order in the way the unit tests are defined in LHCbKernel: always use the Boost::unit_test_framework consistently.

Edited by Marco Clemencic

Merge request reports