When reading an xtc file with multiple frames, only the coordinates of the last conformer are valid.
I think it is happening because the destructor of the vector confs is being called whenever a frame is finished being read and the array that stores the atomic coordinates for that frame is freed. Meanwhile the pointer to that (now unallocated) array is stored in vconf and then in the OBMol object.
See http://sourceforge.net/p/openbabel/code/HEAD/tree/openbabel/trunk/src/formats/xtcformat.cpp#l187
So whenever I try accessing the conformer coordinates after reading them from an xtc file, I see a partially overwritten array.
This may also be related to bug #745, if the OBMol destructor is trying to free the already freed arrays of conformer coordinates. I mention this because I'm getting similar behavior from calling OBMol.Clear() at the end of my test.
libopenbabel version: 2.3.2+dfsg-1.1, from Ubuntu 14.04 repository
I managed to fix the memory issues in my local working copy of the trunk. OBMol::Clear() now completes fine too. Here is the output of diff:
I don't have the permissions to commit this though.
Last edit: zetadin 2015-05-22