Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jan 1999 21:59:38 -0600 (CST)
From:      Kevin Day <toasty@home.dragondata.com>
To:        bugs@FreeBSD.ORG
Subject:   npx0 flags 0x01 breaks mmap?
Message-ID:  <199901280359.VAA13527@home.dragondata.com>

next in thread | raw e-mail | index | archive | help


I have a program that uses mmap() heavily.

For some reason, when setting npx0's flags to 0x01 (disable npx regs for
bcopy) mmap randomly returns EINVAL. This seem like such unrelated
procedures, that I can't imagine why one has anything to do with the other. 

for (i=1;i<100;i++) {
 r = mmap(0, 1024 * 1024, PROT_READ, 0, fd, 0)
 if (r == MAP_FAILED) {
   printf("mmap failed with %d errno\n",errno);
 } else {
   printf("mmap succeeded\n");
   munmap(r, 1024 * 1024);
 }
}

(fd is a regular file, about 8MB in length)

I get something similar to:

mmap succeeded
mmap succeeded
mmap succeeded
mmap succeeded
mmap succeeded
mmap failed with 22 errno
mmap failed with 22 errno
mmap failed with 22 errno
mmap succeeded
mmap succeeded
mmap succeeded
mmap succeeded
mmap failed with 22 errno
mmap failed with 22 errno
mmap failed with 22 errno
mmap failed with 22 errno
mmap failed with 22 errno
mmap failed with 22 errno
mmap failed with 22 errno
mmap succeeded
mmap succeeded
mmap succeeded
mmap succeeded
<snip>

This occurs on any processor, (tried a Pentium, MII, Media GX and K6-2), on
several motherboards, so i've ruled out hardware.

The software has quite a bit of mmap's active at the time, as well as
mmaping part of /dev/mem to get userland access to physical memory.

Setting the flags back to 0 makes everything happy again.

This is on 3.0-RELEASE, even with a GENERIC kernel.

Is this a known problem? Any more information neccesary?

Kevin



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901280359.VAA13527>