[Vm-dev] Re: [Pharo-project] GZipWriteStream crashing my VM when serializing ?

Mariano Martinez Peck marianopeck at gmail.com
Sun Dec 11 13:10:25 UTC 2011


On Sun, Dec 11, 2011 at 6:46 AM, David T. Lewis <lewis at mail.msen.com> wrote:

>
> On Sat, Dec 10, 2011 at 05:38:24PM +0100, Mariano Martinez Peck wrote:
> >
> > On Sat, Dec 10, 2011 at 5:34 PM, David T. Lewis <lewis at mail.msen.com>
> wrote:
> >
> > >
> > > On Sat, Dec 10, 2011 at 03:58:29PM +0100, Mariano Martinez Peck wrote:
> > > >
> > > > On Sat, Dec 10, 2011 at 2:16 AM, David T. Lewis <lewis at mail.msen.com
> >
> > > wrote:
> > > >
> > > > > This looks like a nasty bug in the plugin, but I cannot reproduce
> it.
> > > > > I have Fuel loaded in my Squeak image running on Linux, and I ran
> > > > > FLMethodContextSerializationTest>>testMethodContextThisContext
> without
> > > > > a crash. I tried it on both Cog and a standard VM, and did not get
> > > > > a crash in either case. The test fails (probably for some
> Squeak/Pharo
> > > > > issue)
> > > > > but it gets through the serialize/materialize part of the test
> without
> > > > > any problem.
> > > > >
> > > > > Am I perhaps running a different version of Fuel that does not
> > > > > exercise the ZipPlugin in the same way?
> > > > >
> > > > >
> > > > Yes, exactly. Sorry for not saying that before. If you want to
> reproduce
> > > > it, you must also install the package FuelCompression and then change
> > > > FLSerializationTest >> #setUp  to send the message
> #useGzipInMemoryStream
> > > > rather than #useStandardFileStream. Now if you run
> > > > #testMethodContextThisContext it would do it using a GZip stream.
> > >
> > > I loaded this in my Squeak image on Linux and can now confirm the
> > > crash for both Cog and standard interpreter VM.
> > >
> > >
> > Thanks Dave for the confirmation. We haven't use GZip before so I hope we
> > are not doing something wrong ourselfs.
> >
>
> This is starting to look like an interesting bug. There certainly is
> some kind of problem in the serialization phase of the Fuel test, but
> of course it is hard to debug that when the VM is crashing.
>

Yes! What should happen with that test is that it should fail because it
doesn't find an instVar called 'testSelector'. If that happens, then it is
perfect ;)
this is because of something we have recently changed and we need to fix
it.


>
> Good news: I figured out how to make it stop crashing, which should
> make it possible for you to go back to debugging your Fuel test.
>
> Bad news: The way to make the VM stop crashing is to compile it with
> optimization turned off. That means that perhaps the plugin itself
> is not directly at fault, but maybe it is something induced by gcc
> optimization. Or possibly the reverse, it may be a bug in the plugin
> that is exposed by the optimizer.
>
> I found this by accident because I built a VM with debugging on and
> optimization off so that I would be able to catch the crash in a
> debugger. Wonder of wonders, it stopped crashing. Specifically, it
> worked with 'CFLAGS=-g' and it crashes with 'CFLAGS=-g -O1' or with
> 'CFLAGS=-g -O2'.
>
> The issue is specific to the plugin itself. If I compile the VM with
> optimization on, and the plugin with optimization off, then there
> is no crash.
>
>
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.
Igor, could you take a look?  I have implemented:

configureDeflatePlugin: maker

    maker addDefinitions: '-g -O0'.


Which generates the following CMakeLists.txt:

# This is automatically generated file using CogMTCocoaIOSConfig on 11
December 2011 1:38:27 pm
cmake_minimum_required(VERSION 2.6.2)
include(CMakeDetermineSystem)
project("ZipPlugin")
include(../directories.cmake)
set(CMAKE_CONFIGURATION_TYPES Release)
message("Adding internal plugin: ZipPlugin")
set(pluginName "ZipPlugin")
set(pluginSrc "${srcPluginsDir}/ZipPlugin")
set(pluginCross "${crossDir}/plugins/ZipPlugin")
set(pluginPlatform "${targetPlatform}/plugins/ZipPlugin")
add_definitions(-DSQUEAK_BUILTIN_PLUGIN)
list(APPEND sources  "${pluginSrc}/ZipPlugin.c")
include_directories(${pluginSrc} ${pluginCross}
${targetPlatform}/plugins/${pluginName})
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)
add_definitions(-g -O0)
add_library(ZipPlugin STATIC ${sources})
set(CMAKE_OSX_ARCHITECTURES i386)
set_target_properties(ZipPlugin PROPERTIES COMPILE_FLAGS "-include
\"/Users/mariano/Pharo/VM/git/cogVMBlessedSSH/blessed/build/CogMTVM_Prefix.pch\"")
set_target_properties(ZipPlugin PROPERTIES
XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${buildDir}/CogMTVM_Prefix.pch")
set_property(TARGET ZipPlugin PROPERTY LINK_FLAGS "${linkFlags}")


Thanks


> I am using:
> Linux version 2.6.34.7-0.7-desktop (geeko at 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
>
> This is with a standard interpreter VM compiled with gcc 4.5.0. I did
> not try reproducing this with Cog, but since the previously reported
> symptoms were basically the same for both Cog and the interpreter VM,
> I expect that turning off optimization for the ZipPlugin will give the
> same result for Cog.
>
> Dave
>
>
>


-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20111211/1390c6d7/attachment.htm


More information about the Vm-dev mailing list