From 6dc22e0bc8d7ec382aee512875086e20bfc2ed2f Mon Sep 17 00:00:00 2001 From: Berk Hess Date: Mon, 22 Jun 2020 17:27:29 +0200 Subject: [PATCH] Fix tpxio function type update table Fix order to incrementing function type. Likely certain older tpr files would have been read incorrectly, usually lead to a memory allocation error. --- docs/release-notes/2020/2020.3.rst | 6 ++++++ src/gromacs/fileio/tpxio.cpp | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/release-notes/2020/2020.3.rst b/docs/release-notes/2020/2020.3.rst index 444007c776..dc9f220f18 100644 --- a/docs/release-notes/2020/2020.3.rst +++ b/docs/release-notes/2020/2020.3.rst @@ -19,6 +19,12 @@ Fixes where mdrun could behave incorrectly Fixes for ``gmx`` tools ^^^^^^^^^^^^^^^^^^^^^^^ +Fix incorrect reading of certain older tpr files +"""""""""""""""""""""""""""""""""""""""""""""""" + +Certain older tpr files could be read incorrectly, usually leading to an exit +with a memory allocation error. + Fix segmentation fault with gmx lie """"""""""""""""""""""""""""""""""" diff --git a/src/gromacs/fileio/tpxio.cpp b/src/gromacs/fileio/tpxio.cpp index db5d9d6864..b5906dca12 100644 --- a/src/gromacs/fileio/tpxio.cpp +++ b/src/gromacs/fileio/tpxio.cpp @@ -3,7 +3,8 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team. + * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -203,10 +204,12 @@ static const t_ftupd ftupd[] = { { 72, F_GBPOL_NOLONGERUSED }, { 72, F_NPSOLVATION_NOLONGERUSED }, { 93, F_LJ_RECIP }, + { 76, F_ANHARM_POL }, { 90, F_FBPOSRES }, + { tpxv_VSite2FD, F_VSITE2FD }, + { tpxv_GenericInternalParameters, F_DENSITYFITTING }, { 69, F_VTEMP_NOLONGERUSED }, { 66, F_PDISPCORR }, - { 76, F_ANHARM_POL }, { 79, F_DVDL_COUL }, { 79, @@ -218,8 +221,6 @@ static const t_ftupd ftupd[] = { }, { 79, F_DVDL_RESTRAINT }, { 79, F_DVDL_TEMPERATURE }, - { tpxv_GenericInternalParameters, F_DENSITYFITTING }, - { tpxv_VSite2FD, F_VSITE2FD }, }; #define NFTUPD asize(ftupd) -- 2.11.4.GIT