Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Mar 2006 12:09:51 +0100 (CET)
From:      Sven Berkvens-Matthijsse <sven@ilse.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   threads/94467: send(), sendto() and sendmsg() are not correct in libc_r
Message-ID:  <200603151109.k2FB9pCN037532@serv7.ilse.net>
Resent-Message-ID: <200603151110.k2FBAM65065616@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         94467
>Category:       threads
>Synopsis:       send(), sendto() and sendmsg() are not correct in libc_r
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-threads
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 15 11:10:21 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Sven Berkvens-Matthijsse
>Release:        FreeBSD 4.10-STABLE i386
>Organization:
ilse media BV
>Environment:
System: FreeBSD serv7.ilse.net 4.10-STABLE FreeBSD 4.10-STABLE #23: Wed Aug 4 15:18:52 CEST 2004 root@tango.ilse.net:/usr/obj/usr/src/sys/BAROQUE i386

>Description:
	send(), sendto() and sendmsg() can return prematurely in the libc_r
	implementation. If the socket has space available, but not enough to
	accommodate the whole data block at once, the kernel's sendto() will
	return with a premature byte count, because all the sockets are always
	put into nonblocking mode. However, unlike write(), which does
	implement this correctly, the implementation of sendto() and co do not
	check for this condition if the thread's notion of the socket was
	non-blocking. Instead, it just returns the permature bytecount instead
	of starting another sendto()/sendmsg() to complete the action (and
	possibly putting the thread to sleep until poll() says it's okay to
	try again), like a non-blocking version should.

>How-To-Repeat:
	sendto() using a socket and try to write 1 MB of data, for example.
>Fix:
	Working on this one... will post a patch when available.
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603151109.k2FB9pCN037532>