From owner-freebsd-stable Fri Sep 29 1:35:28 2000 Delivered-To: freebsd-stable@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id B714537B422 for ; Fri, 29 Sep 2000 01:35:25 -0700 (PDT) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id e8T8ZMg00128; Fri, 29 Sep 2000 01:35:22 -0700 (PDT) Date: Fri, 29 Sep 2000 01:35:21 -0700 From: Alfred Perlstein To: Roman Shterenzon Cc: freebsd-stable@FreeBSD.ORG Subject: Re: pthreads bug? Message-ID: <20000929013521.C27736@fw.wintelcom.net> References: <970215688.39d451088fbef@webmail.harmonic.co.il> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i In-Reply-To: <970215688.39d451088fbef@webmail.harmonic.co.il>; from roman@harmonic.co.il on Fri, Sep 29, 2000 at 10:21:28AM +0200 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Roman Shterenzon [000929 01:23] wrote: > Hello, > I noticed some strange behavior in pthreads applications, > close on socket which is in accept() will be blocked untill there's a connection > to port and accept returns. > It's observed on 4.0 - 4.1-STABLE, perhaps 4.1.1-STABLE as well, but I didn't > try it. I don't have 3.5.1-STABLE system to test it there. > It affects, for example, openldap - start it , then kill -15 it. > It won't die (and it should). Now, try to telnet localhost 389 ; now it died. > The same behavior is a program we're writing right now, it's very annoying, in > fact we don't know how to deal with it. It works on solaris and linux. > btw, linux doesn't dump core on threaded application, how one's supposed to > debug it? No clue on that one. :( > I attach example program, which, when receives SIGUSR1 should close the socket, > but, in fact gets blocked in the close() function. > Obviously it's waiting to acquire some lock. > Does anyone have an idea? Yes, I have an idea and an idea how to fix it, I'm wondering what the thread in accept() sees after this happens? what is the errno from accept? -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message