From: Rainer Keller <Keller@hlrs.de>
To: Balazs Scheidler <bazsi@balabit.hu>, linux-kernel@vger.kernel.org
Subject: reproducible bug in 2.2.19 & 2.4.x
Date: Fri, 28 Sep 2001 13:38:52 +0200 [thread overview]
Message-ID: <3BB4614C.500D04AA@hlrs.de> (raw)
Hi Balazs,
Well, reading & running (on UP, no SIGSEGVs) Your code, I get the
impression, that there might be a small bug in it.
Your while-loop looks like this:
while (1)
{
int newfd;
int tmplen;
pthread_t t;
tmplen = sizeof(sin);
newfd = accept(fd, (struct sockaddr *) &sin, &tmplen);
...
pthread_create(&t, NULL, thread_func, &newfd);
}
Now, if the thread_func is not started immediately on Your SMP-machine,
the next iteration of the loop might already have started the accept
with a new file-descriptor, leaving two threads reading on the same fd.
This should be per-thread data.
Just my 2 cents.
Greetings,
raY
\x18\x13
next reply other threads:[~2001-09-28 11:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-28 11:38 Rainer Keller [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-09-28 11:01 reproducible bug in 2.2.19 & 2.4.x Balazs Scheidler
[not found] ` <Pine.LNX.4.10.10109281121590.6506-100000@coffee.psychology.mcmaster.ca>
2001-09-28 18:30 ` Balazs Scheidler
[not found] ` <Pine.LNX.4.10.10109281515050.6506-100000@coffee.psychology.mcmaster.ca>
2001-09-28 22:12 ` Balazs Scheidler
2001-10-01 10:03 ` Balazs Scheidler
2001-10-02 8:31 ` Balazs Scheidler
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=3BB4614C.500D04AA@hlrs.de \
--to=keller@hlrs.de \
--cc=bazsi@balabit.hu \
--cc=linux-kernel@vger.kernel.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