<br><br><div class="gmail_quote">On Thu, Oct 21, 2010 at 6:35 PM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Hello,<br>
<br>
few weeks ago i reported that i experienced Cog VM crashes soon after<br>
starting it.<br>
I though that it could be related to pthread library, listed twice in<br>
GCC options..<br>
<br>
I was managed to build a stable VM but now i found that problem is not in that!<br>
The VM, which i was built were using debugging-enabled, with all<br>
bells&amp;whistles config..<br>
But once i tried a &#39;release&#39; config, the VM is crashing:<br>
<br>
../../platforms/unix/config/configure --without-vm-display-fbdev<br>
--without-npsqueak -prefix=/home/sig/cogvm/ CFLAGS=&quot;-g -O2 -msse2<br>
-D_GNU_SOURCE -DNDEBUG -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1<br>
-DCOGMTVM=0 -DDEBUGVM=0&quot;<br>
<br>
Then i tried to gradually change various options and foudn that this<br>
one produces stable VM:<br>
<br>
../../platforms/unix/config/configure --without-vm-display-fbdev<br>
--without-npsqueak -prefix=/home/sig/cogvm/ CFLAGS=&quot;-g -O1 -msse2<br>
-D_GNU_SOURCE -DNDEBUG -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1<br>
-DCOGMTVM=0 -DDEBUGVM=0&quot;<br>
<br>
(the difference is just an optimization option O2 vs O1 )<br>
<br>
It seems like a compiler related issue..<br>
Any ideas what wrong with O2?<br>
<br>
<br>
gcc --version<br>
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3<br>
Copyright (C) 2009 Free Software Foundation, Inc.<br>
This is free software; see the source for copying conditions.  There is NO<br>
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br></blockquote><div><br></div><div>I&#39;m pretty sure I use gcc 4.2.  You might want to try compiling the files (especially cointerp.c cogit.c sqUnixThreads.c) with -O1 one by one to localise the problem.  I&#39;ve seen problems with the cogit&#39;s use of alloca and if you look at the configure build system it forces compiling cogit.c with -O1.  If you&#39;re perhaps using CMake then you&#39;ll want to modify it to compile cogit.c with -O1 also.  The issue is the cogit&#39;s use of alloca which seems to confuse gcc.</div>
<div><br></div><div>HTH</div><div>Eliot</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<font color="#888888"><br>
<br>
--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
</font></blockquote></div><br>