Subject: Re: fork1 and new stack
To: Emmanuel Dreyfus <manu@netbsd.org>
From: Andrey Petrov <petrov@netbsd.org>
List: tech-kern
Date: 04/25/2002 13:56:25
On Thu, Apr 25, 2002 at 09:42:16PM +0200, Emmanuel Dreyfus wrote:
> Hello
>
> I'm trying to get IRIX sproc() emulation going on. sproc() spawns a new
> lightweight process. I plan to emulate this with a call to fork1() with
> the FORK_SHAREDVM.
>
> On IRIX, the child has a stack at offset 0x0400000 from the parent
> stack. If try to call fork1() with stack (SP - 0x0400000) and stacksize
> (vm_maxssize - vm_minssize), the child just does a SIGSEGV on a stack
> access.
>
> Any idea why?
This can be because of stack size limit for process. You're trying to
add 4megs for your stack while default is 2Meg.
unlimit?
Andrey