<div dir="ltr">Hi,<div><br></div><div>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?</div>

<div><br></div><div>Roland</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Dec 5, 2013 at 3:13 PM, Mirco Wahab <span dir="ltr">&lt;<a href="mailto:mirco.wahab@chemie.tu-freiberg.de" target="_blank">mirco.wahab@chemie.tu-freiberg.de</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">File:<br>
src/gmxlib/gmxfio.c L.680<br>
<br>
* internal variant of get_file_md5 that operates on a locked file */<br>
static int gmx_fio_int_get_file_md5(t_fileio *fio, gmx_off_t offset,<br>
                                     unsigned char digest[])<br>
{<br>
     /*1MB: large size important to catch almost identical files */<br>
#define CPT_CHK_LEN  1048576<br>
     md5_state_t   state;<br>
     unsigned char buf[CPT_CHK_LEN];<br>
     gmx_off_t     read_len;<br>
     gmx_off_t     seek_offset;<br>
     int           ret = -1;<br>
<br>
Problem:<br>
The default stack size allocation Visual Studio 2012 is 1MB.<br>
The above code therefore will lead to stack corruption in<br>
some cases (it segfaulted).<br>
<br>
Solution (on 4.6.5):<br>
<br>
687c687<br>
&lt;     static unsigned char buf[CPT_CHK_LEN];<br>
---<br>
 &gt;     unsigned char buf[CPT_CHK_LEN];<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Gromacs Developers mailing list<br>
<br>
* Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" target="_blank">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before posting!<br>
<br>
* Can&#39;t post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" target="_blank">http://www.gromacs.org/Support/Mailing_Lists</a><br>
<br>
* For (un)subscribe requests visit<br>
<a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" target="_blank">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br>


<br>
<br>
<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>ORNL/UT Center for Molecular Biophysics <a href="http://cmb.ornl.gov">cmb.ornl.gov</a><br>865-241-1537, ORNL PO BOX 2008 MS6309
</div>