Re: [exim] Exim with FreeBSD 8, dbm loop

Top Page
Delete this message
Reply to this message
Author: Phil Pennock
Date:  
To: Artis Caune
CC: exim-users, randy
Subject: Re: [exim] Exim with FreeBSD 8, dbm loop
CC'ing Randy Bush who has seen the same problem.

On 2009-07-29 at 16:47 +0300, Artis Caune wrote:
> I have problem running exim on FreeBSD 8.x. I found those messages on test box:
> ...
> swap_pager_getswapspace(3): failed
> swap_pager_getswapspace(3): failed
> pid 1441 (exim_tidydb), uid 25, was killed: out of swap space
>
> That was nightly cron job and there was one message in queue.
>
> Maybe something related to:
> http://svn.freebsd.org/viewvc/base/head/lib/libc/db/hash/hash.c?r1=190489&r2=190491
>
>
> I run dbm test, just like in doc/dbm.discuss.txt and there is loop in scan:


So this is a FreeBSD bug, which needs to be filed against FreeBSD. Exim
uses the system DB libraries and assumes that they're sane.

You can work around it by installing gdbm and setting USE_GDBM in the
Exim Local/Makefile; you should perhaps file a Ports bug to do this, if
it looks like the FreeBSD base bug isn't going to be fixed any time
soon.

See section 4.3 of The Exim Specification (doc/spec.txt), which tells
you to do something like:
USE_GDBM=yes
DBMLIB=-lgdbm

If Exim is having problems as a result of a system bug, but is the only
real user of the library, then Exim will be how it shows up on the
system, but there's nothing that can be done by Exim to fix this except
say "don't use the db library on that system, it's buggy, build Exim to
use something else".

Regards,
-Phil
(Leaving the trace info intact in reply for Randy to see)

> read(0,"open junk\n",4096)                       = 10 (0xa)
> getrusage(0,{ u=0.002821,s=0.004896,in=0,out=0 }) = 0 (0x0)
> open("/root/exim/db/junk.lockfile",O_RDWR,0640)  = 3 (0x3)
> write(2,"locking /root/exim/db/junk.lockf"...,36) = 36 (0x24)
> setitimer(0,{0.000000, 60.000000 },{0.000000, 0.000000 }) = 0 (0x0)
> fcntl(3,F_SETLKW,0x7fffffffe2b0)                 = 0 (0x0)
> setitimer(0,{0.000000, 0.000000 },{0.000000, 59.998986 }) = 0 (0x0)
> write(2,"locked /root/exim/db/junk.lockfi"...,35) = 35 (0x23)
> write(2,"EXIM_DBOPEN(/root/exim/db/junk)"...,32) = 32 (0x20)
> open("/root/exim/db/junk",O_RDWR,0640)           = 4 (0x4)
> fcntl(4,F_SETFD,FD_CLOEXEC)                      = 0 (0x0)
> fstat(4,{ mode=-rw-r----- ,inode=710960,size=16384,blksize=4096 }) = 0 (0x0)
> read(4,"\0\^F\^Ua\0\0\0\^B\0\0\^D\M-R\0"...,260) = 260 (0x104)
> write(2,"returned from EXIM_DBOPEN\n",26)        = 26 (0x1a)
> write(2,"opened hints database /root/exim"...,55) = 55 (0x37)
> getrusage(0,{ u=0.003017,s=0.004896,in=0,out=0 }) = 0 (0x0)
> write(1,"opened 0\n",9)                          = 9 (0x9)
> write(1,"> ",2)                                  = 2 (0x2)
> read(0,"read abcde\n",4096)                      = 11 (0xb)
> getrusage(0,{ u=0.003086,s=0.004896,in=0,out=0 }) = 0 (0x0)
> write(2,"dbfn_read: key=abcde\n",21)             = 21 (0x15)
> pread(0x4,0x800c1f000,0x1000,0x2000,0x1,0x0)     = 4096 (0x1000)
> getrusage(0,{ u=0.003130,s=0.004896,in=0,out=0 }) = 0 (0x0)
> write(1,"the quick brown fox\n",20)              = 20 (0x14)
> write(1,"> ",2)                                  = 2 (0x2)
> read(0,"scan\n",4096)                            = 5 (0x5)
> getrusage(0,{ u=0.003189,s=0.004896,in=0,out=0 }) = 0 (0x0)
> pread(0x4,0x800c20000,0x1000,0x1000,0x1,0x0)     = 4096 (0x1000)
> write(2,"dbfn_read: key=abcde\n",21)             = 21 (0x15)
> write(1,"abcde: the quick brown fox\n",27)       = 27 (0x1b)
> write(2,"dbfn_read: key=abcde\n",21)             = 21 (0x15)
> write(1,"abcde: the quick brown fox\n",27)       = 27 (0x1b)
> write(2,"dbfn_read: key=abcde\n",21)             = 21 (0x15)
> write(1,"abcde: the quick brown fox\n",27)       = 27 (0x1b)
> write(2,"dbfn_read: key=abcde\n",21)             = 21 (0x15)
> write(1,"abcde: the quick brown fox\n",27)       = 27 (0x1b)
> write(2,"dbfn_read: key=abcde\n",21)             = 21 (0x15)
> write(1,"abcde: the quick brown fox\n",27)       = 27 (0x1b)
> write(2,"dbfn_read: key=abcde\n",21)             = 21 (0x15)
> write(1,"abcde: the quick brown fox\n",27)       = 27 (0x1b)
> write(2,"dbfn_read: key=abcde\n",21)             = 21 (0x15)
> write(1,"abcde: the quick brown fox\n",27)       = 27 (0x1b)
> write(2,"dbfn_read: key=abcde\n",21)             = 21 (0x15)
> write(1,"abcde: the quick brown fox\n",27)       = 27 (0x1b)
> write(2,"dbfn_read: key=abcde\n",21)             = 21 (0x15)
> write(1,"abcde: the quick brown fox\n",27)       = 27 (0x1b)
> write(2,"dbfn_read: key=abcde\n",21)             = 21 (0x15)
> write(1,"abcde: the quick brown fox\n",27)       = 27 (0x1b)
> write(2,"dbfn_read: key=abcde\n",21)             = 21 (0x15)
> write(1,"abcde: the quick brown fox\n",27)       = 27 (0x1b)
> ...