From owner-freebsd-bugs Sun Oct 7 5:20: 8 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 4442837B409 for ; Sun, 7 Oct 2001 05:20:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f97CK1w25485; Sun, 7 Oct 2001 05:20:01 -0700 (PDT) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E9F8037B406 for ; Sun, 7 Oct 2001 05:15:21 -0700 (PDT) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f97CFLC25200; Sun, 7 Oct 2001 05:15:21 -0700 (PDT) (envelope-from nobody) Message-Id: <200110071215.f97CFLC25200@freefall.freebsd.org> Date: Sun, 7 Oct 2001 05:15:21 -0700 (PDT) From: liang weiya To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/31097: main thread will accept() failure when son thread and main thread accept() at the same time Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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