On Fri, 30 Sep 2005, Andy Dougherty wrote:

> On Fri, 30 Sep 2005, Leopold Toetsch via RT wrote:
> 
> > Andy Dougherty (via RT) wrote:
> > 
> > > With a a fresh checkout (r9274) I get a number of errors where parrot 
> > > eventually
> > > gobbles up all the memory on the system.  Here's the first such one:
> > > 
> > > t/op/gc........................
> > > #     Failed test (t/op/gc.t at line 279)
> > 
> > > # './parrot  --gc-debug 
> > > "/home/doughera/src/parrot/parrot-andy/t/op/gc_13.pir"' failed with exit 
> > > code 131
> > > # Looks like you failed 1 test of 22.
> > 
> > Strange. The test succeeds on linux/86 and OS/X 10.3 darwin. Running it 
> > through valgrind on the linux box doesn't show any indication of an error.

Ok, I've finally found the cause of this one, but I don't have a portable 
patch at hand.

Buried in amongst the 6827 warnings emitted by gcc is one that actually 
correctly identifies the problem:

  src/inter_create.c:400: warning: dereferencing type-punned pointer will 
      break strict-aliasing rules

And indeed that appears to be the problem.  You can even reproduce the 
problem under Linux/x86 with gcc-3.4 or newer.  Simply compile with 
optimization level of -O3.

The *temporary workaround* for *gcc only* is to supply gcc with the 
-fno-strict-aliasing flag.

For those not familiar with aliasing, I found this article

    http://mail-index.netbsd.org/tech-kern/2003/08/11/0001.html

to be useful.  Another relevant page (specific to gcc) is at

    http://gcc.gnu.org/bugs.html#nonbugs_c

Hope this helps,

-- 
    Andy Dougherty              [EMAIL PROTECTED]

Reply via email to