> On 9vx, iostats suicides:
>
> term% iostats echo
> iostats 128: suicide: sys: trap: page fault pc=0x0000b21c
>
> Apparently, after a fork, a child retains it's parent's
> pid in _tos->pid. It isn't updated until the next syscall
> finishes with kexit.
>
> This is a problem if the child's first function call is
> malloc. When malloc locks it's pool, it stores the pid
> from _tos in a private area. After the kernel returns from
> the brk, _tos->pid has been corrected by the call to kexit.
> Punlock then fails because the pids don't match.
>
> I'm not sure of the best way to go about fixing this.


Thank you for the detailed reports.
It makes it very easy to fix the bugs!

a1=; hg diff -r37 9vx/vx32.c
diff -r d945b0921bdc src/9vx/vx32.c
--- a/src/9vx/vx32.c Sun Jun 29 22:01:07 2008 -0400
+++ b/src/9vx/vx32.c Sun Jun 29 22:01:55 2008 -0400
@@ -186,6 +186,9 @@ void
void
forkret(void)
{
+ extern void kexit(Ureg*);
+
+ kexit(nil);
touser(0);
}

a1=;