From owner-freebsd-bugs Wed Sep 18 21:50: 8 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C78F37B420 for ; Wed, 18 Sep 2002 21:50:04 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1BE3143E42 for ; Wed, 18 Sep 2002 21:50:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g8J4o3Co001468 for ; Wed, 18 Sep 2002 21:50:03 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g8J4o3Io001467; Wed, 18 Sep 2002 21:50:03 -0700 (PDT) Date: Wed, 18 Sep 2002 21:50:03 -0700 (PDT) Message-Id: <200209190450.g8J4o3Io001467@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Gregory Bond Subject: Re: misc/42943: fd 0,1,2 should not be set to nonblock in _thread_fd_table_init() Reply-To: Gregory Bond 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 The following reply was made to PR misc/42943; it has been noted by GNATS. From: Gregory Bond To: pqf Cc: freebsd-gnats-submit@FreeBSD.ORG Subject: Re: misc/42943: fd 0,1,2 should not be set to nonblock in _thread_fd_table_init() Date: Thu, 19 Sep 2002 14:40:34 +1000 > parend process call dup2() to make fd 0 be a unix domain socket > parent process fork() muti-thread(pthread) child process > child process set fd 0 to nonblock in _thread_fd_table_init() > fd 0 is shared between parent process and child process, so the parent proces > s's fd 0 is now nonblock, but the parent process DO NOT know what happen beca > use it DID NOT do anything to fd 0... I would argue this is a bug in the (parent) program - if you are going to share file descriptors, you'd better make sure you understand what the other program is going to do to them! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message