On Thursday 06:05 AM 1/10/2008, Nick Miller wrote:
I have been having some issues getting AOLServer 4.5 or 4.0.10 to run on Mac OS X 10.5
I compiled and installed AOL Server and Tcl on Mac OS X 10.5 with noÂ
issues but then tried to run the NSDs only to get a "SegmentationÂ
Fault".

The short answer: you need to explicitly set ulimit -n (open files)--even though it will look like it's set to 256 by default. Any valid value (including 256) will resolve the problem.

The longer answer: the file limit code in nsd/fd.c is no longer valid, because of this:

--------------------------------------------------------
setrlimit() now returns with errno set to EINVAL in places that histori-
cally succeeded.  It no longer accepts "rlim_cur = RLIM_INFINITY" for
RLIM_NOFILE.  Use "rlim_cur = min(OPEN_MAX, rlim_max)".

http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/setrlimit.2.html
--------------------------------------------------------

And sure enough, AOLserver 4 sets rl.rlim_cur = rl.rlim_max at nsd/fd.c:128 when rl.rlim_max equals RLM_INFINITY, resulting in an invalid setrlimit() call. Which would be obvious but for another problem: for some reason, the subsequent Ns_Log() call that passes in rl.rlim_max to report this error causes memory corruption that results in the segmentation fault (apparently because the fmt parameter to Ns_Log somehow gets mangled). The AOLserver code there looks fine to me, so that may be a bug in OS X.

- John


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to