Project

General

Profile

Actions

Bug #2789

closed

lighttpd cores on AIX when nofiles is unlimited

Added by adh almost 8 years ago. Updated almost 8 years ago.

Status:
Fixed
Priority:
Low
Category:
core
Target version:
ASK QUESTIONS IN Forums:

Description

If nofiles is unlimited, lighttpd cores at startup with no error in the log file.

foo.conf:

server.document-root="/users/adh/data"
server.port=8085
server.pid-file="/users/adh/logs/lighttpd.pid"
server.modules = ( "mod_access" )
dir-listing.activate="enable"
mimetype.assign = (
".html" => "text/html",
".js" => "text/javascript",
".svg" => "image/svg+xml",
".svgz" => "image/svg+xml",
".css" => "text/css",
"" => "text/plain"
)

ulimit -n unlimited

lighttpd -D -f foo.conf

2017-02-13 11:14:10: (log.c.217) server started
fdevent.c.24: assertion failed: NULL != ev->fdarray

Program received signal SIGABRT, Aborted.
[Switching to Thread 1]
0xd053c8d4 in pthread_kill () from /usr/lib/libpthreads.a(shr_xpg5.o)
(gdb) bt
#0 0xd053c8d4 in pthread_kill () from /usr/lib/libpthreads.a(shr_xpg5.o)
#1 0xd053bd68 in _p_raise () from /usr/lib/libpthreads.a(shr_xpg5.o)
#2 0xd01209a4 in raise () from /usr/lib/libc.a(shr.o)
#3 0xd017c168 in abort () from /usr/lib/libc.a(shr.o)
#4 0xd6f9ff20 in log_failed_assert (filename=0xd6fc43a0 "fd\ev\ent.c", line=24,
msg=0xd6fc43cc "ass\ertion fail\ed: NULL != \ev->fdarray") at buffer.c:1100
#5 0xd6fa5804 in fdevent_init (srv=0x2002ecb8, maxfds=2147483648, type=FDEVENT_HANDLER_POLL)
at fdevent.c:24
#6 0x10003190 in main (argc=4, argv=0x2ff21e1c) at server.c:1440

lighttpd -version
lighttpd/1.4.43 - a light and fast webserver
Build-Date: Feb 1 2017 12:02:34

Actions #1

Updated by gstrauss almost 8 years ago

  • Status changed from New to Patch Pending
  • Priority changed from Normal to Low
  • Target version changed from 1.4.x to 1.4.46

What, you don't have 64GB of memory for that memory allocation? ;)

Try this, for adding error trace instead of aborting. You should set server.max-fds in your config to avoid this.

--- a/src/fdevent.c
+++ b/src/fdevent.c
@@ -21,7 +21,12 @@ fdevents *fdevent_init(server *srv, size_t maxfds, fdevent_handler_t type) {
        force_assert(NULL != ev);
        ev->srv = srv;
        ev->fdarray = calloc(maxfds, sizeof(*ev->fdarray));
-       force_assert(NULL != ev->fdarray);
+       if (NULL == ev->fdarray) {
+               log_error_write(srv, __FILE__, __LINE__, "SDS",
+                               "server.max-fds too large? (", maxfds, ")");
+               free(ev);
+               return NULL;
+       }
        ev->maxfds = maxfds;
        ev->highfd = -1;

Actions #2

Updated by gstrauss almost 8 years ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 0 to 100
Actions

Also available in: Atom