From owner-freebsd-bugs@FreeBSD.ORG Wed Nov 21 04:13:03 2007 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C350616A41A for ; Wed, 21 Nov 2007 04:13:03 +0000 (UTC) (envelope-from jin@george.lbl.gov) Received: from smtp121.sbc.mail.sp1.yahoo.com (smtp121.sbc.mail.sp1.yahoo.com [69.147.64.94]) by mx1.freebsd.org (Postfix) with SMTP id B55CE13C465 for ; Wed, 21 Nov 2007 04:13:03 +0000 (UTC) (envelope-from jin@george.lbl.gov) Received: (qmail 39457 invoked from network); 21 Nov 2007 04:13:02 -0000 Received: from unknown (HELO ?192.168.1.238?) (jinmtb@sbcglobal.net@67.111.218.125 with plain) by smtp121.sbc.mail.sp1.yahoo.com with SMTP; 21 Nov 2007 04:13:02 -0000 X-YMail-OSG: NehdyvUVM1nC2LOQrpFYas.wzFNE8vl9mEYp173DENtslPodLmVw5x_UIEOGgrvgKcQsDyPaxl0JsL6QNEaFsKZ93pVuWMwM6ghEHjUxI6XMpGOK7dCLQqo2wAis Message-ID: <4743B04D.8030305@george.lbl.gov> Date: Tue, 20 Nov 2007 20:13:01 -0800 From: Jin Guojun User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.13) Gecko/20061027 X-Accept-Language: zh, zh-CN, en MIME-Version: 1.0 To: Kip Macy References: <200711170119.lAH1Jokl048803@freefall.freebsd.org> <473E451C.8090103@george.lbl.gov> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-bugs@freebsd.org, kmacy@freebsd.org Subject: Re: kern/37436: [hang] accept dead loop when out of file descriptors X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2007 04:13:03 -0000 Kip Macy wrote: >On Nov 16, 2007 5:34 PM, Jin Guojun wrote: > > >>kmacy@FreeBSD.org wrote: >> >> >> >>>Synopsis: [hang] accept dead loop when out of file descriptors >>> >>>State-Changed-From-To: open->feedback >>>State-Changed-By: kmacy >>>State-Changed-When: Sat Nov 17 01:19:37 UTC 2007 >>>State-Changed-Why: >>> >>>Is this still an issue? >>> >>>http://www.freebsd.org/cgi/query-pr.cgi?pr=37436 >>> >>> >>> >>> >>I will check into it in a week. >> >> > >By "still", I mean RELENG_6 or better yet RELENG_7. > > -Kip > > Another slightly odd thing is discovered during repeat this test. The maximum number of threads (pthread_create via libthr) can be created is 111. Therefore, there is no way to reproduce this problem due to pthread_create problem. The pthread_create() fails due to Error<35> Resource temporarily unavailable. However, memory allocation is still functioning. I have tested on a 256MB laptop and a 1GB desktop, both had the same problem for pthread creation -- maximum 111 threads can be created. Below is my resource limits and I do not believe that is the problem: /home/users/libthr: limit cputime unlimited filesize unlimited datasize 1048028 kbytes stacksize 65536 kbytes coredumpsize unlimited memoryuse unlimited vmemoryuse unlimited descriptors 11095 memorylocked unlimited maxproc 5547 sbsize unlimited It looks like 6.2-R and RELENG_6/7 kernel has some restriction on number of threads to handle, because all libthr, libpthread and libc_r all behave the same. Is this true? So, that only test can be done is to set descriptors limit to 117 on the server to test 111 connections from a client. Such test is Ok. If the descriptors limit is set to 116, the accept will return error without hanging. But I do not know if this will be true when the number of descriptors used is larger. I tried to run the same command multiple times on the same client, it does not help much. I will look this issue further. -Jin