Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault for all the tests in the development branch #210

Closed
aleixpinardell opened this issue Jul 5, 2017 · 14 comments
Closed

Comments

@aleixpinardell
Copy link
Member

All the tests (except sofa-test) are throwing a SegFault exception in the FullDevelopmentBranch. I've tried cleaning all and building again, but still the same. Do you know what could be the problem?

Running tests...
Test project /Users/aleix/Documents/build-tudatBundle-Desktop-Default
        Start   1: sofa-test
  1/167 Test   #1: sofa-test ................................................   Passed    0.02 sec
        Start   2: test_AerodynamicMomentAndAerodynamicForce
  2/167 Test   #2: test_AerodynamicMomentAndAerodynamicForce ................***Exception: SegFault  0.02 sec

[...]

Errors while running CTest
make: *** [test] Error 8
14:24:51: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project TudatBundle (kit: Desktop)
When executing step "Make"
@magnific0
Copy link
Member

magnific0 commented Jul 5, 2017

Can you run just a single test (e.g., test #2) and copy its output? You can also try running the test with the debugger and posting the backtrace here.

@aleixpinardell
Copy link
Member Author

The program has unexpectedly finished.

Apparently it's a problem with boost...

1	boost::unit_test::framework::get(unsigned long, boost::unit_test::test_unit_type)			0x100325754	
2	boost::unit_test::framework::state::deduce_siblings_order(unsigned long, unsigned long, std::map<unsigned long, boost::unit_test::framework::impl::order_info>&)			0x10032397e	
3	boost::unit_test::framework::finalize_setup_phase(unsigned long)			0x1003238a5	
4	boost::unit_test::unit_test_main(boost::unit_test::test_suite * ( *)(int, char * *), int, char * *)			0x10032f75d	
5	start			0x7fff97c58235	

I will try deleting the build folder, maybe there's something old or from a different branch even after the "Clean All"...

@aleixpinardell
Copy link
Member Author

Still the same problem. The applications are running though. It's boost::unit_test that is failing...

@magnific0
Copy link
Member

Hmm, really curious. Which boost version are you using? Also what does

ldd /Users/aleix/Documents/tudatBundle/tudat/bin/unit_tests/test_AerodynamicMomentAndAerodynamicForce

report?

@aleixpinardell
Copy link
Member Author

I have this in my main CMake file:

set(BoostVersion 1.60.0)

but I see no boost directory in my build folder. Is that normal?

Where should I run the ldd command? In my terminal I get -bash: ldd: command not found

@aleixpinardell
Copy link
Member Author

Maybe otool -L is equivalent on Mac?

	@rpath/libboost_unit_test_framework-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.5.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)

@aleixpinardell
Copy link
Member Author

And the output from run CMake in case that may help...

-- /Users/aleix/Documents/tudatBundle
-- BOOST: Using clang.
-- Boost was already build on system
-- Building CSpice from within TudatBundle.
-- WARNING: building release version!
-- Building NRLMSISE00 from within TudatBundle.
-- WARNING: building release version!
-- WARNING: building release version!
-- << Tudat (Release - part of TudatBundle) >>
-- CMake Module path(s): /Users/aleix/Documents/tudatBundle/external/CMake;/Users/aleix/Documents/tudatBundle/tudat/Tudat/External/CMake
-- Using clang compiler.
-- Building with flags: -Wall -Wextra -Wno-unused-parameter -std=c++11.
-- Boost version: 1.60.0
-- Found the following Boost libraries:
--   date_time
--   system
--   unit_test_framework
--   filesystem
--   regex
-- SPICE enabled!
-- SPICE_LIBRARIES: /Users/aleix/Documents/tudatBundle/cspice/lib/libcspice.a
-- SOFA enabled!
-- Sofa found in: /Users/aleix/Documents/tudatBundle/sofa/src
-- Found SOFA: /Users/aleix/Documents/tudatBundle/sofa/src/../..  
-- NRLMSISE-00 enabled!
-- NRLMSISE00_LIBRARIES: /Users/aleix/Documents/tudatBundle/nrlmsise-00/lib/libnrlmsise00.a
-- GSL disabled!
-- << SatellitePropagatorExamples (Release - part of TudatBundle) >>
-- CMake Module path(s): /Users/aleix/Documents/tudatBundle/external/CMake;/Users/aleix/Documents/tudatBundle/tudatExampleApplications/satellitePropagatorExamples/SatellitePropagatorExamples/CMakeModules
-- Using clang compiler.
-- Building with flags: -Wall -Wextra -Wno-unused-parameter -std=c++11.
-- Boost version: 1.60.0
-- Found the following Boost libraries:
--   thread
--   date_time
--   system
--   unit_test_framework
--   filesystem
--   regex
-- Relative path to Tudat found: /tudat/Tudat
-- SPICE_LIBRARIES: /Users/aleix/Documents/tudatBundle/cspice/lib/libcspice.a
-- NRLMSISE-00 enabled!
-- NRLMSISE00_LIBRARIES: /Users/aleix/Documents/tudatBundle/nrlmsise-00/lib/libnrlmsise00.a
-- << TemplateApplication (Release - part of TudatBundle) >>
-- CMake Module path(s): /Users/aleix/Documents/tudatBundle/external/CMake;/Users/aleix/Documents/tudatBundle/tudatExampleApplications/templateApplication/TemplateApplication/CMakeModules
-- Using clang compiler.
-- Building with flags: -Wall -Wextra -Wno-unused-parameter -std=c++11.
-- Boost version: 1.60.0
-- Found the following Boost libraries:
--   thread
--   date_time
--   system
--   unit_test_framework
--   filesystem
--   regex
-- Relative path to Tudat found: /tudat/Tudat
-- SPICE_LIBRARIES: /Users/aleix/Documents/tudatBundle/cspice/lib/libcspice.a
-- NRLMSISE-00 enabled!
-- NRLMSISE00_LIBRARIES: /Users/aleix/Documents/tudatBundle/nrlmsise-00/lib/libnrlmsise00.a
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/aleix/Documents/build-tudatBundle-Desktop-Default

@DominicDirkx
Copy link
Member

Just for clarity: this only happens when you update to the FullDevelopmentBranch branch?

If you delete the build folder, the CMakeLists.txt.user file and the boost folder (it should redownload and recompile it) does it run? To save compilation time, you can use the test_NumericalDerivative test, it has few if any dependencies.

@aleixpinardell
Copy link
Member Author

After that all the tests (except test_EstimationFromPositionDoubleDouble and test_VariationalEquations) are passing.

@DominicDirkx
Copy link
Member

Good! Could you attach the error log?

@aleixpinardell
Copy link
Member Author

Starting /Users/aleix/Documents/tudatBundle/tudat/bin/unit_tests/test_EstimationFromPositionDoubleDouble...
[...]
/Users/aleix/Documents/tudatBundle/tudat/Tudat/Astrodynamics/OrbitDetermination/UnitTests/unitTestEstimationFromIdealDataDoubleDouble.cpp:67: error: in "test_estimation_from_positions/test_EstimationFromPosition": absolute value of std::fabs( estimationError( i + 18 ) ){0.0001680031418800354} exceeds 0.0001
/Users/aleix/Documents/tudatBundle/tudat/Tudat/Astrodynamics/OrbitDetermination/UnitTests/unitTestEstimationFromIdealDataDoubleDouble.cpp:71: error: in "test_estimation_from_positions/test_EstimationFromPosition": absolute value of std::fabs( estimationError( 7 ) ){1.4296248107559251e-06} exceeds 9.9999999999999995e-07
/Users/aleix/Documents/tudatBundle/tudat/Tudat/Astrodynamics/OrbitDetermination/UnitTests/unitTestEstimationFromIdealDataDoubleDouble.cpp:74: error: in "test_estimation_from_positions/test_EstimationFromPosition": absolute value of std::fabs( estimationError( 9 ) ){1.1995205341066508e-11} exceeds 9.9999999999999994e-12
/Users/aleix/Documents/tudatBundle/tudat/Tudat/Astrodynamics/OrbitDetermination/UnitTests/unitTestEstimationFromIdealDataDoubleDouble.cpp:75: error: in "test_estimation_from_positions/test_EstimationFromPosition": absolute value of std::fabs( estimationError( 10 ) ){1.2140901602257773e-11} exceeds 9.9999999999999994e-12
/Users/aleix/Documents/tudatBundle/tudat/Tudat/Astrodynamics/OrbitDetermination/UnitTests/unitTestEstimationFromIdealDataDoubleDouble.cpp:80: error: in "test_estimation_from_positions/test_EstimationFromPosition": absolute value of std::fabs( estimationError( i + 11 ) ){1.0222933610748441e-12} exceeds 9.9999999999999998e-13

*** 5 failures are detected in the test module "Master Test Suite"
/Users/aleix/Documents/tudatBundle/tudat/bin/unit_tests/test_EstimationFromPositionDoubleDouble exited with code 201
Starting /Users/aleix/Documents/tudatBundle/tudat/bin/unit_tests/test_VariationalEquations...
[...]
/Users/aleix/Documents/tudatBundle/tudat/Tudat/Astrodynamics/Propagators/UnitTests/unitTestVariationalEquationPropagation.cpp:613: error: in "test_variational_equation_calculation/testEarthOrbiterVariationalEquationCalculation": Element [0, 6] not within expected tolerance (delta 5.317320e-08): expected -0.002651, was -0.002651, tolerance 2.000000e-05 .
/Users/aleix/Documents/tudatBundle/tudat/Tudat/Astrodynamics/Propagators/UnitTests/unitTestVariationalEquationPropagation.cpp:613: error: in "test_variational_equation_calculation/testEarthOrbiterVariationalEquationCalculation": Element [5, 4] not within expected tolerance (delta 6.333660e-08): expected 0.003122, was 0.003122, tolerance 2.000000e-05 .

*** 2 failures are detected in the test module "Master Test Suite"
/Users/aleix/Documents/tudatBundle/tudat/bin/unit_tests/test_VariationalEquations exited with code 201

@DominicDirkx
Copy link
Member

These failures seem to be small rounding errors only. Could you check if the branch you are on is fully up to date with the Tudat repository, and if so, open a new issue for these failures?

@magnific0
Copy link
Member

I'm reopening the issue as it wasn't solved completely. On a fresh build of boost the problem is not there and all tests run. However, if cmake is ran followed by make, all unit tests result in segmentation faults. Closer inspection using otool revealed that the dynamic version of libboost_unit_test_framework-mt.dylib is added to the binaries dynamic library list. Even though it was compiled with the static version before.

The CMakeCache.txt on first and second run remain unaltered, so it is likely an uncached variable inside add_boost.cmake that is causing a change in this behaviour.

I will be working on a fix for this and update here.

The solution for the time being is to remove all ".dylibs" from the stage/lib folder, which should not trigger CMake into rebuilding boost, but prefer the static versions of the libraries instead.

@DominicDirkx
Copy link
Member

The fix has been merged, so this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants