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

David T. Lewis lewis at mail.msen.com
Sun Dec 11 05:46:47 UTC 2011


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.

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.

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




More information about the Vm-dev mailing list