3

I have an old Slackware 9.0 mail server on a VM at Linode.com. It has around 130GB of mail hosted on it, in Maildir format on partitioned, separate Ext3 filesystems (largest one is 92GB). I'm in the process of planning a server upgrade (completely new installation with most recent Slackware) within 2 weeks, or so, but it's non-trivial, hence wishing to solve the current issue before the situation worsens.

Over the past few months various utilities began segfaulting and some processes have been sporadically shutting down. The primary applications running on the server are qpsmtpd, qmail, Dovecot, ClamAV and bogofilter and the server typically has a very low system load, though around 300 active IMAP users with approx 1 mail per second entering, or leaving the system.

The VM was moved to an 8GB Linode about 3 weeks ago and the issue appears to have worsened. I have a hunch that the issue is related to running a 32 bit OS with more memory than the OS can use. I have limited experience with the kernel and how it handles memory.

ClamAV restarts 2-3 times per day and qpsmptpd (written in Perl, but preforked) every few hours.

Also, running 'ls' in Maildirs with a large number of messages (files) segfaults, with an example strace log found here:

http://pastie.org/8127239

More info:

Linux kernel = 3.9.3-x86

Memory = 8GB

$ free

total used free shared buffers cached
Mem: 8286016 3672400 4613616 0 266632 2442144
-/+ buffers/cache: 963624 7322392
Swap: 1048572 0 1048572

I'd greatly appreciate some pointers and will gladly supply more detail for a diagnosis.

masegaloeh
  • 17,978
  • 9
  • 56
  • 104
zoot
  • 31
  • 1

1 Answers1

0

Here is where it stopped:

mremap(0xb7504000, 3075489792, 745472, MREMAP_MAYMOVE) = -1 EINVAL (Invalid argument)

Let's see how mremap works:

mremap(old_address, old_size, new_size, int flags);

And the description of EINVAL error:

EINVAL An invalid argument was given.  Possible causes are:
              old_address was not page aligned; a value other than
              MREMAP_MAYMOVE or MREMAP_FIXED was specified in flags;
              new_size was zero; new_size or new_address was invalid; or the
              new address range specified by new_address and new_size
              overlapped the old address range specified by old_address and
              old_size; or MREMAP_FIXED was specified without also
              specifying MREMAP_MAYMOVE.

Looks like SW bug. Workaround is to use 64-bit OS to expand virtual memory addressing.

What version of clamav do you use?

GioMac
  • 4,444
  • 3
  • 24
  • 41
  • Thanks @GioMac, you appear to confirm my suspicion about it being memory related. Running ClamAv 0.97.8 (latest at this point). Ok, the obvious ultimate solution is to upgrade to a 64-bit OS soon, but I was hoping for a possible short-term solution... I know that switching from Ext3 to XFS is also vital for better filesystem performance for Maildirs. – zoot Jul 10 '13 at 10:26
  • Ext4 will do the job too. I'm not quite sure that it's a ClamAV bug, maybe it's related to how it's compiled. Try to compile manually, check patches from RHEL. Try to use OS with enterprise support, like centos, bugs solved by redhat are solved in centos too with max. 1 week gap. This will give you more stability and assurance. – GioMac Jul 10 '13 at 10:44