Subject: Re: fork1 and new stack
To: None <eeh@netbsd.org, manu@netbsd.org>
From: None <eeh@netbsd.org>
List: tech-kern
Date: 04/26/2002 15:10:32
| > Uh, did you by any chance forget to allocate VM in that range?
|
| Here is the code. Is there something wrong in VM allocation?
|
|         bsd_flags = FORK_SHAREVM;
|         tf = (struct frame *)p->p_md.md_regs;
|
|         child_stack_addr = (u_long)(tf->f_regs[SP] - IRIX_SPROC_STACK_OFFSET);
|         child_stack_size = (u_long)p->p_vmspace->vm_minsaddr
|             - (u_long)p->p_vmspace->vm_maxsaddr;
|
|         error = fork1(p, bsd_flags, SIGCHLD, (void *)child_stack_addr,
|             child_stack_size, NULL, NULL, retval, &p2);

Where's the bit where you allocate and map in the new stack?

Eduardo