From owner-freebsd-hackers Mon Jul 23 6:31:53 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from bugz.infotecs.ru (bugz.infotecs.ru [195.210.139.22]) by hub.freebsd.org (Postfix) with ESMTP id A0E1A37B403; Mon, 23 Jul 2001 06:31:30 -0700 (PDT) (envelope-from vel@bugz.infotecs.ru) Received: (from root@localhost) by bugz.infotecs.ru (8.11.1/8.11.1) id f6NDkh403679; Mon, 23 Jul 2001 17:46:43 +0400 (MSD) (envelope-from vel) From: "Eugene L. Vorokov" Message-Id: <200107231346.f6NDkh403679@bugz.infotecs.ru> Subject: Re: using syscalls in a module (stack problem ?) In-Reply-To: <200107222028.f6MKSgI01274@mass.dis.org> "from Mike Smith at Jul 22, 2001 01:28:42 pm" To: Mike Smith Date: Mon, 23 Jul 2001 17:46:43 +0400 (MSD) Cc: freebsd-hackers@freebsd.org X-Mailer: ELM [version 2.4ME+ PL82 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > I call this function with (curproc, PATH_MAX+1), and everything is fine > > when I have just a few local variables defined in the caller (it all > > works on MOD_LOAD only). However, if I have 2 buffers, 4096 bytes each, > > as local variables and then try to allocate userspace memory the same > > way, kernel crashes - sometimes inside mmap(), sometimes a bit later. > > > > Why could this happen ? Is it related to possible stack overflow ? > > Yes. The kernel stack is only two pages; you absolutely must not use > large local variables in the kernel. I see. But I still can define them using "static", right ? Regards, Eugene To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message