This follows the bug report in GROMACS forum here.
The bug lied in the name of the colvars restart file or (colvars input state file) which was abf_dihedral_state.dat so the line input_prefix_str.erase(input_prefix_str.rfind(".colvars.state")); crashed.
Furthermore, the function colvarmodule::setup_input():
https://github.com/Colvars/colvars/blob/351bfd2677186f2e0f1ad21050098c08d6db60c6/src/colvarmodule.cpp#L1346-L1351
doesn't handle the case when the suffix is .dat. (suffix .dat was introduced due to a limitation in file extension in mdrun).
This follows the bug report in GROMACS forum here.
The bug lied in the name of the colvars restart file or (colvars input state file) which was
abf_dihedral_state.dat
so the lineinput_prefix_str.erase(input_prefix_str.rfind(".colvars.state"));
crashed. Furthermore, the functioncolvarmodule::setup_input()
: https://github.com/Colvars/colvars/blob/351bfd2677186f2e0f1ad21050098c08d6db60c6/src/colvarmodule.cpp#L1346-L1351 doesn't handle the case when the suffix is.dat
. (suffix.dat
was introduced due to a limitation in file extension inmdrun
).So the most forward bugfix is to not strip the extension and let
setup_input()
takes the whole string as a filename. The downside is the variableinput_prefix_str
is also called incolvarmodule::print_total_forces_errning()
but according to @jhenin it's only called for code older than 2016 https://github.com/Colvars/colvars/blob/351bfd2677186f2e0f1ad21050098c08d6db60c6/src/colvarmodule.cpp#L1535(it's basically a revert of commit efac865ce0ce1cd070)