From owner-freebsd-current@FreeBSD.ORG Wed Nov 29 23:47:13 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4CE116A417; Wed, 29 Nov 2006 23:47:13 +0000 (UTC) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 342C043CC3; Wed, 29 Nov 2006 23:47:06 +0000 (GMT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.13.7/8.13.4) with ESMTP id kATNlAOK049276; Wed, 29 Nov 2006 15:47:10 -0800 (PST) Received: (from dillon@localhost) by apollo.backplane.com (8.13.7/8.13.4/Submit) id kATNl1sX049274; Wed, 29 Nov 2006 15:47:01 -0800 (PST) Date: Wed, 29 Nov 2006 15:47:01 -0800 (PST) From: Matthew Dillon Message-Id: <200611292347.kATNl1sX049274@apollo.backplane.com> To: Scott Long References: <45622068.2050705@student.tue.nl> <200611291204.03716.jhb@freebsd.org> <20061129223221.GA359@what-creek.com> <456E0C66.4060404@samsco.org> <20061129225025.GA584@what-creek.com> <456E0EDA.60603@samsco.org> Cc: jb@freebsd.org, John Birrell , freebsd-current@freebsd.org, Rene Ladan Subject: Re: calcru-triggered panic? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Nov 2006 23:47:13 -0000 :I don't know how to do it in a platform-independent way. For i386, :I'd check %esp and see if it's getting close to a 2x page boundary. : :Scott It's really easy. Just pre-initialize the stack to a fixed value when it is allocated, like 0xabcd1234, then write a little KVM utility which scans the stack for each thread on the system, determines how much of it is used, and prints out the values. You can also figure out approximately what routines were running so deep in the stack by scanning the used portion of the stack for procedural return PCs. There are usually a ton scattered around the stack. -Matt Matthew Dillon