* Re: accept()/TCP bug
@ 1998-01-12 18:09 Uncle George
0 siblings, 0 replies; 5+ messages in thread
From: Uncle George @ 1998-01-12 18:09 UTC (permalink / raw)
thanks,
I was playing with the java webserver, and netscape in the mean time..
although everyone thinks its an accept bug, it appears to be a select bug,
and right now
it looks like the problem is with the select interface to the net/kern
software.
I get the SIGIO from the linux kern, that is initiated from a
netscape/browser request. Apparently i get interrupted with the sigio that
comes from net code, but when select is used to find out who, there appears
to be nothing there for the net channel
when I startup a second browser ( while the first browser is waiting ), that
creates another sigio, and now it has the bit set for that channel.
hummmmmm. a linux bug.....
Dima Ulberg wrote:
> Hi,
>
> The following is the code which show the bug. It's uuencoded tar
> file. Let me know, if smth is not clear in the code.
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: accept()/TCP bug
@ 1998-01-13 0:04 Uncle George
0 siblings, 0 replies; 5+ messages in thread
From: Uncle George @ 1998-01-13 0:04 UTC (permalink / raw)
1) ur analysis is good. what started me going was that a fprintf(stderr,... in
the signal routine actually caused the thread with the accept/select wait to wake
up. Take the fprintf away, and ur back to square one.
2) I get a sigio. i dont know hows thats triggered, but somehow the fd at the
service call level is not yet updated - but it should be. The sigio should sugg
the the I/O is complete. all that i do after ths sigio interrupt is do a
select() to see which fd's did that. An accept wount be done until select says
that that channel has info!
SIGIO -> interrupt -> select() -> ( FD for the accept(fd,...) isn't ready ->
return from service routine.
3) bug is consistent/persistent. happens always to the first browser. should be
easy to trace into the kern
> If you insert a pause of about 200 ms where I have the /* note */ the
> select returns successfully, or at least that's what Randy has said in the
> past. Unfortunately, this waiting is a realy performance hit and isn't a
> fix as far as I am concerned.
>
> Linux does do one thing a bit different with regards to accept() and TCP
> connections. It will return from an accept() before the three way
> handshake is complete. This could be what's causing the problem. ( I
> offhandedly asked Alan about it but never got a response about it. )
> Here's what it looks like:
>
> Program Kernel Outside world
> accept()
> <--- TCP SYN
> return from accept() ----> TCP ACK
> select() (fails)
>
> Is this the desired behavior? Anyone? :)
>
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: accept()/TCP bug
@ 1998-01-13 13:20 Uncle George
0 siblings, 0 replies; 5+ messages in thread
From: Uncle George @ 1998-01-13 13:20 UTC (permalink / raw)
i suppose u cant tell me what triggers a SIGIO from the net services. I'm looking
for particular place of invocation.
gat
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: accept()/TCP bug
@ 1998-01-14 11:58 Uncle George
0 siblings, 0 replies; 5+ messages in thread
From: Uncle George @ 1998-01-14 11:58 UTC (permalink / raw)
can I understand from this that u agree/disagree that the select() for a
connection that is complete
(But not yet accept()'ed and no data transfered from the client yet )
should/should not have the bit set for the "listened" channel?
Alan Cox wrote:
> > adescriptor which I have listen()'d on for years. Wright/Stevens show that
> > select() for READ will detect 'listen socket has queued connection' (many
> > different UNIXs' man pages show this for select() or poll()).
can u tell me what page/section in vol II.
>
>
> The select is on the accepted socket, and the code appears to correctly
> report its accepted but not yet ready for reading
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: accept()/TCP bug
@ 1998-01-14 16:00 Uncle George
0 siblings, 0 replies; 5+ messages in thread
From: Uncle George @ 1998-01-14 16:00 UTC (permalink / raw)
thank you, too much cut & paste seemed to have cut off a missing >
pardon,
but,
it would seem from stevens, vol II, pg 524, "listen socket has queued connection"
should have been detected in the select(fd,... for "reading".
it appears that the SIGIO is initiated before the connection is complete, and appears
to also be sent before the skb buffers are "queued" ( tcp_input.c:tcp_conn_request()
).
It also appears from the similar code of accept(), it will also fail ( if
non-blocked) under these SIGIO conditions.
Would this not be a fair statement, and if so, what would it take to have SIGIO
signals in sync with queued connections, but not yet accept()'ed ( ie when
ack_backlog++ is appropriate).
> > > > adescriptor which I have listen()'d on for years. Wright/Stevens show that
> > > > select() for READ will detect 'listen socket has queued connection' (many
> > > > different UNIXs' man pages show this for select() or poll()).
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1998-01-14 16:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-01-14 16:00 accept()/TCP bug Uncle George
-- strict thread matches above, loose matches on Subject: below --
1998-01-14 11:58 Uncle George
1998-01-13 13:20 Uncle George
1998-01-13 0:04 Uncle George
1998-01-12 18:09 Uncle George
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox