AMICI-dev / AMICI

Advanced Multilanguage Interface to CVODES and IDAS
https://amici.readthedocs.io/
Other
110 stars 31 forks source link

Fix crashes when errors occur at output timepoints #2555

Closed dweindl closed 1 month ago

dweindl commented 1 month ago

Fixes a bug that lead to program termination if a root-after-reinitialization error (potentially also others) occurred at an output timepoint, because an non-existing/invalid SimulationState for that timepoint was accessed. See #2491 for further details.

Fixes #2491.

Also avoid some unnecessary copying (during which previously the segfault occurred if this bug triggered in non-debug builds).

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 77.74%. Comparing base (fbe3840) to head (1618466). Report is 2 commits behind head on develop.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2555/graphs/tree.svg?width=650&height=150&src=pr&token=1bt9lbspzk&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev)](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2555?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev) ```diff @@ Coverage Diff @@ ## develop #2555 +/- ## =========================================== - Coverage 77.75% 77.74% -0.01% =========================================== Files 325 325 Lines 21852 21858 +6 Branches 1473 1473 =========================================== + Hits 16991 16994 +3 - Misses 4834 4837 +3 Partials 27 27 ``` | [Flag](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2555/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev) | Coverage Δ | | |---|---|---| | [cpp](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2555/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev) | `73.61% <100.00%> (-0.01%)` | :arrow_down: | | [cpp_python](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2555/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev) | `34.20% <41.66%> (-0.01%)` | :arrow_down: | | [petab](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2555/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev) | `37.07% <55.55%> (+0.01%)` | :arrow_up: | | [python](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2555/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev) | `72.40% <81.81%> (+0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2555?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev) | Coverage Δ | | |---|---|---| | [include/amici/forwardproblem.h](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2555?src=pr&el=tree&filepath=include%2Famici%2Fforwardproblem.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev#diff-aW5jbHVkZS9hbWljaS9mb3J3YXJkcHJvYmxlbS5o) | `100.00% <100.00%> (ø)` | | | [src/rdata.cpp](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2555?src=pr&el=tree&filepath=src%2Frdata.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev#diff-c3JjL3JkYXRhLmNwcA==) | `95.51% <100.00%> (-0.01%)` | :arrow_down: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/AMICI-dev/AMICI/pull/2555/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AMICI-dev)