Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Mar 2007 14:12:59 +0100 (CET)
From:      Martin Blapp <mb@imp.ch>
To:        ClamAV Development <clamav-devel@lists.clamav.net>
Cc:        Daniel Eischen <deischen@freebsd.org>, freebsd-stable@freebsd.org
Subject:   Re: Clamav-90_2 Lockup with freebsd 6.2
Message-ID:  <20070310141202.C6787@godot.imp.ch>
In-Reply-To: <20070310121342.I6787@godot.imp.ch>
References:  <20070305152453.H18301@godot.imp.ch> <1173106098.8193.6.camel@syntax.dstl.gov.uk> <20070310121342.I6787@godot.imp.ch>

next in thread | previous in thread | raw e-mail | index | archive | help

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, <mb@imp.ch> <mbr@FreeBSD.org>
------------------------------------------------------------------
ImproWare AG, UNIXSP & ISP, Zurlindenstrasse 29, 4133 Pratteln, CH
Phone: +41 61 826 93 00 Fax: +41 61 826 93 01
PGP: <finger -l mbr@freebsd.org>
PGP Fingerprint: B434 53FC C87C FE7B 0A18 B84C 8686 EF22 D300 551E
------------------------------------------------------------------




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070310141202.C6787>