From owner-freebsd-stable@FreeBSD.ORG Mon Mar 5 14:25:30 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9398116A403 for ; Mon, 5 Mar 2007 14:25:30 +0000 (UTC) (envelope-from mb@imp.ch) Received: from pop.imp.ch (mx2.imp.ch [157.161.9.17]) by mx1.freebsd.org (Postfix) with ESMTP id 31A9D13C47E for ; Mon, 5 Mar 2007 14:25:30 +0000 (UTC) (envelope-from mb@imp.ch) Received: from dan.imp.ch (godot.imp.ch [157.161.4.8]) by pop.imp.ch (8.13.8/8.13.8/Submit_imp) with ESMTP id l25EPDW4034912; Mon, 5 Mar 2007 15:25:24 +0100 (CET) (envelope-from mb@imp.ch) Date: Mon, 5 Mar 2007 15:25:13 +0100 (CET) From: Martin Blapp To: ClamAV Development Message-ID: <20070305152453.H18301@godot.imp.ch> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-stable@freebsd.org Subject: Re: Clamav-90_2 Lockup with freebsd 6.2 (fwd) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2007 14:25:30 -0000 After further analyzing I think that pthread_cond_timedwait() in libpthread.so.2 has some issues. While the default clamd worker timeout of 30 seconds is reached with libc_r.so.6 and libthr.so.2 and pthread_cond_timedwait() returns ETIMEDOUT there, libpthread.so doesn't get any ETIMEDOUT errors back at all, and the code can never reach the part where the worker thread gets detached and the thread count gets decreased. With libpthread.so.2 pthread_cond_timedwait() returns always 0. The manpage tells me: > The pthread_cond_timedwait() function atomically blocks the current > thread waiting on the condition variable specified by cond, and unblocks > the mutex specified by mutex. The waiting thread unblocks only after > another thread calls pthread_cond_signal(3), or pthread_cond_broadcast(3) > with the same condition variable, or if the system time reaches the time > specified in abstime, and the current thread reacquires the lock on > mutex. That doesn't seem to work with libpthread.so.2. Any hints ? -- Martin Martin Blapp, ------------------------------------------------------------------ ImproWare AG, UNIXSP & ISP, Zurlindenstrasse 29, 4133 Pratteln, CH Phone: +41 61 826 93 00 Fax: +41 61 826 93 01 PGP: PGP Fingerprint: B434 53FC C87C FE7B 0A18 B84C 8686 EF22 D300 551E ------------------------------------------------------------------