<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi, Iulian<br><br>I am sorry I can't be more helpful. It could be as you described, but I don't see any memory allocation happen in the the CCubitFile constructor. And myslef is not very familiar with memory management related to file read/write.<br><br>While Tim is there, I think he is the best one you can get help from.<br><br>Good luck!<br><br>Jane<br><br>--- On <b>Fri, 7/1/11, Iulian Grindeanu <i>&lt;iulian@mcs.anl.gov&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Iulian Grindeanu &lt;iulian@mcs.anl.gov&gt;<br>Subject: cgm-cubit on 32 bit machine<br>To: "Jiangtao Hu" &lt;jiangtao_ma@yahoo.com&gt;<br>Cc: cgma-dev@mcs.anl.gov<br>Date: Friday, July 1, 2011, 10:49 AM<br><br><div class="plainMail">Hi Jane,<br>I am trying to use cgm, cubit version on my laptop, and there is a
 crash when running<br><br>testgeom tridata1.cub. <br><br>This affects other tests in meshkit, which use cubit files as geometry sources.<br><br>The memory becomes corrupted (in the debugger) right when CCubitFile is instantiated<br>( NCubitFile::CCubitFile ccf;) , line 6360.<br>A variable that holds the string values for file types is defined above.<br>const char *model_type_str[6] = {"", "ACIS_SAT", "", "FACET", "", "GRANITE"};<br><br>After passing over ( NCubitFile::CCubitFile ccf;)&nbsp; in the debugger, model_type_str is corrupted.<br><br>Maybe tmpnam use is what causes the problem (some say that tmpnam should never be used on linux) I tried something else (like a hard-coded tmp file name) and it did not fix it. So I think we can rule out tmpnam.<br><br>Anyway, if I just declare a "buffer" after the file definition, like in<br>&nbsp; &nbsp;&nbsp;&nbsp;NCubitFile::CCubitFile ccf;<br>&nbsp; &nbsp; int buff[10]= {0};buff[1] =0;<br><br>the memory does
 not get corrupted, and testgeom tridata1.cub finishes fine.<br><br>So I am wondering if it is something wrong in CCubitFile object/constructor that corrupts the memory. <br><br>This does not show up on a 64 bit machine;<br><br>Any suggestions?<br><br>Iulian<br></div></blockquote></td></tr></table>