From: bsa@kf8nh.wariat.org (Brandon S. Allbery) Subject: Re: gcc on linux Date: Mon, 7 Jun 1993 20:45:15 GMT
In article <C89EMo.IrI@boulder.parcplace.com> imp@boulder.parcplace.com (Warner Losh) writes:
>Purify helps in this area, but it only runs on Suns. Debugging malloc
>libraries help as well, but not as much as purify. Maybe that would
>make a good linux project: hack together a purify thing... I wonder
>how hard it would be to get one that was fast?
The concept behind purify is fairly simple: give malloc()'ed memory separate
pages with unmapped pages between them, and install a SIGSEGV handler to trap
accesses to the unmapped pages. But this requires that (1) mmap() and/or
munmap() be capable of supporting this; (2) the SEGV handler be able to get at
the context of the fault so it can determine if it was an access to an
unmapped page, and (3) that the granularity of a mapped segment be variable.
You could get by without (2) and (3), but in the former case you would lose
the ability to analyze it at runtime unless you ran under a debugger and in
the latter you would potentially not catch references "off the end" of
allocated memory if it didn't exactly fill a page. I'm not sure if the
386/486 lets you "truncate" a 4K page, so (3) may not be possible under Linux.
++Brandon
-- Brandon S. Allbery kf8nh@kf8nh.ampr.org bsa@kf8nh.wariat.orgIt's not too late to turn back from the "Gates" of Hell... Linux: the free 32-bit operating system, available NOW. Why waaaaaait for NT?