Date: Fri, 30 Mar 2001 17:01:25 -0800 From: Mike Smith <msmith@freebsd.org> To: "Chris Ptacek" <chris@ptacek.net> Cc: freebsd-hackers@freebsd.org Subject: Re: Page Fault problem with my KLD Message-ID: <200103310101.f2V11Q600507@mass.dis.org> In-Reply-To: Your message of "Fri, 30 Mar 2001 09:38:31 PST." <001301c0b940$3d48ca80$cafba8c0@sitaranetworks.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103310101.f2V11Q600507>