[Dovecot] Running on HPUX

Rich Rauenzahn rrauenza at cup.hp.com
Sat Jun 24 02:13:29 EEST 2006


I've gotten fairly far into compiling and running dovecot on HPUX.  The 
problem I'm currently having is that the index seems to be mmap'ed at 
twice after login.  The 576 byte mmap is the index file:

root at hp46t243 # grep mmap64 /tmp/dovecot.tusc
[imap        ][1707] mmap64(NULL, 576, PROT_READ|PROT_WRITE, MAP_SHARED, 
7, 0) = 0xc166c000
[imap        ][1707] mmap64(NULL, 18432, PROT_READ, MAP_SHARED, 8, 0) 
........ = 0xc166d000
[imap        ][1707] mmap64(NULL, 24, PROT_READ, MAP_SHARED, 9, 0) 
........... = 0xc1672000
[imap        ][1707] mmap64(NULL, 576, PROT_READ|PROT_WRITE, MAP_SHARED, 
7, 0) ERR#12 ENOMEM
[imap        ][1717] mmap64(NULL, 576, PROT_READ|PROT_WRITE, MAP_SHARED, 
7, 0) = 0xc166c000
[imap        ][1717] mmap64(NULL, 18432, PROT_READ, MAP_SHARED, 9, 0) 
........ = 0xc166d000
[imap        ][1717] mmap64(NULL, 24, PROT_READ, MAP_SHARED, 8, 0) 
........... = 0xc1672000
[imap        ][1717] mmap64(NULL, 576, PROT_READ|PROT_WRITE, MAP_SHARED, 
7, 0) ERR#12 ENOMEM
[imap        ][1897] mmap64(NULL, 576, PROT_READ|PROT_WRITE, MAP_SHARED, 
7, 0) = 0xc166c000
[imap        ][1897] mmap64(NULL, 18432, PROT_READ, MAP_SHARED, 9, 0) 
........ = 0xc166d000
[imap        ][1897] mmap64(NULL, 24, PROT_READ, MAP_SHARED, 8, 0) 
........... = 0xc1672000
[imap        ][1897] mmap64(NULL, 576, PROT_READ|PROT_WRITE, MAP_SHARED, 
7, 0) ERR#12 ENOMEM
[imap        ][2042] mmap64(NULL, 576, PROT_READ|PROT_WRITE, MAP_SHARED, 
7, 0) = 0xc166c000
[imap        ][2042] mmap64(NULL, 18432, PROT_READ, MAP_SHARED, 9, 0) 
........ = 0xc166d000
[imap        ][2042] mmap64(NULL, 24, PROT_READ, MAP_SHARED, 8, 0) 
........... = 0xc1672000
[imap        ][2042] mmap64(NULL, 576, PROT_READ|PROT_WRITE, MAP_SHARED, 
7, 0) ERR#12 ENOMEM
[imap        ][2178] mmap64(NULL, 576, PROT_READ|PROT_WRITE, MAP_SHARED, 
7, 0) = 0xc166c000
[imap        ][2178] mmap64(NULL, 18432, PROT_READ, MAP_SHARED, 9, 0) 
........ = 0xc166d000
[imap        ][2178] mmap64(NULL, 24, PROT_READ, MAP_SHARED, 8, 0) 
........... = 0xc1672000
[imap        ][2178] mmap64(NULL, 576, PROT_READ|PROT_WRITE, MAP_SHARED, 
7, 0) ERR#12 ENOMEM
[imap        ][2318] mmap64(NULL, 576, PROT_READ|PROT_WRITE, MAP_SHARED, 
7, 0) = 0xc166c000
[imap        ][2318] mmap64(NULL, 18432, PROT_READ, MAP_SHARED, 9, 0) 
........ = 0xc166d000
[imap        ][2318] mmap64(NULL, 24, PROT_READ, MAP_SHARED, 8, 0) 
........... = 0xc1672000
[imap        ][2318] mmap64(NULL, 576, PROT_READ|PROT_WRITE, MAP_SHARED, 
7, 0) ERR#12 ENOMEM
root at hp46t243 #

I think multiple mmap's of the same file are verboten --

         +  In most cases, two separate calls to mmap() cannot map
              overlapping ranges in a file.  The virtual address range
              reserved for a file range is determined at the time of the
              initial mapping of the file range into a process address
              space.  The system allocates only the virtual address range
              necessary to represent the initial mapping.  As long as the
              initial mapping exists, subsequent attempts to map a different
              file range that includes any portion of the initial range may
              fail with an ENOMEM error if an extended contiguous address
              range that preserves the mappings of the initial range cannot
              be allocated.

So, I was trying to look at why the index file is being mapped twice, 
and why the addr isn't saved and reused.  I was thinking of adding it to 
one of the index structures and skipping the mmap if the addr != 0.  
I've been poking around for a couple of hours today and am going to call 
it a day, but I thought I'd ping the list to see if there was something 
obvious I was missing.

Rich




More information about the dovecot mailing list