legacy forcefield files with GB trigger segfault
I just encountered a weird bug working off master:
Using an older toplogy / CHARMM ff file that included gb.itp, I got a segfault in gmx grompp as follows:
0x00000000006ebd44 in DS_Check_Order (DS=0x2f84a40, d=d@entry=d_implicit_genborn_params)
475 if (necessary[d] == d_none)
(gdb) print d
$1 = d_implicit_genborn_params
necessary[d] is a null pointer
commenting out the #include "gb" in the CHARMM forcefield.itp fixed this, but it seems we should handle the error more gracefully because people might try to run current gromacs on topologies they prepared previously.
Fix reading old force field files
Old force field files that contain fields suitable for explicit
solvent still need to be readable. grompp could already still read the
directives in old force field files and ignore them. However, when
they are read, grompp still needs to understand that they are in a
valid place within the .top file structure. While any place is now
valid (because the contents are ignored), it is simplest to keep the
former requirement, since all files that worked with older GROMACS had
to conform with that requirement.
That requirement was removed in the patch that removed implicit
solvent support Ib241555ff3d8, and it should not have been removed.
I left a comment noting that this is a legacy constraint, not a
necessary one. But probably we'll rewrite topology handling before we
would ever care.
#2 Updated by Mark Abraham over 2 years ago
Thanks. Certainly we should skip such directives gracefully, but I don't recall whether I tested it explicitly. Perhaps the removals at https://gerrit.gromacs.org/c/7477/4/src/gromacs/gmxpreprocess/topdirs.cpp#b369 were overzealous.