We have a large application with multiple dependencies. The environment is:
- Ubuntu 16.04 LTS
- Intel® Core™ i7-7700HQ CPU @ 2.80GHz × 8
- AstraSDK-v2.0.9-beta3-dc1f53e9c9-20180623T013908Z-Linux
When we linked to astra_core.so, a segfault appeared at the very start of execution. Backtracking indicated the issue happened inside astra_core.so, and linked to the logging process.
After further investigation, it seemed the issue is easylogging++, which very likely was used in astra_core.so. Following that line, I managed to reproduce a minimal example using easylogging++, which is here attached. The two files easylogging++.cc and easylogging++.h come directly from GitHub - amrayn/easyloggingpp: Single header C++ logging library. It is extremely powerful, extend (tag v9.96.4).
The example is a small variation of the sample ColorReaderEventCPP with an option to link against easylogging++. If you build as follows:
cd ColorReaderEventCPP-Logging
mkdir build
cd build
cmake ..
make
./ColorReaderEventCPP-Logging
then it should be exactly the same as ColorReaderEventCPP and everything should work well. Please note, ASTRA_ROOT needs to be defined with the astra sdk folder.
However, if you now build as follows:
cd ColorReaderEventCPP-Logging
mkdir build
cd build
cmake -DTEST_EASYLOGGING=ON ..
make
./ColorReaderEventCPP-Logging
Then a segfault will appear.
This is an important issue, as it seems astra_core is blocking end user applications from using similar logging strategies, and for us is a blocking point, as we are linking against other 3rd party libraries which are also closed, and using similar logging strategies.