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

Kalin KOZHUHAROV
2004-06-08T11:07:07Z

Bruce Guenter wrote:
> 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.

Yes, it is strange. I'll have a look at the applied patches. Without SSL there is no such getpidding :-)
Will post you (not LKML) if I find the culprit.

Kalin.

--
||///_ o *****************************
||//'_/> WWW: http://ThinRope.net/
|||\/<"
|||\\ '
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^