Date: Sun, 7 Oct 2001 05:15:21 -0700 (PDT) From: liang weiya <liangvy@bigfoot.com> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/31097: main thread will accept() failure when son thread and main thread accept() at the same time Message-ID: <200110071215.f97CFLC25200@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 31097
>Category: misc
>Synopsis: main thread will accept() failure when son thread and main thread accept() at the same time
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Oct 07 05:20:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: liang weiya
>Release: 4.1.1-Release
>Organization:
>Environment:
>Description:
when main thread and son threads call accept() after bind() at the same
time , main thread's accept() will return -1 yet son threads's return
value is ok.
(env: g++ 2.95, pthread ,all are origin installed version)
same programs tested in redhat linux 7.1 and aix4.3 , and all return
correct value after accept().
>How-To-Repeat:
example:
void (*fun)(..) ;
main(){
...
int s = socket (...) ;
bind(...) ;
pthread_create(fun,...) ;
int v = accept(s,....) ; // here will always return -1 .
...
}
void* fun(s){
...
int sv = accept(s,...) ; // return ok
...
}
>Fix:
this is used for thread pool server mode . don't let main() call accept() when thread pool call accept() .
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110071215.f97CFLC25200>
