From: Kalin KOZHUHAROV <kalin@ThinRope.net>
To: Chris Wedgwood <cw@f00f.org>
Cc: Linus Torvalds <torvalds@osdl.org>,
Davide Libenzi <davidel@xmailserver.org>,
Robert Love <rml@ximian.com>,
Arjan van de Ven <arjanv@redhat.com>,
Russell Leighton <russ@elegant-software.com>,
Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: clone() <-> getpid() bug in 2.6?
Date: Sun, 06 Jun 2004 14:34:27 +0900 [thread overview]
Message-ID: <40C2ACE3.70105@ThinRope.net> (raw)
In-Reply-To: <20040606051350.GA19485@taniwha.stupidest.org>
Chris Wedgwood wrote:
> On Sun, Jun 06, 2004 at 02:08:52PM +0900, Kalin KOZHUHAROV wrote:
>
>
>>[pid 13097] getpid() = 13097
>>[pid 13097] getpid() = 13097
>>[pid 13097] getpid() = 13097
>>[pid 13097] getpid() = 13097
>>[pid 13097] getpid() = 13097
>>[pid 13097] getpid() = 13097
>>[pid 13097] getpid() = 13097
>>[pid 13097] getpid() = 13097
>>[pid 13097] getpid() = 13097
>
>
> is this repeartable? if you strace -tt how often is this?
Yes, definately on this system. Here we go:
poi root # strace -tt -f -F -p 3550
Process 3550 attached - interrupt to quit
14:24:31.589227 accept(3, {sa_family=AF_INET, sin_port=htons(40575), sin_addr=inet_addr("192.168.1.20")}, [16]) = 0
14:25:04.068649 rt_sigprocmask(SIG_BLOCK, [CHLD], NULL, 8) = 0
14:25:04.068898 write(2, "tcpserver: status: 1/40\n", 24) = 24
14:25:04.069229 fork(Process 14320 attached
) = 14320
[pid 3550] 14:25:04.069663 close(0 <unfinished ...>
[pid 14320] 14:25:04.069771 close(3 <unfinished ...>
[pid 3550] 14:25:04.069874 <... close resumed> ) = 0
[pid 3550] 14:25:04.069977 rt_sigprocmask(SIG_UNBLOCK, [CHLD], NULL, 8) = 0
[pid 3550] 14:25:04.070169 accept(3, <unfinished ...>
[pid 14320] 14:25:04.070278 <... close resumed> ) = 0
[pid 14320] 14:25:04.070406 getpid() = 14320
[pid 14320] 14:25:04.070614 write(2, "tcpserver: pid 14320 from 192.16"..., 39) = 39
...
[pid 14320] 14:25:04.139116 close(3) = 0
[pid 14320] 14:25:04.139242 close(6) = 0
[pid 14320] 14:25:04.139350 time(NULL) = 1086499504
[pid 14320] 14:25:04.139516 getpid() = 14320
[pid 14320] 14:25:04.139742 read(0, "\26\3\1\0s\1\0\0o\3\1", 11) = 11
[pid 14320] 14:25:04.139910 time(NULL) = 1086499504
[pid 14320] 14:25:04.140017 getpid() = 14320
[pid 14320] 14:25:04.140125 read(0, "\0?\230A\323\323\304\226\v\37NI\310\3634i\375\346\300p"..., 109) = 109
[pid 14320] 14:25:04.140278 time(NULL) = 1086499504
[pid 14320] 14:25:04.140383 getpid() = 14320
[pid 14320] 14:25:04.140475 getpid() = 14320
[pid 14320] 14:25:04.140584 getpid() = 14320
[pid 14320] 14:25:04.140681 open("/dev/urandom", O_RDONLY|O_NONBLOCK|O_NOCTTY) = 3
[pid 14320] 14:25:04.140811 select(4, [3], NULL, NULL, {0, 10000}) = 1 (in [3], left {0, 10000})
[pid 14320] 14:25:04.140972 read(3, "g\t\270X\304\260\17P\'\367\t\"\253\375\24\350\272\240\327"..., 32) = 32
[pid 14320] 14:25:04.141130 close(3) = 0
[pid 14320] 14:25:04.141224 getpid() = 14320
[pid 14320] 14:25:04.141326 getpid() = 14320
[pid 14320] 14:25:04.141435 getuid32() = 89
[pid 14320] 14:25:04.141531 getpid() = 14320
[pid 14320] 14:25:04.141650 time(NULL) = 1086499504
[pid 14320] 14:25:04.141747 getpid() = 14320
[pid 14320] 14:25:04.141846 getpid() = 14320
[pid 14320] 14:25:04.141949 getpid() = 14320
[pid 14320] 14:25:04.142051 getpid() = 14320
[pid 14320] 14:25:04.142153 getpid() = 14320
[pid 14320] 14:25:04.142257 getpid() = 14320
[pid 14320] 14:25:04.142359 getpid() = 14320
[pid 14320] 14:25:04.142461 getpid() = 14320
[pid 14320] 14:25:04.142580 getpid() = 14320
[pid 14320] 14:25:04.142683 getpid() = 14320
[pid 14320] 14:25:04.142784 getpid() = 14320
[pid 14320] 14:25:04.142886 getpid() = 14320
[pid 14320] 14:25:04.142989 getpid() = 14320
[pid 14320] 14:25:04.143090 getpid() = 14320
[pid 14320] 14:25:04.143192 getpid() = 14320
[pid 14320] 14:25:04.143294 getpid() = 14320
[pid 14320] 14:25:04.143396 getpid() = 14320
[pid 14320] 14:25:04.143499 getpid() = 14320
[pid 14320] 14:25:04.143619 getpid() = 14320
[pid 14320] 14:25:04.143722 getpid() = 14320
[pid 14320] 14:25:04.143824 getpid() = 14320
[pid 14320] 14:25:04.143927 getpid() = 14320
[pid 14320] 14:25:04.144029 getpid() = 14320
[pid 14320] 14:25:04.144131 getpid() = 14320
[pid 14320] 14:25:04.144233 getpid() = 14320
[pid 14320] 14:25:04.144336 getpid() = 14320
[pid 14320] 14:25:04.144438 getpid() = 14320
[pid 14320] 14:25:04.144540 getpid() = 14320
[pid 14320] 14:25:04.144701 getpid() = 14320
[pid 14320] 14:25:04.144804 getpid() = 14320
[pid 14320] 14:25:04.144906 getpid() = 14320
[pid 14320] 14:25:04.145009 getpid() = 14320
[pid 14320] 14:25:04.145111 getpid() = 14320
[pid 14320] 14:25:04.145214 getpid() = 14320
[pid 14320] 14:25:04.145316 getpid() = 14320
[pid 14320] 14:25:04.145419 getpid() = 14320
[pid 14320] 14:25:04.145520 getpid() = 14320
[pid 14320] 14:25:04.145640 getpid() = 14320
[pid 14320] 14:25:04.145742 getpid() = 14320
[pid 14320] 14:25:04.145845 getpid() = 14320
[pid 14320] 14:25:04.145948 getpid() = 14320
[pid 14320] 14:25:04.146050 getpid() = 14320
[pid 14320] 14:25:04.146152 getpid() = 14320
[pid 14320] 14:25:04.146254 getpid() = 14320
[pid 14320] 14:25:04.146356 getpid() = 14320
[pid 14320] 14:25:04.146458 getpid() = 14320
[pid 14320] 14:25:04.146575 getpid() = 14320
[pid 14320] 14:25:04.146678 getpid() = 14320
[pid 14320] 14:25:04.146780 getpid() = 14320
[pid 14320] 14:25:04.146882 getpid() = 14320
[pid 14320] 14:25:04.146985 getpid() = 14320
[pid 14320] 14:25:04.147087 getpid() = 14320
[pid 14320] 14:25:04.147189 getpid() = 14320
[pid 14320] 14:25:04.147345 time(NULL) = 1086499504
[pid 14320] 14:25:04.147442 getpid() = 14320
[pid 14320] 14:25:04.147531 getpid() = 14320
[pid 14320] 14:25:04.147773 write(0, "\26\3\1\0J\2\0\0F\3\1@\302\252\260\204\203~\367\r\305G"..., 1127) = 1127
[pid 14320] 14:25:04.147937 read(0, "\26\3\1\1\6", 5) = 5
[pid 14320] 14:25:04.151416 read(0, "\20\0\1\2\1\0S\303\2\335E\264\330\250\261oj\307a~en\262"..., 262) = 262
[pid 14320] 14:25:04.151575 getpid() = 14320
[pid 14320] 14:25:04.151685 time([1086499504]) = 1086499504
[pid 14320] 14:25:04.151790 getpid() = 14320
[pid 14320] 14:25:04.151883 getpid() = 14320
[pid 14320] 14:25:04.155052 getpid() = 14320
[pid 14320] 14:25:04.155150 getpid() = 14320
[pid 14320] 14:25:04.178154 read(0, "\24\3\1\0\1", 5) = 5
[pid 14320] 14:25:04.178346 read(0, "\1", 1) = 1
[pid 14320] 14:25:04.178646 read(0, "\26\3\1\0000", 5) = 5
[pid 14320] 14:25:04.178810 read(0, "\10\215\371\334e+\324\356\224|\216\371\204\351\330f+\203"..., 48) = 48
[pid 14320] 14:25:04.179055 write(0, "\24\3\1\0\1\1\26\3\1\0000\26\2678\202\31\16\251\346\224"..., 59) = 59
[pid 14320] 14:25:04.179302 gettimeofday({1086499504, 179360}, NULL) = 0
...
The ppid changed because I restarted /service while testing.
I sent a short mail via SMTP/SSL to trigger the above trace.
> what's more, i wonder why this is going on? i'd almost be tempted to
> attach to it with gdb and take a bt from getpid and see wtf is going
> on
Well, there was no gdb on that machine, compiling it now.
AFAIR, tcpserver is stripped (it is a "production" machine), so I wonder how inforamative it will be.
I havent used gbd a lot, educate me what to do.
For example how do I set a bp to trigger when getpid() is called ?
I know how to set one in a function, but I guess function names are stripped.
Kalin.
--
||///_ o *****************************
||//'_/> WWW: http://ThinRope.net/
|||\/<"
|||\\ '
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
next prev parent reply other threads:[~2004-06-06 5:34 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-05 15:28 clone() <-> getpid() bug in 2.6? Russell Leighton
2004-06-05 20:45 ` Linus Torvalds
2004-06-05 20:55 ` Arjan van de Ven
2004-06-05 21:13 ` Linus Torvalds
2004-06-05 21:48 ` Robert Love
2004-06-05 22:44 ` Linus Torvalds
2004-06-05 21:53 ` Chris Wedgwood
2004-06-05 22:47 ` Robert Love
2004-06-05 22:57 ` David S. Miller
2004-06-05 23:01 ` Linus Torvalds
2004-06-05 23:07 ` Davide Libenzi
2004-06-05 23:18 ` Linus Torvalds
2004-06-05 23:26 ` Davide Libenzi
2004-06-06 5:08 ` Kalin KOZHUHAROV
2004-06-06 5:13 ` Chris Wedgwood
2004-06-06 5:34 ` Kalin KOZHUHAROV [this message]
2004-06-06 6:07 ` Linus Torvalds
2004-06-06 6:43 ` Kalin KOZHUHAROV
2004-06-06 7:57 ` Erik Andersen
2004-06-06 16:57 ` Linus Torvalds
2004-06-06 18:53 ` Simon Kirby
2004-06-06 19:00 ` Linus Torvalds
2004-06-06 9:52 ` Bernd Eckenfels
2004-06-06 13:07 ` Paul Rolland
2004-06-06 17:20 ` Patrick J. LoPresti
2004-06-06 17:31 ` Paul Rolland
2004-06-06 17:43 ` Davide Libenzi
2004-06-06 18:17 ` Rik van Riel
2004-06-06 18:37 ` Patrick J. LoPresti
2004-06-06 16:33 ` chris
[not found] ` <200406062022.54320.vda@port.imtp.ilyichevsk.odessa.ua>
2004-06-06 17:55 ` Linus Torvalds
2004-06-07 18:20 ` Bruce Guenter
2004-06-08 11:06 ` Kalin KOZHUHAROV
2004-06-05 23:19 ` Robert Love
2004-06-06 14:29 ` Russell Leighton
2004-06-06 15:38 ` Using getpid() often, another way? [was Re: clone() <-> getpid() bug in 2.6?] Russell Leighton
2004-06-06 15:44 ` Robert Love
2004-06-07 0:20 ` Russell Leighton
2004-06-06 15:58 ` Arjan van de Ven
2004-06-06 23:49 ` Russell Leighton
2004-06-07 12:13 ` Arjan van de Ven
2004-06-07 13:48 ` Sean Neakums
2004-06-07 14:00 ` Christoph Hellwig
2004-06-07 14:10 ` Sean Neakums
2004-06-07 18:42 ` David Mosberger
2004-06-07 23:02 ` Russell Leighton
2004-06-07 23:27 ` David Mosberger
2004-06-08 6:01 ` Arjan van de Ven
2004-06-08 9:48 ` Eric W. Biederman
2004-06-07 0:09 ` Russell Leighton
2004-06-07 12:20 ` Arjan van de Ven
2004-06-06 17:19 ` Linus Torvalds
2004-06-12 9:15 ` Dominik Straßer
2004-06-12 13:47 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40C2ACE3.70105@ThinRope.net \
--to=kalin@thinrope.net \
--cc=arjanv@redhat.com \
--cc=cw@f00f.org \
--cc=davidel@xmailserver.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rml@ximian.com \
--cc=russ@elegant-software.com \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox