From owner-freebsd-java@FreeBSD.ORG Wed Dec 13 07:06:36 2006 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 014E316A403; Wed, 13 Dec 2006 07:06:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from digger1.defence.gov.au (digger1.defence.gov.au [203.5.217.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B59D43CA0; Wed, 13 Dec 2006 07:05:07 +0000 (GMT) (envelope-from kostikbel@gmail.com) Received: from ednmsw501.dsto.defence.gov.au (ednmsw501.dsto.defence.gov.au [131.185.2.150]) by digger1.defence.gov.au (8.13.8/8.13.8) with ESMTP id kBD6xVLV029681; Wed, 13 Dec 2006 17:29:31 +1030 (CST) Received: from ednux519.dsto.defence.gov.au (unverified) by ednmsw501.dsto.defence.gov.au (Content Technologies SMTPRS 4.3.17) with ESMTP id ; Wed, 13 Dec 2006 17:36:28 +1030 Received: from ednex510.dsto.defence.gov.au (ednex510.dsto.defence.gov.au [131.185.2.170]) by ednux519.dsto.defence.gov.au (8.13.6+Sun/8.13.6) with ESMTP id kBD3CpiR015368; Wed, 13 Dec 2006 13:42:52 +1030 (CST) Received: from ednexdev.dsto.defence.gov.au ([131.185.2.82]) by ednex510.dsto.defence.gov.au with Microsoft SMTPSVC(6.0.3790.1830); Wed, 13 Dec 2006 13:50:39 +1030 Received: from mail pickup service by ednexdev.dsto.defence.gov.au with Microsoft SMTPSVC; Wed, 13 Dec 2006 13:50:30 +1030 Received: from ednmsw506.dsto.defence.gov.au ([131.185.2.88]) by ednexdev.dsto.defence.gov.au with Microsoft SMTPSVC(6.0.3790.1830); Wed, 13 Dec 2006 00:37:09 +1030 Received: from digger1.defence.gov.au (unverified) by ednmsw506.dsto.defence.gov.au (Content Technologies SMTPRS 4.3.14) with ESMTP id for ; Wed, 13 Dec 2006 00:37:09 +1030 Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by digger1.defence.gov.au (8.13.8/8.13.8) with ESMTP id kBCE07N9018736 for ; Wed, 13 Dec 2006 00:30:07 +1030 (CST) Received: from hub.freebsd.org (hub.freebsd.org [69.147.83.54]) by mx2.freebsd.org (Postfix) with ESMTP id 95F4E14C9C9; Tue, 12 Dec 2006 13:59:33 +0000 (GMT) (envelope-from owner-freebsd-arch@freebsd.org) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 9EB0616A57C; Tue, 12 Dec 2006 13:59:33 +0000 (UTC) (envelope-from owner-freebsd-arch@freebsd.org) X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B42D916A492; Tue, 12 Dec 2006 13:59:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from fw.zoral.com.ua (fw.zoral.com.ua [213.186.206.134]) by mx1.FreeBSD.org (Postfix) with ESMTP id 993A343D36; Tue, 12 Dec 2006 13:56:03 +0000 (GMT) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by fw.zoral.com.ua (8.13.4/8.13.4) with ESMTP id kBCDumHp001088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 12 Dec 2006 15:56:48 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.13.8/8.13.8) with ESMTP id kBCDumka019314; Tue, 12 Dec 2006 15:56:48 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.13.8/8.13.8/Submit) id kBCDulHY019313; Tue, 12 Dec 2006 15:56:47 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 12 Dec 2006 15:56:47 +0200 From: Kostik Belousov To: Daniel Eischen Message-ID: <20061212135647.GK311@deviant.kiev.zoral.com.ua> References: <20061211171115.GD311@deviant.kiev.zoral.com.ua> <200612120816.07608.davidxu@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5uO961YFyoDlzFnP" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on fw.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=1.4 required=5.0 tests=SPF_NEUTRAL, UNPARSEABLE_RELAY autolearn=no version=3.1.4 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on fw.zoral.com.ua X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Sender: owner-freebsd-arch@freebsd.org Errors-To: owner-freebsd-arch@freebsd.org X-OriginalArrivalTime: 12 Dec 2006 14:07:09.0321 (UTC) FILETIME=[D00FDF90:01C71DF6] X-TM-AS-Product-Ver: SMEX-7.0.0.1345-3.6.1039-14784.003 X-TM-AS-Result: No--20.528900-8.000000-31 Cc: freebsd-java@freebsd.org, "Arne H. Juul" , David Xu , freebsd-arch@freebsd.org Subject: Re: close() of active socket does not work on FreeBSD 6 X-BeenThere: freebsd-java@freebsd.org List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Dec 2006 07:06:36 -0000 --5uO961YFyoDlzFnP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 12, 2006 at 08:18:32AM -0500, Daniel Eischen wrote: > On Mon, 11 Dec 2006, Daniel Eischen wrote: >=20 > >On Tue, 12 Dec 2006, Arne H. Juul wrote: > > > >>On Tue, 12 Dec 2006, David Xu wrote: > >>>On Tuesday 12 December 2006 06:34, Arne H. Juul wrote: > >>> > >>>>This is exactly the sort of issue that should be solved by the > >>>>thread library / kernel threads implementation and not in every > >>>>threaded application that needs it, in my view. > >>>> > >>>It should not be done in new thread library, do you want a bloat > >>>and error-prone thread library ? Instead if this semantic is really > >>>necessary, it should be done in kernel. > >> > >>Well, it depends on the alternatives. > >>If a clean kernel implementation is possible - yes please, of course. > >>If only a complex, error-prone kernel implementation is possible, > >>I would prefer to have the complexity in the thread library. > > > >Hacking libthr or libpthread to do this for you is not > >an option. They would then look like libc_r since all > >fd's accesses would need to be wrapped. If this needs > >to be done, it must be in the kernel. >=20 > It's also couldn't be entirely solved by fixing it in the > threads library. You could still have a non-threaded > application that waits on a read operation, but receives > a signal and closes the socket in the signal handler. This is not the problem. The read (as syscall being executed) is aborted when signal is delivered. Original poster considered situation where read() is active (in particular, f_count of struct file is incremented by fget, that caused the reported behaviour). --5uO961YFyoDlzFnP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFFfrUeC3+MBN1Mb4gRAhCXAKCJxzJsY0KFk3GYwKTqTSC2ZLWybQCgjA8M Lfnc6O8F144t8wd826jDuX0= =6wvE -----END PGP SIGNATURE----- --5uO961YFyoDlzFnP--