Date: Mon, 24 Sep 2001 22:40:06 -0700 (PDT) From: Matt Dillon <dillon@earth.backplane.com> To: Peter Wemm <peter@wemm.org> Cc: Ian Dowse <iedowse@maths.tcd.ie>, Julian Elischer <julian@elischer.org>, hackers@FreeBSD.ORG Subject: Re: Patch to test kstack usage. Message-ID: <200109250540.f8P5e6499443@earth.backplane.com> References: <20010925051923.6CA2F3808@overcee.netplex.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
: :Matt Dillon wrote: :> This isn't perfect but it should be a good start in regards to :> testing kstack use. This patch is against -stable. It reports :> kernel stack use on process exit and will generate a 'Kernel stack :> underflow' message if it detects an underflow. It doesn't panic, :> so for a fun time you can leave UPAGES at 2 and watch in horror. : :It is checking against the wrong guard value. It should be u_guard2. : :FWIW; the max stack available is 4688 bytes on a standard 4.x system. Yes, :that is too freaking close. Also, the maximum usage depends on what sort :of cards you have in the system.. If you have a heavy tty user (eg: a 32+ I looked at it fairly carefully. It has got to be u_guard... at the end of struct user, at least until you do that MFC. The ptrace code appears to mess around with u_kproc quite a bit. And when you rip out u_kproc it still needs to be at the end, after the coredump structure (though for i386 the coredump structure is empty)... because interrupts can occur during a core dump. :port serial card) then you have lots of tty interrupts nesting as well. :Having the ppp/sl/plip drivers in the system partly negates the effect of :this though since it wires the net/tty interrupt masks together. :... :Cheers, :-Peter :-- :Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au :"All of this is for nothing if we don't go to the stars" - JMS/B5 : Yah... the test I ran was just a couple of seconds worth of playing around over ssh. I expect the worst case to be a whole lot worse. We're going to have to bump up UPAGES to 3 in 4.x, there's no question about it. I'm going to do it tonight. -Matt 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?200109250540.f8P5e6499443>