tudat-team / tudat

A C++ platform to perform astrodynamics and space research.
BSD 3-Clause "New" or "Revised" License
17 stars 27 forks source link

Termination with hybrid condition, where only one is exact, makes code crash for non-exact condition #95

Open MiguelAvillez opened 2 years ago

MiguelAvillez commented 2 years ago

I have tried using an hybrid termination condition, where one of the conditions is based on a dependent variable, and the other is based on CPU time. I have only required one of the conditions to be satisfied to stop the propagation.

Both termination conditions work fine if the condition based on the dependent variable is not exact. If it is exact, everything also works fine if the end of the propagation is triggered by the condition based on the exact value of the dependent variable. However, if the end of the propagation is triggered by the CPU time the code crashes with Process finished with exit code 139 (interrupted by signal 11: SIGSEGV) Example of code triggering the issue is attached.

test_tudat_bundle.py.zip

DominicDirkx commented 1 year ago

I've made a small modification to the code, so that the iteration to an exact condition is only triggered if any of the conditions that are exceeded require an exact condition termination. I've checked your script, I was able to reproduce the issue, and it is now corrected.

I'll leave this issue open, as this case should be added to the unit tests: