public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Kegel <dank@kegel.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: socket connected to itself with RH 2.2.14-5.0? (Problem with example  from Stevens)
Date: Tue, 21 Aug 2001 13:43:30 -0700	[thread overview]
Message-ID: <3B82C7F2.43A60829@kegel.com> (raw)

I've been fooling around with porting 
the example programs from Richard Stevens' 
"Unix Network Programming, Volume 1, 2nd edition"
to Linux.  The patches I've come up with so far, along with
instructions for reproducing my results, are
available at http://www.kegel.com/unpv1/
My goal is to reproduce the results in table 27-1.

Along the way, I have been running both server and client on
the same machine (it's easier to script that way for testing).
Oddly, on Red Hat 6.2, the client often hangs within a minute or two.
Poking around a bit shows that the client is blocked in read.
OK so far, that could be a bug in the program or how I'm using it.

The interesting bit is that (after you wait long enough for other
activity to finish up) all threads of the server are serenely 
sitting in accept(), knowing nothing about the client supposedly connected to it.
Curiously, netstat -pant | grep 127.0.0.1  shows just

tcp        0      0 127.0.0.1:2003          127.0.0.1:2003          ESTABLISHED 965/client 

Erm, could the client have connected to *itself* somehow?

Doesn't happen with Red Hat 7.1.  I am now compiling vanilla 2.2.19 to see
if that fixes it, too.

(I seem to have a knack for triggering this kind of thing.  ucd-snmp/snmpget
used to crash if you had it query itself :-)

- Dan

-- 
"I have seen the future, and it licks itself clean." -- Bucky Katt

             reply	other threads:[~2001-08-21 20:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-21 20:43 Dan Kegel [this message]
     [not found] ` <20010822120619.A13189@dea.linux-mips.net>
2001-08-23  3:03   ` socket connected to itself with RH 2.2.14-5.0? (Problem with example from Stevens) Dan Kegel

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=3B82C7F2.43A60829@kegel.com \
    --to=dank@kegel.com \
    --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