From owner-freebsd-bugs@FreeBSD.ORG Wed Feb 2 11:17:20 2005 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 22D3516A4CE for ; Wed, 2 Feb 2005 11:17:20 +0000 (GMT) Received: from gateway.vbuster.hu (gateway.vbuster.hu [212.108.229.154]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3604743D46 for ; Wed, 2 Feb 2005 11:17:19 +0000 (GMT) (envelope-from gkovacs@virusbuster.hu) Received: from zeus.vbuster.hu ([192.168.2.7] helo=vbuster.hu) by gateway.vbuster.hu with smtp (Exim 3.36 #1 (Debian)) id 1CvvG4-00013O-00 for ; Tue, 01 Feb 2005 11:27:44 +0100 Received: from dev-0012 by zeus.vbuster.hu; 01 Feb 2005 11:27:08 +0100 From: "Gergely, KOVACS (VBuster)" To: freebsd-bugs@freebsd.org Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1107253628.925.42.camel@dev-0012> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 01 Feb 2005 11:27:08 +0100 Subject: malloc/free deadlock bug X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Feb 2005 11:17:20 -0000 Dear FreeBSD people, I have a multi threaded program (an Anti-Virus for Sendmail with Milter API compiled with gcc 3.4.2). The threads are created by Sendmail's libmilter, and the number of threads is limited to 100 (MaxDaemonChildren is set to 100 in sendmail.cf) The hardware environment is a dual Xeon 3Ghz, and the OS is FreeBSD 5.3 with SMP enabled kernel. The problem is that around in every 10th hour (100000 mail process) a deadlock has been happened. According to gdb all threads are waiting in malloc's, or free's mutex handler function: #0 0x280b3c93 in pthread_mutexattr_init () from /usr/lib/libpthread.so.1 #1 0x280b3be5 in pthread_mutexattr_init () from /usr/lib/libpthread.so.1 #2 0x280b04bb in _pthread_mutex_trylock () from /usr/lib/libpthread.so.1 #3 0x280b15e7 in pthread_mutex_lock () from /usr/lib/libpthread.so.1 #4 0x280a9b87 in _spinlock () from /usr/lib/libpthread.so.1 #5 0x2811c4a1 in ldexp () from /lib/libc.so.5 #6 0x2811c6d8 in malloc () from /lib/libc.so.5 or #6 0x2811c704 in free () from /lib/libc.so.5 How can I fix this? Best Regards, Gergely Kovacs