[squeak-dev] Re: [4.2] tests status

David T. Lewis lewis at mail.msen.com
Sun Dec 26 19:01:53 UTC 2010


On Sun, Dec 26, 2010 at 07:36:44PM +0100, Andreas Raab wrote:
> Hi David -
> 
> Can you try to compile an external FloatMathPlugin with CFLAGS=-O0 for 
> testing? I've found that some optimizations are problematic for the 
> FloatMathPlugin. On Windows, I've been compiling everything with -O0 for 
> this very reason and I wouldn't be surprised if that fixes it on Unix as 
> well.
> 
> Cheers,
>   - Andreas

Exactly so, I was just about to report back with the same conclusion.

I built a VM with sources from http://squeakvm.org/unix/release/Squeak-4.0.3.2202-src.tar.gz
and built it with '--CFLAGS='-m32 -g'.

  Result: Tests pass, no VM crash.

I then built a VM from the same source but with '--CFLAGS='-m32 -O2 -g' (i.e. compiler
optimization turned back on.

  Result: VM CRASH.

Going back to my more up to date VM (4.4.2-2329) I notice that I had compiled it
with optimizer off, so I rebuilt it with -O2 optimization.

  Result: VM CRASH.

Conclusion:

The FloatMathPlugin will crash the VM on some platforms when compiled with
gcc -O2 optimization (which would be the normal case).

Given the large installed base of VMs that are likely to have this concern,
it may be better to save the FloatMathPlugin fixes for the update stream
rather than including them in the official 4.2 release.

Note, I did not test any Cog VMs but I assume we will see the same issue on Cog.
I don't seem to have the FloatMathPlugin in the Cog VM on my machine, so perhaps
someone else can check this to verify.

Dave

> On 12/26/2010 7:17 PM, David T. Lewis wrote:
> >Some further detail:
> >
> >The test crashes the 4.0.3-2202 VM in iteration 21 of #testCos. Failure
> >occurs in the #cos send. The apparently identical call does not fail in a
> >workspace.
> >
> >The following workspace doit sets up the data exactly as it appears
> >within #testCos at iteration 21 immediately prior to the failure. When
> >running the test case, the crash occurs at the #cos call. When evaluated
> >in a workspace, it does not crash.
> >
> >   bytes := #[193 185 104 160 246 115 176 146].
> >   float := Float basicNew: 2.
> >   float basicAt: 1 put: (bytes unsignedLongAt: 1 bigEndian: true).
> >   float basicAt: 2 put: (bytes unsignedLongAt: 5 bigEndian: true).
> >   float cos ==>  1.0
> >
> >According to gdb, the crash is happening here:
> >
> >Program received signal SIGSEGV, Segmentation fault.
> >0x08097cc4 in __kernel_rem_pio2 (x=0x0, y=0x0, e0=0, nx=0, prec=0, 
> >ipio2=0x0)
> >     at 
> >     /home/piumarta/squeak/platforms/Cross/plugins/FloatMathPlugin/fdlibm/k_rem_pio2.c:246
> >(gdb) bt
> >#0  0x08097cc4 in __kernel_rem_pio2 (x=0x0, y=0x0, e0=0, nx=0, prec=0, 
> >ipio2=0x0)
> >     at 
> >     /home/piumarta/squeak/platforms/Cross/plugins/FloatMathPlugin/fdlibm/k_rem_pio2.c:246
> >#1  0x00000000 in ?? ()
> >(gdb)
> >
> >
> >I have not tried rebuilding this version of the VM from source, although 
> >that
> >might be a good next step.
> >
> >Dave
> >
> >
> >
> 



More information about the Squeak-dev mailing list