mithun218 / GiNaCDE

GiNaC Differential Equation Solver
MIT License
9 stars 1 forks source link

First test fails #17

Open carstenbauer opened 2 years ago

carstenbauer commented 2 years ago

To get going with my JOSS review, I just installed GiNaCDE. While the installation itself went smoothly, running ctest led to a segfault for the first test (the second one passed):

➜  crstnbr@cbserver build-dir  ctest
Test project /home/crstnbr/sciebo/projects/build-dir
    Start 1: test1Run
1/2 Test #1: test1Run .........................***Exception: SegFault  0.45 sec
    Start 2: test2Run
2/2 Test #2: test2Run .........................   Passed   28.43 sec

50% tests passed, 1 tests failed out of 2

Total Test time (real) =  28.89 sec

The following tests FAILED:
          1 - test1Run (SEGFAULT)
Errors while running CTest

Is this expected? @peanutfun (hope you don't mind the ping here), did the tests pass for you?

mithun218 commented 2 years ago

Thanks @carstenbauer for pointing this error.

All the tests passed for me. But, like you, a few times I got same error (segfault error) running ctest. I observed that it happened during the solving of last differential equation listed in test1.cpp file.

The reasons for such error are:

As the GiNaC library might not return the exact same output of an expression due to some unpredictable internal ordering of symbols, the symbols in the same algebraic expressions may be ordered differently during each running session of the GiNaCDE program, and one can get different exact solutions of the differential equation. Therefore, during some running  session of ctest, when GiNaCDE solves last differential equation listed in test1.cpp file, it generates huge algebraic expressions which GiNaCDE cannot handle. For this reason the error reported by you is sometimes obtained. However, one can pass all the tests by running ctest repeatedly.

 For such ctest error, now I think it is better to remove the last differential equation listed in test1.cpp, as it tests GiNaCDE.

peanutfun commented 2 years ago

@carstenbauer, no worries! I did not experience this issue.

@mithun218, I assume from your explanation that this problem can occur for any equation one tries to solve. As far as I know, a segmentation fault causes the program to terminate instantly, without cleaning up the associated memory. Is there any way of catching these errors and throwing an exception instead? This would tell users what went wrong and would give the opportunity to "gracefully" shut the program down.