[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: posix_spawn

From: Roland McGrath
Subject: Re: posix_spawn
Date: Sun, 16 Dec 2001 17:20:23 -0500 (EST)

> Roland, it is a pleasure debugging your code: I always learn so much.

:-)  I'll read that as other than learning what not to do, and
take it as a compliment.

>  o We need <spin-lock.h> for the declaration of spin_lock_locked.

I don't buy this.  My compile works fine, and picks up that header through
its inclusion of <hurd/signal.h>.  Of course it's possible my local copy of
the source is different from what I posted and I've forgotten.

>  o Anything allocated with alloca is freed when the stack frame is
>    destroy, i.e. we cannot expand local arrays using a nested
>    function; I have changed this to a macro in the included patch.
>  o You forgot to clear the corresponding dtable_cell when setting
>    dtable to a raw port in the spawn_do_open action.  This was causing
>    a core dump in the clean up code.

Thanks for finding these.  I put those two fixes in (though not your patch
exactly).  I've checked the new file into the libc (2.3) mainline so you
(and others) can pick up the fixed version and test it.

> The code with this patch passes Ulrich's test plus a few personal
> additions.

I'm pleasantly surprised it actually works!

As detailed in the comments, there are some fundamental robustness issues
with this implementation that will probably ultimately make me rewrite it
substantially.  But it's helpful to further test this implementation and
uncover any problems there might be that I haven't thought of.  A simple
thing you can do is extend utils/shd.c to give you a way to use posix_spawn
and try a bunch of random tests via that.

A really useful test would be someone were to port a useful program like
make to use posix_spawn in place of fork + exec and do some real-world
tests (compiles and such) using that.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]