src/sys/vm/vm_init.c v1.43 hangs amd64

Doug White dwhite at gumbysoft.com
Sat May 1 08:42:46 PDT 2004


On Fri, 30 Apr 2004, Doug White wrote:

> I've been having problems with adm64 hanging under load on my dual opteron
> 244 machine. Its a HDAMA mainboard with 2GB RAM.  The problems started
> around April 8.  I finally found some time this week to narrow down the
> commit that causes the breakage; its rev 1.43 of src/sys/vm/vm_init.c.

Update to this.

1.  Peter and I kicked this around on IRC yesterday. He wasn't able to
reproduce it with a separate program, at least immediately.  We also did
some math and the numbers involved aren't large enough to be overflowing.

2.  Changing COPTFLAGS to '-O -frename-registers -pipe' from the default
'-O2 -frename-registers -pipe' stops the crash. So it may be an
O2-specific optimization bug.

3.  Assigning the values to a local variable doesn't seem to affect
things, although it allows for easier experimentation.  Using this, I
found that the parentheses around the multiplications affects the
crash.

First, I added these variables:

        vm_size_t nswbufsize;
        vm_size_t nbufsize;

then later assigned them:

        nbufsize = (nbuf*BKVASIZE);
        nswbufsize = (nswbuf*MAXPHYS);

and changed the size argument to kmem_suballoc()  to use the variables
instead of the expressions directly.  This setup triggers the crash.

Removing the parentheses from the variable assignments:

        nbufsize = nbuf*BKVASIZE;
        nswbufsize = nswbuf*MAXPHYS;

stops the crash.

So in the end, at -O2, (nswbuf*MAXPHYS) != nswbuf*MAXPHYS. Creepy, eh?

I'll see if I can come up with a standalone test case to submit to the gcc
folks.

-- 
Doug White                    |  FreeBSD: The Power to Serve
dwhite at gumbysoft.com          |  www.FreeBSD.org


More information about the freebsd-current mailing list