public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* SO_SNDTIMEO: 2.4 kernel bugs
@ 2001-02-17  1:35 Chris Evans
  2001-02-17 20:29 ` kuznet
  0 siblings, 1 reply; 15+ messages in thread
From: Chris Evans @ 2001-02-17  1:35 UTC (permalink / raw)
  To: linux-kernel; +Cc: kuznet, davem


Hi,

I was glad to see Linux gain SO_SNDTIMEO in kernel 2.4. It is a very use
feature which can avoid complexity and pain in userspace programs.

Unfortunately, it seems to be very buggy. Here are two buggy scenarios.

1)
Create a socketpair(), PF_UNIX, SOCK_STREAM.
Set a 5 second SO_SNDTIMEO on the socket.
write() 100k down the socket in one write(), i.e. enough to cause the
write to have to block.
--> BUG!!! The call blocks indefinitely instead of returning after 5
seconds

(Note that the same test but with SO_RCVTIMEO and a read() works as
expected - I get EAGAIN after 5 seconds).


2)
Create a localhost listening socket - AF_INET, SOCK_STREAM.
Connect to the listening port
Set a 5 second SO_SNDTIMEO on the socket.
write() 1Mb down the socket in one write(), i.e. enough to cause it to
have to block
-> The write() will return after 5 seconds with a partial write count.
GOOD!
Repeat the write() - send another 1Mb.
--> BUG!! The call blocks indefinitely instead of returning with EAGAIN
after 5s.


I hope this is detailled enough. I'm trying to gain access to a FreeBSD
box to compare results..

Cheers
Chris



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2001-02-20 15:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-17  1:35 SO_SNDTIMEO: 2.4 kernel bugs Chris Evans
2001-02-17 20:29 ` kuznet
2001-02-17 21:56   ` Chris Evans
2001-02-17 22:46   ` Chris Evans
2001-02-18 17:24     ` kuznet
2001-02-18 19:25       ` Chris Evans
2001-02-18 19:33         ` kuznet
2001-02-18 19:37           ` Chris Evans
2001-02-18 19:48             ` kuznet
2001-02-19  1:04       ` Chris Evans
2001-02-19  1:43         ` sendfile() breakage was " Chris Evans
2001-02-19 18:03         ` kuznet
2001-02-19 21:56           ` Chris Evans
2001-02-20 15:09             ` David Woodhouse
2001-02-18  1:50   ` Chris Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox