Bug #924

1.5.0 doesn't work on FreeBSD

Added by Anonymous 720 days ago. Updated 678 days ago.

Status:Fixed Start:
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:core
Target version:-
Pending:

Resolution:

fixed


Description

aio_suspend is not currently implemented in FreeBSD.

configure finds aio.h, but also seems not to use "linux-aio":


[...]
checking for lua... yes
checking for LUA... yes
checking for libaio... no
checking for library containing aio_suspend... none required
checking aio.h usability... yes
checking aio.h presence... yes
checking for aio.h... yes
checking for library containing crypt... -lcrypt
[...]
enabled:
  auth-crypt
  compress-bzip2
  compress-deflate
  compress-gzip
  large-files
  network-openssl
  regex-conditionals
disabled:
  auth-ldap
  linux-libaio
  network-ipv6
  stat-cache-fam
  storage-gdbm
  storage-memcache
  webdav-locks
  webdav-properties

Manually editing config.h (removing HAVE_AIO_H) works around this and reverts to the previous behaviour: it dumps on the first requested page.


GNU gdb 6.1.1 [FreeBSD]
[...]
(gdb) bt
#0  0x282514af in kevent () from /lib/libc.so.6
#1  0x0805f9e1 in fdevent_freebsd_kqueue_poll ()
#2  0x0804db58 in lighty_mainloop ()
#3  0x0804ed4d in main ()
(gdb) c
Continuing.
[...a request is done...]

Program received signal SIGSEGV, Segmentation fault.
0x0805bc5a in fdevent_get_revents ()
(gdb) bt
#0  0x0805bc5a in fdevent_get_revents ()
#1  0x0804db70 in lighty_mainloop ()
#2  0x0804ed4d in main ()
(gdb)

-- lapo

lighttpd-1.5.0-kqueue.diff - replace ev->used with event_count (490 Bytes) jakabosky, 12/04/2006 01:58 AM

History

12/02/2006 02:01 AM - Anonymous

Forgot to tell I used current SVN (r1464).

-- lapo

12/02/2006 07:15 AM - jakabosky

can you compile it with debugging turned on.

This is what I use on my linux computer:
CFLAGS=" -g3 -O " CXXFLAGS=" -g3 -O " ./configure --enable-maintainer-mode

I only use linux but I might be able to find the problem, if you do another backtrace
with debugging turned on.

12/02/2006 10:25 AM - Anonymous

Sure, here it goes:


[Switching to Thread 0x8082000 (LWP 100092)]
0x08060eab in fdevent_get_revents (ev=0x8098000, event_count=1, 
    revents=0x8095aa0) at fdevent.c:216
216                     fdevent_revent *r = revents->ptr[i];
(gdb) bt
#0  0x08060eab in fdevent_get_revents (ev=0x8098000, event_count=1, 
    revents=0x8095aa0) at fdevent.c:216
#1  0x0804efa7 in lighty_mainloop (srv=0x8085000) at server.c:972
#2  0x08050775 in main (argc=4, argv=0xbfbfeaa0, envp=0xbfbfeab4)
    at server.c:1673

BTW: It seems that aio_suspend is implemented really, but must must be loaded into the kernel with kldload aio (it also lacks to recognize the need for -pthread in the last link step).

-- lapo

12/02/2006 10:39 PM - jakabosky

I have attached a patch that should fix this bug.
  1. cd lighttpd/
  2. patch -p0 <../lighttpd-1.5.0-kqueue.diff
  3. make

12/03/2006 06:00 PM - Anonymous

That patch changed the segfault to:


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x8082000 (LWP 100181)]
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0x0804effd in lighty_mainloop (srv=0x8085000) at server.c:991
#2  0x08050775 in main (argc=4, argv=0xbfbfeaa0, envp=0xbfbfeab4)
    at server.c:1673

If I can debug it further to provide more infos, please tell me how.

-- lapo

12/04/2006 02:23 AM - jakabosky

I have changed the patch. You will need to revert the changes from the old patch.

svn revert src/fdevent_freebsd_kqueue.c

12/04/2006 06:52 AM - Anonymous

Confirmed as working, I guess it can be committed.

-- lapo

12/04/2006 09:47 PM - jakabosky

Jan or someone with write access to svn will need to commit the patch.

Also did you need to make any changes to get aio_suspend to work?

01/13/2007 12:24 AM - jakabosky

  • Status changed from New to Fixed
  • Resolution set to fixed

fix has been committed to svn trunk

Also available in: Atom PDF