<br><br><div class="gmail_quote">On Sun, Dec 11, 2011 at 6:46 AM, David T. Lewis <span dir="ltr">&lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.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="HOEnZb"><div class="h5"><br>
On Sat, Dec 10, 2011 at 05:38:24PM +0100, Mariano Martinez Peck wrote:<br>
&gt;<br>
&gt; On Sat, Dec 10, 2011 at 5:34 PM, David T. Lewis &lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt; On Sat, Dec 10, 2011 at 03:58:29PM +0100, Mariano Martinez Peck wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; On Sat, Dec 10, 2011 at 2:16 AM, David T. Lewis &lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>&gt;<br>
&gt; &gt; wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; This looks like a nasty bug in the plugin, but I cannot reproduce it.<br>
&gt; &gt; &gt; &gt; I have Fuel loaded in my Squeak image running on Linux, and I ran<br>
&gt; &gt; &gt; &gt; FLMethodContextSerializationTest&gt;&gt;testMethodContextThisContext without<br>
&gt; &gt; &gt; &gt; a crash. I tried it on both Cog and a standard VM, and did not get<br>
&gt; &gt; &gt; &gt; a crash in either case. The test fails (probably for some Squeak/Pharo<br>
&gt; &gt; &gt; &gt; issue)<br>
&gt; &gt; &gt; &gt; but it gets through the serialize/materialize part of the test without<br>
&gt; &gt; &gt; &gt; any problem.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Am I perhaps running a different version of Fuel that does not<br>
&gt; &gt; &gt; &gt; exercise the ZipPlugin in the same way?<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; Yes, exactly. Sorry for not saying that before. If you want to reproduce<br>
&gt; &gt; &gt; it, you must also install the package FuelCompression and then change<br>
&gt; &gt; &gt; FLSerializationTest &gt;&gt; #setUp  to send the message #useGzipInMemoryStream<br>
&gt; &gt; &gt; rather than #useStandardFileStream. Now if you run<br>
&gt; &gt; &gt; #testMethodContextThisContext it would do it using a GZip stream.<br>
&gt; &gt;<br>
&gt; &gt; I loaded this in my Squeak image on Linux and can now confirm the<br>
&gt; &gt; crash for both Cog and standard interpreter VM.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; Thanks Dave for the confirmation. We haven&#39;t use GZip before so I hope we<br>
&gt; are not doing something wrong ourselfs.<br>
&gt;<br>
<br>
</div></div>This is starting to look like an interesting bug. There certainly is<br>
some kind of problem in the serialization phase of the Fuel test, but<br>
of course it is hard to debug that when the VM is crashing.<br></blockquote><div><br>Yes! What should happen with that test is that it should fail because it doesn&#39;t find an instVar called &#39;testSelector&#39;. If that happens, then it is perfect ;)<br>
this is because of something we have recently changed and we need to fix it. <br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Good news: I figured out how to make it stop crashing, which should<br>
make it possible for you to go back to debugging your Fuel test.<br>
<br>
Bad news: The way to make the VM stop crashing is to compile it with<br>
optimization turned off. That means that perhaps the plugin itself<br>
is not directly at fault, but maybe it is something induced by gcc<br>
optimization. Or possibly the reverse, it may be a bug in the plugin<br>
that is exposed by the optimizer.<br>
<br>
I found this by accident because I built a VM with debugging on and<br>
optimization off so that I would be able to catch the crash in a<br>
debugger. Wonder of wonders, it stopped crashing. Specifically, it<br>
worked with &#39;CFLAGS=-g&#39; and it crashes with &#39;CFLAGS=-g -O1&#39; or with<br>
&#39;CFLAGS=-g -O2&#39;.<br>
<br>
The issue is specific to the plugin itself. If I compile the VM with<br>
optimization on, and the plugin with optimization off, then there<br>
is no crash.<br>
<br></blockquote><div><br>Thanks Dave for digging in the issue. I tried to do the same as you did with the CMakeVMMaker but I it cashed anyway, so I think I am doing something wrong here.<br>Igor, could you take a look?  I have implemented:<br>
<br>configureDeflatePlugin: maker<br><br>    maker addDefinitions: &#39;-g -O0&#39;.<br>    <br><br>Which generates the following CMakeLists.txt:<br><br># This is automatically generated file using CogMTCocoaIOSConfig on 11 December 2011 1:38:27 pm<br>
cmake_minimum_required(VERSION 2.6.2)<br>include(CMakeDetermineSystem)<br>project(&quot;ZipPlugin&quot;)<br>include(../directories.cmake)<br>set(CMAKE_CONFIGURATION_TYPES Release)<br>message(&quot;Adding internal plugin: ZipPlugin&quot;)<br>
set(pluginName &quot;ZipPlugin&quot;)<br>set(pluginSrc &quot;${srcPluginsDir}/ZipPlugin&quot;)<br>set(pluginCross &quot;${crossDir}/plugins/ZipPlugin&quot;)<br>set(pluginPlatform &quot;${targetPlatform}/plugins/ZipPlugin&quot;)<br>
add_definitions(-DSQUEAK_BUILTIN_PLUGIN)<br>list(APPEND sources  &quot;${pluginSrc}/ZipPlugin.c&quot;)<br>include_directories(${pluginSrc} ${pluginCross} ${targetPlatform}/plugins/${pluginName})<br><span style="background-color:rgb(255,255,0)">add_definitions(-arch i386 -mmacosx-version-min=10.4 -DHAVE_UUID_GENERATE -g3 -O0 -msse3 -funroll-loops -fasm-blocks -finline-functions -mfpmath=sse -march=pentium-m -falign-functions=16 -fno-gcse -fno-cse-follow-jumps -std=gnu99 -DBUILD_FOR_OSX -DUSE_INLINE_MEMORY_ACCESSORS -DLSB_FIRST -DHAVE_SYS_TIME_H -DHAVE_NANOSLEEP -DDEBUGVM=1 -DCOGMTVM=1 -DUSE_GLOBAL_STRUCT=0 -DBASE_HEADER_SIZE=4 -DCOGVM)</span><br>
<span style="background-color:rgb(255,255,0)">add_definitions(-g -O0)</span><br>add_library(ZipPlugin STATIC ${sources})<br>set(CMAKE_OSX_ARCHITECTURES i386)<br>set_target_properties(ZipPlugin PROPERTIES COMPILE_FLAGS &quot;-include \&quot;/Users/mariano/Pharo/VM/git/cogVMBlessedSSH/blessed/build/CogMTVM_Prefix.pch\&quot;&quot;)<br>
set_target_properties(ZipPlugin PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER &quot;${buildDir}/CogMTVM_Prefix.pch&quot;)<br>set_property(TARGET ZipPlugin PROPERTY LINK_FLAGS &quot;${linkFlags}&quot;)<br><br><br>Thanks<br>
 </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I am using:<br>
Linux version 2.6.34.7-0.7-desktop (geeko@buildhost) (gcc version 4.5.0 20100604 [gcc-4_5-branch revision 160292] (SUSE Linux) ) #1 SMP PREEMPT 2010-12-13 11:13:53 +0100<br>
<br>
This is with a standard interpreter VM compiled with gcc 4.5.0. I did<br>
not try reproducing this with Cog, but since the previously reported<br>
symptoms were basically the same for both Cog and the interpreter VM,<br>
I expect that turning off optimization for the ZipPlugin will give the<br>
same result for Cog.<br>
<br>
Dave<br>
<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br><br>