Hi,

Remove the static qualifier from all functions in message.c, recompile
with '-g -O0', then wait till clamd hangs again. Get a backtrace of
each thread, and see more exactly in which function they are in, and
which file:line. Then let it run again, and take a snapshot of thread
state again.

Thanks ... As you see in http://antispam.imp.ch/patches/patch-clamddeadlock,
the part of the function I locked with an additional mutex does make a new
malloc with each iteration. Looks like this leads to bad lock contention and
to the locking problems.

So its an OS problem ...

All threads except one or two look like :

#0 0x28240512 in _thread_enter_uts (tcb=0x28382440, kcb=0x8057400) at pthread_md.h:223 #1 0x28240383 in _thr_sched_switch_unlocked (curthread=0xa142600) at /usr/src/lib/libpthread/thread/thr_kern.c:653 #2 0x282402bd in _thr_sched_switch (curthread=0xa142600) at /usr/src/lib/libpthread/thread/thr_kern.c:612 #3 0x2823b757 in mutex_lock_common (curthread=0xa142600, m=0x2824e7a4, abstime=0x0)
    at /usr/src/lib/libpthread/thread/thr_mutex.c:582
#4 0x2823cfd3 in _pthread_mutex_lock (m=0x2824e7a4) at /usr/src/lib/libpthread/thread/thr_mutex.c:868 #5 0x28231d28 in _spinlock (lck=0x283531c0) at /usr/src/lib/libpthread/thread/thr_spinlock.c:97 #6 0x282bbb34 in pubrealloc (ptr=0xa0700a0, size=0, func=0x2833f651 " in free():") at /usr/src/lib/libc/stdlib/malloc.c:1090

--
Martin
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net

Reply via email to