Squish Coco memory issues with CameraFactory, ProjectionFactory, NumericalApproximation, ProcessGroundPolygons
When building the api with MODE=TC and the make unitTest MODE=TC, CameraFactory, ProjectionFactory, NumericalApproximation, and ProcessGroundPolygons' unit tests produce memory dumps (the test still runs and produces coverage statistics).
(Note, this happens when building the api without MODE=TC and then compiling, linking, and running CameraFactory's unit test with MODE=TC).
Fixed by #2402 PROG commit.
Investigate core dumps for NumericalApproximation and ProcessGroundPolygons.
For CameraFactory and ProjectionFactory, this likely happens because these classes have static class members, and when the unitTest executables are linked, they are linked against their own classes' .so (e.g. libCameraFactory.so) and the libisis3.X.XX.so library. This produces two symbols for the static class member variable.
Part of this fix may require removing the changes for #2402's PROG commit (revision 7176). In isismake.objs, the lines
if [ "$(CODE_COVERAGE_BIN_DIR)" == "" ]; then ... else
would be removed, if necessary.
To fix this, one approach may be copying the libisis3.X.XX.so or .a to the class's directory area, then removing (for example) the CameraFactory.o from the shared library / archive.
Another possibility is to copy the static libisisX.a to the class directory as part of the unitTest target/recipe. This would cause the unitTest to be statically linked against this libisis library, and this prevents the core dump. Further investigation would be required as to why this fixes the issue, and it is worth noting that this would increase the size of the executables.