faqts : Computers : Internet : Domain Names : djbdns

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

9 of 9 people (100%) answered Yes
Recently 9 of 9 people (100%) answered Yes

Entry

How do I prevent memory allocation failures on OpenBSD?

Feb 16th, 2003 00:49
Brian Coogan,


Tinydns et al fail with memory allocation errors on later versions of 
OpenBSD (I think 3.0 upwards, but not sure exactly).  The fix is to 
change the softlimit value in the runfile to increase the allocatable 
memory limit.  (The failures also occur with 
dnscache/walldns/publicfile etc).
Log messages for tinydns exhibiting this problem are as follows, taken 
from /service/tinydns/log/main/current:
@400000003e4f34340b300d44 /usr/libexec/ld.so: tinydns: libc.so.28.5: 
Cannot allocate memory
@400000003e4f34351d399334 /usr/libexec/ld.so: tinydns: libc.so.28.5: 
Cannot allocate memory
@400000003e4f343623ae9ee4 /usr/libexec/ld.so: tinydns: libc.so.28.5: 
Cannot allocate memory
Adjusting the /service/*/run file to increase the data limit value 
(the nnn in softlimit –dnnn) fixes the problem – for instance, with 
tinydns:
  #!/bin/sh
  exec 2>&1
  exec envuidgid Gtinydns envdir ./env softlimit -d3500000 \
    /usr/local/bin/tinydns
You may need to try various values for the –d value to get it to work; 
once it works, it will continue to do so as tinydns and friends always 
allocate all their memory on startup.
For further reference:
   http://monkey.org/openbsd/archive/bugs/0105/msg00153.html
(the OpenBSD libc data area became huge with later releases and hasn't 
been reduced as of writing, hence the problems.  This isn't strictly 
an OS bug, although one hopes the OpenBSD folks will improve the 
situation soon)
Mailing list articles:
         http://marc.theaimsgroup.com/?
l=djbdns&w=2&r=1&s=cannot+allocate+memory&q=b