Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 01 Feb 2005 11:27:08 +0100
From:      "Gergely, KOVACS (VBuster)" <gkovacs@virusbuster.hu>
To:        freebsd-bugs@freebsd.org
Subject:   malloc/free deadlock bug
Message-ID:  <1107253628.925.42.camel@dev-0012>

next in thread | raw e-mail | index | archive | help
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



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