Seg fault while loading restart file
GOMC version 2.6, compiled with Intel 19.1 on Centos 7.3. Segmentation fault observed when reading the attached restart files. Loading other restart files works ok. If these input files (PDB/PSF) are malformed, the code should gracefully throw an error message and terminate. core_dump.zip
Which ensemble is this run in?
Which ensemble is this run in?
Grand canonical ensemble.
The code is crashing because in DCRotateCOM.cpp on line 160, backBone is getting a value of (0.0, 0.0, 0.0) which results in an undefined invMatrix and this undefined value (NaN) gets propagated to the trial coordinates.
To reproduce, change in.conf to use PRNG INTSEED and Random_Seed 50 and trace what happens with molIndex = 1345.
It may be that the restart file was written with incorrect information or something is being initialized incorrectly from the restart file. Hopefully, this helps narrow down the problem. Note that the code didn't crash for a few other moves, including some with a molIndex > 1345.
@LSchwiebert Thank you. I am familiar with the DC algorithm producing NaN's in the intraswap move. I will look into this tomorrow.
When loading the coordinates from the restart file, there is a buffer overflow (read) in Coordinates.cpp when calculating the min value on line 42. The code is reading past the end of the array,, so the problem seems to be the setting of the end of the range. This may or may not be the cause of the crash, but should be fixed.
After digging into the code a bit more, I'm pretty sure that this is either a problem with how the Coordinates are being saved for restart or, more likely, being loaded. I'm assigning this to myself, as I have some initial progress. And I think Greg and Younes have more pressing items to work on.
Is it possible to provide the original input files that the simulation used? Ideally, it would be great to generate a restart file before any moves were accepted. We could compare this with the original pdb and psf files. That would tell us if the restart file is being written incorrectly.