Date: Fri, 1 Dec 2000 09:08:46 -0800 (PST) From: Richard Hodges <rh@matriplex.com> To: freebsd-hackers@FreeBSD.ORG Subject: Re: Per-process kernel stack size Message-ID: <Pine.BSF.4.10.10012010858470.76299-100000@mail.matriplex.com> In-Reply-To: <200012010619.eB16JuF02371@mass.osd.bsdi.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 30 Nov 2000, Mike Smith wrote: > > The routines have a nesting of 10-12 functions having 10-100 lines each. > > Could you tell us what is the minimum available run time memory in the > > per-process kernel stack for running these routines? > You can generally assume that you have about 4k of kernel stack (you will > normally have more, but don't count on it 8). I'm sure this is pretty obvious, and has already occured to most everyone else, but... Wouldn't it be a simple matter to set a global pointer to the stack base (lowest address) when switching context, so that the running code could know exactly how close it is to the limits? Maybe this would not be used in release code, but could be another tool for auditing suspicious code. Even better, maybe the stack could be set on a non-contiguous virtual address so that any overflow would trigger a fault? I would *much* rather have the machine grind to a halt with a relevant message than see mysterious data corruption. Of course, neither of these would be worthwhile once I stop writing code with bugs ;-) All the best, -Richard ------------------------------------------- Richard Hodges | Matriplex, inc. <title> | 769 Basque Way rh@matriplex.com | Carson City, NV 89706 775-886-6477 | www.matriplex.com 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?Pine.BSF.4.10.10012010858470.76299-100000>