Skip to content

Out-of-bounds access in CVODE when vector of absolute tolerances has the wrong shape #108

Open
@astoeriko

Description

@astoeriko

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions