From owner-freebsd-hackers Fri Mar 30 22:18:11 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mass.dis.org (mass.dis.org [216.240.45.41]) by hub.freebsd.org (Postfix) with ESMTP id 9766037B718 for ; Fri, 30 Mar 2001 22:18:03 -0800 (PST) (envelope-from msmith@mass.dis.org) Received: from mass.dis.org (localhost [127.0.0.1]) by mass.dis.org (8.11.2/8.11.2) with ESMTP id f2V11Q600507; Fri, 30 Mar 2001 17:01:28 -0800 (PST) (envelope-from msmith@mass.dis.org) Message-Id: <200103310101.f2V11Q600507@mass.dis.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: "Chris Ptacek" Cc: freebsd-hackers@freebsd.org Subject: Re: Page Fault problem with my KLD In-reply-to: Your message of "Fri, 30 Mar 2001 09:38:31 PST." <001301c0b940$3d48ca80$cafba8c0@sitaranetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 30 Mar 2001 17:01:25 -0800 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I am developing a KLD and I am having problems getting a page fault. I am > using a set "library" (basically a set of third party object files I build > and then link in). This libarary requires its own chunk of memory that it > manages and needs to be passed a pointer to that memory (and the size) when > it is initialized. So during my load phase I malloc the memory (14M), at > this point I can traverse the memory just fine using a for loop writing and > reading from it as a test. However once I pass this memory into the > "library" to use, I get a page fault error. Is there something I am missing > here? What would be the possible causes of the page fault? The probable cause is that the library you're building is reaching outside the memory that you've allocated it; possibly because it's making some other invalid assumptions. It's hard to be more specific because you haven't given a lot of data here. I'd start by checking the fault address as reported by the trap message; this is the address that the code has tried to access, and it should give you some hints about what's going wrong. eg. if it's 0 or a small value you probably have a null pointer dereference, if it's outside the range that you've allocated, the library has a fencepost error, etc. -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] V I C T O R Y N O T V E N G E A N C E To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message