Project

General

Profile

Bug #2871

Updated by Mark Abraham 10 months ago

grompp crashes with a SIGSEGV when reading an input file with the annealing-* commands making annealing unusable.

The culprit is src/gromacs/gmxpreprocess/readir.cpp

In revision fe1788de the way in which these commands are read were changed introducing an error in reading the floating point values for anneal-time and anneal-temp into opts.anneal_{time,temp}, they are being put in memory location 0.
I think the problem is still there in all subsequent versions.

The following patch fixes the problem (I was not able to attach a file to this bug report)

<pre>
diff --git a/src/gromacs/gmxpreprocess/readir.cpp b/src/gromacs/gmxpreprocess/readir.cpp
index f9b1f27e2..85e0393df 100644
--- a/src/gromacs/gmxpreprocess/readir.cpp
+++ b/src/gromacs/gmxpreprocess/readir.cpp
@@ -3396,8 +3396,18 @@ void do_index(const char* mdparin, const char *ndx,
simulatedAnnealingTemperatures.size(), k);
}

- convertReals(wi, simulatedAnnealingTimes, "anneal-time", ir->opts.anneal_time[i]);
- convertReals(wi, simulatedAnnealingTemperatures, "anneal-temp", ir->opts.anneal_temp[i]);
+ for (i = 0, k = 0; i < nr; i++)
+ {
+ std::vector<std::string> temps(simulatedAnnealingTemperatures.begin(),
+ simulatedAnnealingTemperatures.begin() + ir->opts.anneal_npoints[i]);
+ std::vector<std::string> times(simulatedAnnealingTimes.begin(),
+ simulatedAnnealingTimes.begin() + ir->opts.anneal_npoints[i]);
+
+ convertReals(wi, times, "anneal-time", ir->opts.anneal_time[i]);
+ convertReals(wi, temps, "anneal-temp", ir->opts.anneal_temp[i]);
+ k += ir->opts.anneal_npoints[i];
+ }
+
for (i = 0, k = 0; i < nr; i++)
{
for (j = 0; j < ir->opts.anneal_npoints[i]; j++)

</pre>


Back