GOMC icon indicating copy to clipboard operation
GOMC copied to clipboard

Seg fault while loading restart file

Open jpotoff opened this issue 5 years ago • 7 comments

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

jpotoff avatar Jul 21 '20 04:07 jpotoff

Which ensemble is this run in?

GregorySchwing avatar Jul 21 '20 18:07 GregorySchwing

Which ensemble is this run in?

Grand canonical ensemble.

jpotoff avatar Jul 21 '20 19:07 jpotoff

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 avatar Aug 04 '20 01:08 LSchwiebert

@LSchwiebert Thank you. I am familiar with the DC algorithm producing NaN's in the intraswap move. I will look into this tomorrow.

GregorySchwing avatar Aug 04 '20 02:08 GregorySchwing

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.

LSchwiebert avatar Aug 12 '20 21:08 LSchwiebert

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.

LSchwiebert avatar Aug 20 '20 00:08 LSchwiebert

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.

LSchwiebert avatar Sep 17 '20 19:09 LSchwiebert