Menu

#8 xyz_odeSolverBatch cause a core dump for ODE variable scans

open
nobody
9
2006-01-31
2006-01-31
No

Norihiro Kikuchi has reported that the function
SBML_odeSolverBatch or Model_odeSolverBatch causes a
core dump (segmentation fault) when batch variation for
an ODE variable (i.e. initial condition scan) is
requested. This occurs due to a double free in the
second run of the batch process by
IntegratorInstance_setVariableValue.

The bug can temporarily be fixed by adding the
following lines in file src/integratorInstance.c:

after line 740:
data->value[vi->index] = value;

add

if ( solver->t == 0.0 )
data->results->value[vi->index][0] = value;

This is required because initial values at time 0 are
written before integration starts and so these need to
be adapted to the new initial value, too.

then a few lines below after:

IntegratorInstance_freeCVODESolverStructures(engine);
solver->t0 = solver->t;

add

data->run = 0;

Setting data->run to 0 avoids the double free of the
solver structures, which happens when setting the
variable in the second run of the batch process.
However, the counter data->run is lost. If you don't
use it, this should not be a problem.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.