Date: Mon, 23 Jul 2001 13:42:57 -0700 From: Mike Smith <msmith@freebsd.org> To: "Eugene L. Vorokov" <vel@bugz.infotecs.ru> Cc: freebsd-hackers@freebsd.org Subject: Re: using syscalls in a module (stack problem ?) Message-ID: <200107232042.f6NKgv201694@mass.dis.org> In-Reply-To: Your message of "Mon, 23 Jul 2001 17:46:43 %2B0400." <200107231346.f6NDkh403679@bugz.infotecs.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
> > > 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 ? Typically no, as this prevents your function from being reentrant. -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] V I C T O R Y N O T V E N G E A N C E 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?200107232042.f6NKgv201694>