Open
Description
CVodeSVtolerances
allows to specify state-specific absolute tolerances with a vector. However, it does not check that the vector passed to the function actually has the correct length. When the vector has too few entries, it will simply access memory that does not belong to the vector.
This leads to really strange behavior that is very hard to debug because the solver sometimes fails to converge and sometimes does not with the same code (depending on what numbers coincidentally are in the memory section following the vector).
Maybe aborting in NVector
-operations when shapes mismatch would also make it easier to debug issues like this.
Tested with SUNDIALS version 5.8.0, but as far as I see the problem should still exist in 6.0.0.