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

segfault in testOutput #177

Closed
alexkaapa opened this issue Feb 22, 2018 · 6 comments
Closed

segfault in testOutput #177

alexkaapa opened this issue Feb 22, 2018 · 6 comments
Assignees

Comments

@alexkaapa
Copy link

I tried to install CRPropa locally on our cluster. Up to ccmake .., everything worked fine. Afterwards, when doing "make test", the following error occured:

Running tests...
Test project /lustre/kaeaepae/Software/CRPropa/build
Start 1: testCore
1/14 Test #1: testCore ......................... Passed 0.46 sec
Start 2: testVector3
2/14 Test #2: testVector3 ...................... Passed 0.01 sec
Start 3: testModuleList
3/14 Test #3: testModuleList ................... Passed 0.38 sec
Start 4: testMagneticField
4/14 Test #4: testMagneticField ................ Passed 0.65 sec
Start 5: testAdvectionField
5/14 Test #5: testAdvectionField ............... Passed 0.36 sec
Start 6: testDINT
6/14 Test #6: testDINT ......................... Passed 0.42 sec
Start 7: testPropagation
7/14 Test #7: testPropagation .................. Passed 0.37 sec
Start 8: testBreakCondition
8/14 Test #8: testBreakCondition ............... Passed 0.37 sec
Start 9: testInteraction
9/14 Test #9: testInteraction .................. Passed 22.12 sec
Start 10: testSource
10/14 Test #10: testSource ....................... Passed 0.62 sec
Start 11: testOutput
11/14 Test #11: testOutput .......................***Exception: SegFault 0.39 sec
Start 12: testFunctionalGroups
12/14 Test #12: testFunctionalGroups ............. Passed 0.37 sec
Start 13: testAdiabaticCooling
13/14 Test #13: testAdiabaticCooling ............. Passed 0.37 sec
Start 14: testGalacticMagneticLens
14/14 Test #14: testGalacticMagneticLens ......... Passed 0.50 sec

93% tests passed, 1 tests failed out of 14

Total Test time (real) = 27.45 sec

The following tests FAILED:
11 - testOutput (SEGFAULT)
Errors while running CTest
make: *** [test] Error 8

Does anyone have a hunch what might be wrong with "testOutput"?

@adundovi
Copy link
Member

Run it individually like ./testOutput in the build directory and c/p here the output.

@alexkaapa
Copy link
Author

I get the following output:

Running main() from gtest_main.cc
[==========] Running 13 tests from 3 test cases.
[----------] Global test environment set-up.
[----------] 1 test from Output
[ RUN ] Output.size
[ OK ] Output.size (1 ms)
[----------] 1 test from Output (1 ms total)

[----------] 7 tests from TextOutput
[ RUN ] TextOutput.printHeader_Trajectory1D
[ OK ] TextOutput.printHeader_Trajectory1D (0 ms)
[ RUN ] TextOutput.printHeader_Event1D
[ OK ] TextOutput.printHeader_Event1D (0 ms)
[ RUN ] TextOutput.printHeader_Trajectory3D
[ OK ] TextOutput.printHeader_Trajectory3D (0 ms)
[ RUN ] TextOutput.printHeader_Event3D
[ OK ] TextOutput.printHeader_Event3D (1 ms)
[ RUN ] TextOutput.printHeader_Custom
[ OK ] TextOutput.printHeader_Custom (0 ms)
[ RUN ] TextOutput.printProperty
[ OK ] TextOutput.printProperty (0 ms)
[ RUN ] TextOutput.printHeader_Version
[ OK ] TextOutput.printHeader_Version (0 ms)
[----------] 7 tests from TextOutput (1 ms total)

[----------] 5 tests from ParticleCollector
[ RUN ] ParticleCollector.size
[ OK ] ParticleCollector.size (0 ms)
[ RUN ] ParticleCollector.fetchItem
[ OK ] ParticleCollector.fetchItem (34 ms)
[ RUN ] ParticleCollector.reprocess
[ OK ] ParticleCollector.reprocess (0 ms)
[ RUN ] ParticleCollector.dumpload
[ OK ] ParticleCollector.dumpload (3 ms)
[ RUN ] ParticleCollector.getTrajectory
Segmentation fault

@TobiasWinchen TobiasWinchen changed the title Problems when installing on cluster segfault in testOutput Feb 23, 2018
@adundovi
Copy link
Member

Tnx Alex. It seems that there is a memory management issue in the getTrajectory feature. In principle, it will not affect running CRPropa if you don't use ParticleCollector.getTrajectory().

But you can help me debug it if you want...
First, you need to recompile CRPropa with the debugging symbols enabled. In the cmake part add additional flag:

CMAKE_PREFIX_PATH=$CRPROPA_DIR cmake -DCMAKE_INSTALL_PREFIX=$CRPROPA_DIR -DCMAKE_BUILD_TYPE:STRING=Debug ..

(instead of CMAKE_PREFIX_PATH=$CRPROPA_DIR cmake -DCMAKE_INSTALL_PREFIX=$CRPROPA_DIR .. and don't forget to define CRPROPA_DIR)

After you recompile it, run GNU debugger:

gdb testOutput 

(enter start, continue and paste here the output when it segfaults).

@adundovi adundovi self-assigned this Feb 23, 2018
@alexkaapa
Copy link
Author

I copied the entire ouput:

Running main() from gtest_main.cc
[==========] Running 13 tests from 3 test cases.
[----------] Global test environment set-up.
[----------] 1 test from Output
[ RUN ] Output.size
[ OK ] Output.size (0 ms)
[----------] 1 test from Output (0 ms total)

[----------] 7 tests from TextOutput
[ RUN ] TextOutput.printHeader_Trajectory1D
[ OK ] TextOutput.printHeader_Trajectory1D (0 ms)
[ RUN ] TextOutput.printHeader_Event1D
[ OK ] TextOutput.printHeader_Event1D (1 ms)
[ RUN ] TextOutput.printHeader_Trajectory3D
[ OK ] TextOutput.printHeader_Trajectory3D (0 ms)
[ RUN ] TextOutput.printHeader_Event3D
[ OK ] TextOutput.printHeader_Event3D (0 ms)
[ RUN ] TextOutput.printHeader_Custom
[ OK ] TextOutput.printHeader_Custom (0 ms)
[ RUN ] TextOutput.printProperty
[ OK ] TextOutput.printProperty (0 ms)
[ RUN ] TextOutput.printHeader_Version
[ OK ] TextOutput.printHeader_Version (0 ms)
[----------] 7 tests from TextOutput (1 ms total)

[----------] 5 tests from ParticleCollector
[ RUN ] ParticleCollector.size
[ OK ] ParticleCollector.size (0 ms)
[ RUN ] ParticleCollector.fetchItem
[ OK ] ParticleCollector.fetchItem (4 ms)
[ RUN ] ParticleCollector.reprocess
[ OK ] ParticleCollector.reprocess (0 ms)
[ RUN ] ParticleCollector.dumpload
[ OK ] ParticleCollector.dumpload (3 ms)
[ RUN ] ParticleCollector.getTrajectory

Program received signal SIGBUS, Bus error.
0x000000000041a7a1 in crpropa::ParticleCollector_getTrajectory_Test::TestBody() ()

@adundovi
Copy link
Member

Can you give details on what hardware and OS you run it? I cannot reproduce the error and I don't see which pointer causes the segfault from this output.

@TobiasWinchen
Copy link
Member

I assume that this problem has been fixed by now as there has not been an update for three month. Please reopen if this is not the case.

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

No branches or pull requests

3 participants