Re: clamd memory corruption (may be jemalloc related)

From: Jason Evans <jasone_at_freebsd.org>
Date: Thu, 19 Apr 2007 14:20:27 -0700
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.

Jason
Received on Thu Apr 19 2007 - 19:47:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:09 UTC