Re: clone() <-> getpid() bug in 2.6?

From: Bruce Guenter
Date: Mon Jun 07 2004 - 13:24:30 EST


On Mon, Jun 07, 2004 at 11:35:23PM +0000, Linus Torvalds wrote:
> On Sun, 6 Jun 2004, Kalin KOZHUHAROV wrote:
> >
> > Well, not exactly sure about my reply, but let me try.
> >
> > The other day I was debugging some config problems with my qmail instalation and I ended up doing:
> > # strace -p 4563 -f -F
> > ...
> > [pid 13097] read(3, "\347\374\375TBH~\342\233\337\220\302l\220\317\237\37\25"..., 32) = 32
> > [pid 13097] close(3) = 0
> > [pid 13097] getpid() = 13097
> > [pid 13097] getpid() = 13097
> > [pid 13097] getuid32() = 89
> > [pid 13097] getpid() = 13097
> > [pid 13097] time(NULL) = 1086497450
> > [pid 13097] getpid() = 13097
> > [pid 13097] getpid() = 13097
> > [pid 13097] getpid() = 13097
>
> qmail is a piece of crap. The source code is completely unreadable, and it
> seems to think that "getpid()" is a good source of random data. Don't ask
> me why.

In this case, however, it has nothing directly to do with qmail. This
is tcpserver, and tcpserver only uses getpid for two things: printing
out status lines with the PID in them (which seems perfectly valid to
me), and once when adding to random initializer for DNS requests.

This strace pattern seemed rather odd to me, so for comparison I straced
my own tcpserver setups, and could not get them to produce more than two
getpid calls per connection. Something is wrong with this trace,
possibly some weirdness in a patch, like whatever the SSL library is
doing.
--
Bruce Guenter <bruceg@xxxxx> http://em.ca/~bruceg/ http://untroubled.org/
OpenPGP key: 699980E8 / D0B7 C8DD 365D A395 29DA 2E2A E96F B2DC 6999 80E8

Attachment: pgp00000.pgp
Description: PGP signature