Hi Igor,<br><br><div class="gmail_quote">On Thu, Feb 10, 2011 at 1:03 AM, 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;">
<div class="im"><br>
On 9 February 2011 20:04, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt; That&#39;s essentially what I see but the variability isn&#39;t between cmake and configure but between different runs of configure.  For example, you&#39;ll see that I released 2259 (SimpleStackBasedCogit) and 2361 (StackToRegisterMappingCogit) at the weekend.  That&#39;s because 2360 which had -O2 for gcc3x-cointerp.c crashed on startup on my test case (Squeak4.2-10856-beta.image) in one of the early performs as classes are sent startUp: on startup.  So I lowered optimization, checked-in 2361, built, checked it didn&#39;t crash and released.  However, now I try and rebuild exactly the same sources but using -O2 for gcc3x-cointerp.c I can&#39;t get it to crash.  This is exactly analogous to a few weeks back when I was convinced that the optimization level of the heartbeat caused it to crash if at -O2.  When Andreas asked me to reproduce on the internal Teleplace build I couldn&#39;t get it to repeat.  So something is very odd indeed, sensitive perhaps to the timestamp in the executable or some such.  However, now at least I know what I&#39;m looking for and the next tie I build somethign that crashes on the test case I will attempt to debug.<br>

&gt;<br>
&gt;<br>
<br>
</div>I tried today with debug info enabled (all source files are compiled with:<br>
<br>
compilerFlags<br>
<br>
        ^ &#39;-g3 -O1 -msse2 -D_GNU_SOURCE -DDEBUG -DITIMER_HEARTBEAT=1<br>
        -DNO_VM_PROFILE=1 -DCOGMTVM=0 -DDEBUGVM=1&#39;<br>
<br>
)<br>
<br></blockquote><div><br></div><div>please change that to include -save-temps.  We can then see what the generated assembly and object files are and that will really help analyse.  Also, can you somehow freeze this source so that we can repeat the compilation exactly?  i.e. avoid generating a different version.c with a different date in it.  We must try and repeat the compilation exactly with no temporal or path-derived artifacts.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
sig@sig-VirtualBox:~/vmbuild/build$ ./results/Cog  ./generator.image<br>
ioFindExternalFunctionIn(display_X11, 0x676918):<br>
  ./results/Cog: undefined symbol: display_X11<br>
ioFindExternalFunctionIn(sound_OSS, 0x676918):<br>
  ./results/Cog: undefined symbol: sound_OSS<br>
ioFindExternalFunctionIn(sound_MacOSX, 0x676918):<br>
  ./results/Cog: undefined symbol: sound_MacOSX<br>
ioFindExternalFunctionIn(sound_Sun, 0x676918):<br>
  ./results/Cog: undefined symbol: sound_Sun<br>
ioFindExternalFunctionIn(sound_pulse, 0x676918):<br>
  ./results/Cog: undefined symbol: sound_pulse<br>
ioFindExternalFunctionIn(sound_ALSA, 0x676918):<br>
  ./results/Cog: undefined symbol: sound_ALSA<br>
ioLoadModule(/home/sig/vmbuild/build/results/vm-sound-ALSA):<br>
  /home/sig/vmbuild/build/results/vm-sound-ALSA: undefined symbol:<br>
snd_mixer_selem_has_playback_volume<br>
ioFindExternalFunctionIn(sound_null, 0x676918):<br>
  ./results/Cog: undefined symbol: sound_null<br>
uxAllocateMemory: pageSize 0x1000 (4096), mask 0xfffff000<br>
uxAllocateMemory: /dev/zero descriptor -1<br>
uxAllocateMemory: min heap 39664660, desired 58539092<br>
uxAllocateMemory: mapping 0x40000000 bytes (1024 Mbytes)<br>
<br>
(frameNumArgs((page-&gt;baseFP))) == numArgs 19611<br>
<br>
((((aPage-&gt;baseFP)) + (frameStackedReceiverOffset((aPage-&gt;baseFP)))) +<br>
(2 * BytesPerWord)) == ((aPage-&gt;baseAddress)) 43641<br>
<br>
validStackPageBaseFrames() 19637<br>
<br>
(frameNumArgs(localFP)) == GIV(argumentCount) 4985<br>
<br>
!(frameIsBlockActivation(localFP)) 4986<br>
<br>
(frameNumArgs(localFP)) == GIV(argumentCount) 4985<br>
<br>
!(frameIsBlockActivation(localFP)) 4986<br>
<br>
(frameNumArgs(localFP)) == GIV(argumentCount) 4985<br>
<br>
!(frameIsBlockActivation(localFP)) 4986<br>
<div class="im"><br>
Segmentation fault<br>
<br>
<br>
<br>
Smalltalk stack dump:<br>
</div>0xbfeb4f6c I [] in MessageNotUnderstood&gt;message: 2032401548: a(n)<br>
MessageNotUnderstood<br>
0xbfeb4f9c I [] in UndefinedObject(Object)&gt;doesNotUnderstand:<br>
2004271108: a(n) UndefinedObject<br>
0xbfeb4fc4 I [] in UndefinedObject(Object)&gt;mustBeBooleanIn:<br>
2004271108: a(n) UndefinedObject<br>
0xbfeb4fe8 I UndefinedObject(Object)&gt;mustBeBoolean 2004271108: a(n)<br>
UndefinedObject<br>
0xbfeb5014 I [] in SmalltalkImage&gt;snapshot:andQuit:embedded:<br>
2006539444: a(n) SmalltalkImage<br>
2032008288 s SmalltalkImage&gt;snapshot:andQuit:<br>
2032008176 s WorldState class&gt;saveAndQuit<br>
2032008064 s [] in ToggleMenuItemMorph(MenuItemMorph)&gt;invokeWithEvent:<br>
2032007972 s BlockClosure&gt;ensure:<br>
2032007880 s CursorWithMask(Cursor)&gt;showWhile:<br>
2032007676 s ToggleMenuItemMorph(MenuItemMorph)&gt;invokeWithEvent:<br>
2032007584 s ToggleMenuItemMorph(MenuItemMorph)&gt;mouseUp:<br>
2032007492 s ToggleMenuItemMorph(MenuItemMorph)&gt;handleMouseUp:<br>
2032007356 s MouseButtonEvent&gt;sentTo:<br>
2032007264 s ToggleMenuItemMorph(Morph)&gt;handleEvent:<br>
2032007172 s MorphicEventDispatcher&gt;dispatchDefault:with:<br>
2032007080 s MorphicEventDispatcher&gt;dispatchEvent:with:<br>
2032006988 s ToggleMenuItemMorph(Morph)&gt;processEvent:using:<br>
2032006896 s MorphicEventDispatcher&gt;dispatchDefault:with:<br>
2032006788 s MorphicEventDispatcher&gt;dispatchEvent:with:<br>
2032006652 s MenuMorph(Morph)&gt;processEvent:using:<br>
2032006560 s MenuMorph(Morph)&gt;processEvent:<br>
2032006468 s MenuMorph&gt;handleFocusEvent:<br>
2032006376 s [] in HandMorph&gt;sendFocusEvent:to:clear:<br>
2032006284 s [] in PasteUpMorph&gt;becomeActiveDuring:<br>
2032006116 s BlockClosure&gt;on:do:<br>
2032005932 s PasteUpMorph&gt;becomeActiveDuring:<br>
2032005840 s HandMorph&gt;sendFocusEvent:to:clear:<br>
2032005748 s HandMorph&gt;sendEvent:focus:clear:<br>
2032005656 s HandMorph&gt;sendMouseEvent:<br>
2032005564 s HandMorph&gt;handleEvent:<br>
2032005288 s HandMorph&gt;processEvents<br>
2032005196 s [] in WorldState&gt;doOneCycleNowFor:<br>
2032005104 s Array(SequenceableCollection)&gt;do:<br>
2032005012 s WorldState&gt;handsDo:<br>
2032004920 s WorldState&gt;doOneCycleNowFor:<br>
2032004792 s WorldState&gt;doOneCycleFor:<br>
2032004700 s PasteUpMorph&gt;doOneCycle<br>
2006915672 s [] in Project class&gt;?<br>
2006915544 s [] in BlockClosure&gt;?<br>
<br>
Most recent primitives<br>
basicNew<br>
Aborted<br>
<br>
<br>
So, it looks like something are not initialized correctly..<br>
<div class="im"><br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Any ideas?<br>
&gt;<br>
&gt; If you can get cmake to run with the same flags as configure (!making sure to use -save-temps so we can look at generated assembler and object files!) and you can get one or other to crash on start-up then one can compare the two and hopefully find the elusive bug.<br>

&gt;<br>
<br>
</div>I just uploaded a fix for config which can build Cog VM:<br>
<br>
CMakeVMMaker-IgorStasenko.24<br>
<br>
load it into your image and issue<br>
<br>
CogUnixConfig generate<br>
<br>
or<br>
<br>
CogDebugUnixConfig generate<br>
<br>
<br>
<br>
it will generate cmake files in ../build directory (relative to<br>
image&#39;s current dir).<br>
(also you can use  #generateWithSources to generate VMMaker sources<br>
along with build config)<br>
<br>
<br>
cd to it, and do<br>
cmake . &amp;&amp; make<br>
<br>
in results subdir you will find the built artifacts.<br>
<div class="im"><br>
<br>
&gt;&gt;<br>
&gt;&gt; I am really don&#39;t like having VM which stability depends on some<br>
&gt;&gt; little flag(s).. and i guess you too.<br>
&gt;<br>
&gt; Damn right!!  Except it /doesn&#39;t/ depend on the optimization.  It is more subtle than that.  For example there was one build which Martin Kobetic found would crash on startup if the image path was something like /st/squeak/cog/myimage.image but not if it was /some/network/drive/and/hence/much/longer/myimage.image.<br>

&gt;<br>
&gt; confused, bewildered and disquieted,<br>
&gt; Eliot<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Best regards,<br>
&gt;&gt; Igor Stasenko AKA sig.<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
</div>--<br>
<div><div></div><div class="h5">Best regards,<br>
Igor Stasenko AKA sig.<br>
</div></div></blockquote></div><br>