clamd memory corruption (may be jemalloc related)

Jason Evans jasone at
Thu Apr 19 21:47:53 UTC 2007

Anton Yuzhaninov wrote:
> I try to test clamav 0.90.2 on current and got strange errors:
> LibClamAV Warning: Multipart/alternative MIME message contains no boundary header
> LibClamAV Warning: Multipart/ZZZZZZZZZZZZггггюЕ MIME message contains no boundary header
> LibClamAV Warning: Multipart/related MIME message contains no boundary header
> And sometimes clamd segfaults.
> This Warnings issued randomly and it looks like race condition.
> This problem occurred only when running two or more clamdscan
> processes in parallel. With one process no warnings on same test
> messages.

Processes, not threads?  If so, there's really no way malloc can be to 
blame for a race condition.

The only race condition issue for malloc that I know of has to do with 
rtld not replacing the libc spinlock stubs with threaded 
implementations.  However, I am pretty sure that this problem only shows 
up when versioned symbols are enabled.

malloc's locking methodology is pretty straightforward, which makes me 
reasonably confident about its correctness.  If your debugging efforts 
point you at malloc, you should try reverting to phkmalloc to see if 
that makes the problem go away.


More information about the freebsd-current mailing list