From owner-freebsd-bugs Wed Jan 27 19:59:42 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA03267 for freebsd-bugs-outgoing; Wed, 27 Jan 1999 19:59:42 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from home.dragondata.com (home.dragondata.com [204.137.237.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA03253 for ; Wed, 27 Jan 1999 19:59:40 -0800 (PST) (envelope-from toasty@home.dragondata.com) Received: (from toasty@localhost) by home.dragondata.com (8.9.2/8.9.2) id VAA13527 for bugs@freebsd.org; Wed, 27 Jan 1999 21:59:39 -0600 (CST) From: Kevin Day Message-Id: <199901280359.VAA13527@home.dragondata.com> Subject: npx0 flags 0x01 breaks mmap? To: bugs@FreeBSD.ORG Date: Wed, 27 Jan 1999 21:59:38 -0600 (CST) X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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 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