# Qmail-Scanner

## superGman

After my recent update world routine my qmail-scanner stopped working.

This is what the log shows

 *Quote:*   

> Can't load '/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux/auto/DB_File/DB_File.so' for module DB_File: libdb-4.2.so: failed to map segment from shared object: Cannot allocate memory at /usr/lib64/perl5/5.8.8/x86_64-linux/XSLoader.pm line 70.
> 
> @40000000476dd7851af09564  at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux/DB_File.pm line 251
> 
> @40000000476dd7851af09d34 Compilation failed in require at /var/qmail/bin/qmail-scanner-queue.pl line 1403.
> ...

 

I've re-emerge several packages in an effort to fix this to no avail including, qmail-scanner, and the perb DB Module, as well as increasing the softlimit.

Temporarily I've disabled the scanner so I can get my email, and also looking at replacing qmail-scanner with simscan.

Does anyone have suggestions how I can fix this?  Otherwise, I'll have to read up on simscan.

Thanks.

----------

## imbezol

Up your softlimit in /var/qmail/control/conf-common.

----------

## phil_bv

Hi !

I have the same problem with a fresh newly installed Gentoo 1.12 on an 64bit arhitecture ( dual Xeon ):

```

$ tail -f /var/log/qmail/qmail-smtpd/current|tai64nlocal

....

2008-09-18 16:25:50.627045500 tcpserver: ok 11416 0:a.b.c.d:465 :x.y.z.w::2584

2008-09-18 16:25:52.702867500 Can't load '/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux/auto/DB_File/DB_File.so' for module DB_File: libdb-4.5.so: failed to map segment from shared object: Cannot allocate memory at /usr/lib64/perl5/5.8.8/x86_64-linux/XSLoader.pm line 70.

2008-09-18 16:25:52.702872500  at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux/DB_File.pm line 251

2008-09-18 16:25:52.702873500 Compilation failed in require at /var/qmail/bin/qmail-scanner-queue.pl line 472.

2008-09-18 16:25:52.702874500 BEGIN failed--compilation aborted at /var/qmail/bin/qmail-scanner-queue.pl line 472.

2008-09-18 16:25:52.717916500 tcpserver: end 11416 status 256

```

```

$ locate -i libdb-4.5.so

/1/usr/lib64/libdb-4.5.so

/usr/lib32/libdb-4.5.so

/usr/lib64/libdb-4.5.so

```

```

$ ldd /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux/auto/DB_File/DB_File.so

        linux-vdso.so.1 =>  (0x00007fff51dfe000)

        libdb-4.5.so => /usr/lib/libdb-4.5.so (0x00007f00497f8000)

        libc.so.6 => /lib/libc.so.6 (0x00007f00494b9000)

        /lib64/ld-linux-x86-64.so.2 (0x00007f0049d3e000)

```

Someone knows how to fix this bug, without renouncing at qmail-scanner ?

----------

## phil_bv

Hmm... problem resolved by increasing the SOFTLIMIT_OPTS from 32MB to 64M in /var/qmail/control/conf-common:

```

...

# we limit data and stack segments to 8mbytes, you may need to raise this if

# you are using a filter in QMAILQUEUE

#SOFTLIMIT_OPTS="-m 16000000"

SOFTLIMIT_OPTS="-m 64000000"

...

```

Even if I don't like to allow so much memory to a SMTP-session ( => qmail-scanner ), I have no choise so I leave this limit to 64MB, and set-up  maximum incomming SMTP connections to a smaller value (/var/qmail/control/concurrencyincoming), by formula:

concurrencyincoming = total_ram / max_soft_limit  

(my case: concurrencyincoming  = 4096MB / 64MB = 64 ) !

It's very strange why it need so much memory, the involved programs aren't so big:

```

$ ls -al /usr/lib64/perl5/5.8.8/x86_64-linux/XSLoader.pm

-r--r--r-- 1 root root 10461 Aug 21 21:41 /usr/lib64/perl5/5.8.8/x86_64-linux/XSLoader.pm

$ ls -al /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux/auto/DB_File/DB_File.so

-r-xr-xr-x 1 root root 47208 Sep  1 15:54 /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux/auto/DB_File/DB_File.so

$ ldd /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux/auto/DB_File/DB_File.so

        linux-vdso.so.1 =>  (0x00007fff72ffe000)

        libdb-4.5.so => /usr/lib/libdb-4.5.so (0x00007f836a9a1000)

        libc.so.6 => /lib/libc.so.6 (0x00007f836a662000)

        /lib64/ld-linux-x86-64.so.2 (0x00007f836aee7000)

$ ls -la /usr/lib/libdb-4.5.so

-rwxr-xr-x 1 root root 1236056 Aug 30 02:49 /usr/lib/libdb-4.5.so

```

----------

## imbezol

I was actually surprised when I moved one of my mail servers from 32 bit to 64 bit that I had to double the softlimit. Perhaps 64 bit Perl requires twice the word size on the same number of variables.

----------

