From owner-freebsd-stable@FreeBSD.ORG Sat Mar 10 13:13:04 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 9AF1016A405; Sat, 10 Mar 2007 13:13:04 +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 3898213C47E; Sat, 10 Mar 2007 13:13:03 +0000 (UTC) (envelope-from mb@imp.ch) Received: from godot.imp.ch (godot.imp.ch [157.161.4.8]) by pop.imp.ch (8.13.8/8.13.8/Submit_imp) with ESMTP id l2ADCxmp055685; Sat, 10 Mar 2007 14:13:00 +0100 (CET) (envelope-from mb@imp.ch) Date: Sat, 10 Mar 2007 14:12:59 +0100 (CET) From: Martin Blapp To: ClamAV Development In-Reply-To: <20070310121342.I6787@godot.imp.ch> Message-ID: <20070310141202.C6787@godot.imp.ch> References: <20070305152453.H18301@godot.imp.ch> <1173106098.8193.6.camel@syntax.dstl.gov.uk> <20070310121342.I6787@godot.imp.ch> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Daniel Eischen , freebsd-stable@freebsd.org Subject: Re: Clamav-90_2 Lockup with freebsd 6.2 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: Sat, 10 Mar 2007 13:13:04 -0000 And even more narrowed down ... --- libclamav/mbox.c.orig Tue Feb 13 14:06:57 2007 +++ libclamav/mbox.c Sat Mar 10 14:09:09 2007 @@ -413,6 +413,7 @@ #ifdef CL_THREAD_SAFE static pthread_mutex_t tables_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t body_mutex = PTHREAD_MUTEX_INITIALIZER; #endif #ifndef O_BINARY @@ -1494,6 +1495,7 @@ /* * Write out the last entry in the mailbox */ + pthread_mutex_lock(&body_mutex); if((retcode == CL_SUCCESS) && messageGetBody(body)) { messageSetCTX(body, ctx); switch(parseEmailBody(body, NULL, &mctx, 0)) { @@ -1505,6 +1507,7 @@ break; } } + pthread_mutex_unlock(&body_mutex); /* * Tidy up and quit 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 ------------------------------------------------------------------