From owner-freebsd-hackers Tue Nov 7 10:47:53 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from earth.backplane.com (placeholder-dcat-1076843399.broadbandoffice.net [64.47.83.135]) by hub.freebsd.org (Postfix) with ESMTP id 45CAA37B479 for ; Tue, 7 Nov 2000 10:47:51 -0800 (PST) Received: (from dillon@localhost) by earth.backplane.com (8.11.1/8.9.3) id eA7Ij4d81283; Tue, 7 Nov 2000 10:45:04 -0800 (PST) (envelope-from dillon) Date: Tue, 7 Nov 2000 10:45:04 -0800 (PST) From: Matt Dillon Message-Id: <200011071845.eA7Ij4d81283@earth.backplane.com> To: Jacques Fourie Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: kernel stack size? References: <20001107132009.23436.qmail@web3504.mail.yahoo.com> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :Hi : :Please excuse any silly questions, but I am stuck with :a problem that I can't find the answer for. : :I wrote a KLD module that performs encryption on :network packets in the kernel. Packets are intercepted :for encryption on a ethernet level (in ether_input() :and ether_output_frame() respectively). This module is :implemented on 4.1.1-RELEASE. : :For input packets I added my own NETISR as well as :interrupt queue. In the ether_input() routine the :packets are queued and a software interrupt scheduled. :Further processing on the packet then happens at a :priority of splnet(). : :If I do bulk data transfers (encrypted) everything :works fine until I run a shell script that does a :'ls -lR' in an infinite loop. A few "virtual time :alarm" messages appear and then a kernel panic. :Looking at the DDB output, it seems a lot like a :kernel stack overflow has resulted. Very strange :values for ebp and page faults on stack accesses is :making me think along these lines. : :Does anyone know where I can find more information :about the kernel stack at interrupt time (such as the :maximum size)? :I'm also not quite sure what the "virtual time alarm" :messages mean, can anyone help me out? : :jacques The stack is very small. You cannot safely allocate large structures on the stack -- I would limit your stack utilization to 256 bytes total to be safe. If you need to allocate large structures or arrays you need to do it at device-open and then save a reference that your interrupt can then use. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message