Re: 2.5.68-mm2

Martin J. Bligh (mbligh@aracnet.com)
Fri, 25 Apr 2003 11:49:39 -0700


>> | The point is that even if bash is fixed it's desirable to address the
>> | issue in the kernel, other applications may well misbehave as well.
>>
>> So when would this ever end?
>
> Exactly what I was thinking.
>
> The kernel cannot be expected to cater to applications or make
> concessions (read: hacks) for certain behavior. If we offer a cleaner,
> improved interface which offers the performance improvement, we are
> done. Applications need to start using it.
>
> Of course, I am not arguing against optimizing the old interfaces or
> anything of that nature. I just believe we should not introduce hacks
> for application behavior. It is their job to do the right thing.

I would actually like us to do this (the non-deterministic nature of UNIX
semantics wrt exec is hateful), but changing the kernel before the apps is
ass-backwards. Once this distros fix all their binaries (at least in their
bleeding edge versions) this makes more sense.

There are also some interesting comments the manpage for vfork:

BUGS
It is rather unfortunate that Linux revived this spectre
from the past. The BSD manpage states: "This system call
will be eliminated when proper system sharing mechanisms
are implemented. Users should not depend on the memory
sharing semantics of vfork as it will, in that case, be
made synonymous to fork."

Formally speaking, the standard description given above
does not allow one to use vfork() since a following exec
might fail, and then what happens is undefined.

Details of the signal handling are obscure and differ
between systems. The BSD manpage states: "To avoid a pos­
sible deadlock situation, processes that are children in
the middle of a vfork are never sent SIGTTOU or SIGTTIN
signals; rather, output or ioctls are allowed and input
attempts result in an end-of-file indication."

Currently (Linux 2.3.25), strace(1) cannot follow vfork()
and requires a kernel patch.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/