[Vm-dev] Re: Xcode no longer includes gcc

David T. Lewis lewis at mail.msen.com
Thu Jan 12 01:56:53 UTC 2012


On Wed, Jan 11, 2012 at 08:25:14AM +0100, Stefan Marr wrote:
> 
> Hi:
> 
> Most of the things you'll find are undefined behavior in C.
> 
> I posted at least one issue to the list (I think it had to do with overflow in one of the arithmetic primitives, multiplication or so).

Indeed that was in interesting catch. The thread is here:
  <http://lists.squeakfoundation.org/pipermail/vm-dev/2011-July/008913.html>

It was added to an existing Mantis issue at:
  <http://bugs.squeak.org/view.php?id=6987>

And a fix was hopefully applied here:

  Name: VMMaker-dtl.245
  Author: dtl
  Time: 2 August 2011, 7:11:17.088 am
  Ancestors: VMMaker-dtl.244
  
  VMMaker 4.7.2
  
  Reference <http://lists.squeakfoundation.org/pipermail/vm-dev/2011-August/009006.html>
  Fix NewObjectMemory>>newObjectHash to use shiftForWord rather than bytesPerWord (check to ensure corresponding fix in oscog).
  
  Reference Mantis 6987: signed32BitValueOf:, signed64BitValueOf: etc. broken
  Discussion at <http://lists.squeakfoundation.org/pipermail/vm-dev/2011-July/008905.html>
  
  Fix #signed32BitValueOf: and #signed64BitValueOf: which are reported broken for some optimizing C compilers. Cast to unsigned integer to prevent undefined behavior on arithmetic overflow.
  
  Add InterpreterPrimitivesTest to provide some coverage of #signed64BitValueOf:
  
  Follow up required - Test to verify fix on problematic compilers. Merge with oscog.

It seems quite likely that other problems like this exist in the VM,
particularly in the slang generated code that tends to be a bit casual
when it come to type declarations.

If porting to LLVM helps flush out some more issues like this, that
would be a good thing :)

Dave


> 
> My strategy to fix these things for the RoarVM was to use a bytecode trace, output to a file. And you have to make sure that you got as few as possible non-determinism. For that I disabled preemptive scheduling completely.
> 
> Afterwards I had two VMs, one compiled with GCC, and one with Clang. And then fixed the issues as they popped up.
> 
> Takes a bit, but it is possible.
> The trace usually points at the bytecodes that behave incorrectly.
> 
> Hope that helps.
> Stefan
> 
> On 11 Jan 2012, at 02:22, John McIntosh wrote:
> 
> > At the Apple Developer conference in 2009 the nice Apple LLVM folks told me, can we have a "small" code sample that shows the problem... 
> > Fails on the old interpreter from that era, you should start with that, you don't actually need to step "too much" in order to get it to die btw.
> > 
> > On Tue, Jan 10, 2012 at 8:16 PM, Sean P. DeNigris <sean at clipperadams.com> wrote:
> > 
> > 
> > EstebanLM wrote
> > >
> > > gcc is still there...
> > >
> > 
> > Not with a fresh install of Xcode 4.2! See
> > http://ask.metafilter.com/200231/How-to-install-gcc-42-on-a-macbook-with-Xcode-42
> > 
> > I was able to get it and fix Xcode:
> > 1) install via Mac Ports: "sudo port install apple-gcc42"
> > 2) Follow http://stackoverflow.com/a/8593831/424245 to get it to appear in
> > Xcode, the last two steps will probably look like:
> >  a) sudo ln -s /opt/local/bin/gcc-apple-4.2 /Developer/usr/bin/gcc-4.2
> >  b) sudo ln -s /opt/local/bin/g++-apple-4.2 /Developer/usr/bin/g++-4.2
> > 
> > --
> > View this message in context: http://forum.world.st/Xcode-no-longer-includes-gcc-tp4283855p4284100.html
> > Sent from the Squeak VM mailing list archive at Nabble.com.
> > 
> > 
> > 
> > -- 
> > ===========================================================================
> > John M. McIntosh <johnmci at smalltalkconsulting.com>
> > Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
> > ===========================================================================
> > 
> > 
> > 
> 
> -- 
> Stefan Marr
> Software Languages Lab
> Vrije Universiteit Brussel
> Pleinlaan 2 / B-1050 Brussels / Belgium
> http://soft.vub.ac.be/~smarr
> Phone: +32 2 629 2974
> Fax:   +32 2 629 3525


More information about the Vm-dev mailing list