[gmx-developers] trajectory handling crash on windows (4.6.*)
roland at utk.edu
Sun Dec 8 06:09:12 CET 2013
I think right now the method is only called from MASTER so a static
variable would in theory work, but that is risky because it would fail if
we ever call this method from other threads. Thus I suggest to allocate
this data on the heap with snew. Can you upload a patch to gerrit?
On Thu, Dec 5, 2013 at 3:13 PM, Mirco Wahab <
mirco.wahab at chemie.tu-freiberg.de> wrote:
> src/gmxlib/gmxfio.c L.680
> * internal variant of get_file_md5 that operates on a locked file */
> static int gmx_fio_int_get_file_md5(t_fileio *fio, gmx_off_t offset,
> unsigned char digest)
> /*1MB: large size important to catch almost identical files */
> #define CPT_CHK_LEN 1048576
> md5_state_t state;
> unsigned char buf[CPT_CHK_LEN];
> gmx_off_t read_len;
> gmx_off_t seek_offset;
> int ret = -1;
> The default stack size allocation Visual Studio 2012 is 1MB.
> The above code therefore will lead to stack corruption in
> some cases (it segfaulted).
> Solution (on 4.6.5):
> < static unsigned char buf[CPT_CHK_LEN];
> > unsigned char buf[CPT_CHK_LEN];
> Gromacs Developers mailing list
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developersor send a mail to
> gmx-developers-request at gromacs.org.
ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
865-241-1537, ORNL PO BOX 2008 MS6309
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gromacs.org_gmx-developers