gmx solvate crashing or leaving gaps for hexagonal solvent box - Redmine #2148
Archive from user: Erik Marklund
e are trying to merge a box containing a peripheral membrane protein
with another box generated with memgen. Both boxes are hexagonal and
exactly the same size,Naively, we thought that gmx solvate -cp
protein.gro -cs membrane\_and\_water.pdb -o solvated.pdb would do the
trick. Unfortunately, this causes gmx solvate to crash:
Generating solvent configuration
Will generate new solvent configuration of 1x2x1 boxes
Solvent box contains 99373 atoms in 28208 residues
Removed 12253 solvent atoms due to solvent-solvent overlap
Removed 5122 solvent atoms due to solute-solvent overlap
Sorting configuration
Found 2 different molecule types:
POPE ( 52 atoms): 233 residues
SOL ( 3 atoms): 23294 residues
gmx(16892,0x7fffaa24f3c0) malloc: \* error for object 0x7fe36d0008f0:
pointer being freed was not allocated
\* set a breakpoint in malloc\_error\_break to debug
Abort trap: 6
So we then tried to remove the membrane, keeping only the water, and use
that system as the argument for -cs (gmx solvate -cp protein.gro -cs
only\_water.pdb -o poorly\_solvated.pdb). Gmx solvate doesn’t crash now,
but the output file has strange gaps of some size in the water parts,
which cannot be explained by the removed lipids. Can gmx solvate not
handle solvent boxes with non-orthogonal box vectors?
The whole point in doing it this way was to avoid water molecules being
inserted in the membrane. Perhaps overkill, but I am quite surprised at
how bad things went with gmx solvate.
The protein structure has a gap in the sequence. We are aware of that
and have corrected that, so no need to point that out.
*(from redmine: issue id 2148, created on 2017-03-28 by gmxdefault, closed on 2017-11-28)*
* Relations:
* relates #2151
* Changesets:
* Revision 8ea59db7b4c9633dd6fdae849e556e5564641249 by Teemu Murtola on 2017-04-06T13:08:38Z:
```
Fix memory access issues in gmx solvate
There were out-of-bounds access if
1) the solvent configuration was given as a .pdb file, or
2) there were more than one type of residue in the solvent (which
triggered sorting).
Also fix a memory leak in the sorting routine.
Should fix crashes mentioned in #2148.
Change-Id: If08a7bea989803dc5641f53478004e830268750d
```
* Revision 44909a43542f9cd926b723231d65d192141fb4f0 by Teemu Murtola on 2017-05-29T13:32:07Z:
```
Avoid some incorrect behavior with gmx solvate
gmx solvate cannot replicate non-rectangular solvent boxes correctly
(there are several different places that assume a diagonal box matrix),
so give a fatal error if that is attempted. To support some uses with
triclinic boxes, skip the replication step if the solvent and target box
sizes are already equal.
Support for general triclinic boxes can be added separately, and the
check introduced here can be valuable even in that case: it keeps a
pre-equilibrated solvent box intact if the target box size is the same.
Related to #2148.
Change-Id: I078df1f2279ccb758b11787becb89f5dbbbdfca7
```
* Uploads:
* [input_output.tar](/uploads/2ad80d323825c90077d23fd77a8485a5/input_output.tar) Input files and the strange output file
issue