From owner-freebsd-apache@FreeBSD.ORG Wed May 25 06:00:55 2011 Return-Path: Delivered-To: freebsd-apache@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 49F89106564A for ; Wed, 25 May 2011 06:00:55 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-5.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 9FDB91543FA; Wed, 25 May 2011 06:00:54 +0000 (UTC) Message-ID: <4DDC9B15.2090703@FreeBSD.org> Date: Tue, 24 May 2011 23:00:53 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 MIME-Version: 1.0 To: freebsd-apache@FreeBSD.org X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Interesting apache 2.2 + accept filter problem X-BeenThere: freebsd-apache@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Support of apache-related ports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2011 06:00:55 -0000 Howdy, I have an odd one here, and I'm hoping to get some insight. I'm using apache 2.2 (latest ports version) along with the accf_http kernel module (which is loaded). If I start it the "normal" way, everything works just fine. However if I start it with -D FOREGROUND then I get the following error in httpd-error.log: (22)Invalid argument: Failed to enable the 'httpready' Accept Filter So I reduced everything down to a test case, and I can easily reproduce it with nothing but a clean ports install (minus SSL, which doesn't make a difference in the outcome, but simplified the ktrace). I've run 'ktrace httpd' and 'ktrace httpd -D FOREGROUND' numerous times, and there is one very clear difference. The first, which works, looks like this: 48226 initial thread CALL setsockopt(0x3,SOL_SOCKET,SO_REUSEADDR,0x7fffffffe80c,0x4) 48226 initial thread RET setsockopt 0 48226 initial thread CALL setsockopt(0x3,SOL_SOCKET,SO_KEEPALIVE,0x7fffffffe80c,0x4) 48226 initial thread RET setsockopt 0 48226 initial thread CALL setsockopt(0x3,0x6,0x1,0x7fffffffe7ec,0x4) 48226 initial thread RET setsockopt 0 48226 initial thread CALL setsockopt(0x3,SOL_SOCKET,SO_ACCEPTFILTER,0x7fffffffe6e0,0x100) 48226 initial thread RET setsockopt 0 The weird thing is that the second one, which produces the error, is exactly the same, except that there is one extra call at the end, which is the one that fails: 48208 initial thread CALL setsockopt(0x3,SOL_SOCKET,SO_REUSEADDR,0x7fffffffe7ec,0x4) 48208 initial thread RET setsockopt 0 48208 initial thread CALL setsockopt(0x3,SOL_SOCKET,SO_KEEPALIVE,0x7fffffffe7ec,0x4) 48208 initial thread RET setsockopt 0 48208 initial thread CALL setsockopt(0x3,0x6,0x1,0x7fffffffe7cc,0x4) 48208 initial thread RET setsockopt 0 48208 initial thread CALL setsockopt(0x3,SOL_SOCKET,SO_ACCEPTFILTER,0x7fffffffe6c0,0x100) 48208 initial thread RET setsockopt 0 48208 initial thread CALL setsockopt(0x3,SOL_SOCKET,SO_ACCEPTFILTER,0x7fffffffe6c0,0x100) 48208 initial thread RET setsockopt -1 errno 22 Invalid argument I cannot figure out what it is about running in the foreground that is causing that last call, and I've run out of things to test or try, so I'm asking for help. Any ideas? BTW, not sure it matters but the the reason that I want to add -D FOREGROUND is for use with daemontools. However I've managed to isolate the error to just 'httpd -D FOREGROUND' on the command line without anything else involved. Thanks, Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/