convert-tpr charge zeroing broken
The charge-zeroing -zeroq
function of convert-tpr is broken since ec5d2383 (relevant change here vs previous version here), which dates from 2008.
The index used in the zeroq()
function originates from get_index, and so it is a global atom index, not moltype-aware. This worked before because the old t_topology has a all-concatenated array for atoms.
Thus this causes array out-of-bound write, or incorrect atom charge-zeroing. (Confirmed with ASAN and gdb)
Attached is a tpr and index file. For reproduction, gmx convert-tpr -s em.tpr -o em_out.tpr -zeroq -n index.ndx
with group 12 (Water) selected will segfault.
Should this particular function of the tool be removed?
Edited by Eliane Briand