git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* HTTP tests fail on OS X
@ 2013-06-21  4:27 Brian Gernhardt
  2013-06-21  4:30 ` Jeff King
  0 siblings, 1 reply; 12+ messages in thread
From: Brian Gernhardt @ 2013-06-21  4:27 UTC (permalink / raw)
  To: git@vger.kernel.org List; +Cc: Jeff King

I've bisected it to this commit:

> commit 0442743810c6f6c14386a5a9d6bf8e4d69adbc51
> Author: Jeff King <peff@peff.net>
> Date:   Sun Jun 9 04:07:59 2013 -0400
> 
>     t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4

OS X 10.8.4, apache 2.2.22

I'll also note that the tests fail the first time they attempt to access the server and the cleanup function notes that httpd is not running under the expected PID.  Looking at the httpd setup code, I would have expected to see errors (with -v) and have the setup fail but neither happens.

It's way too late for me, so I can't look at it again for at least several hours.  I figured I'd ping the list in case the problem/solution is obvious to someone else.

~~ Brian Gernhardt

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: HTTP tests fail on OS X
  2013-06-21  4:27 HTTP tests fail on OS X Brian Gernhardt
@ 2013-06-21  4:30 ` Jeff King
  2013-06-21  4:42   ` Jeff King
  0 siblings, 1 reply; 12+ messages in thread
From: Jeff King @ 2013-06-21  4:30 UTC (permalink / raw)
  To: Brian Gernhardt; +Cc: git@vger.kernel.org List

On Fri, Jun 21, 2013 at 12:27:02AM -0400, Brian Gernhardt wrote:

> I've bisected it to this commit:
> 
> > commit 0442743810c6f6c14386a5a9d6bf8e4d69adbc51
> > Author: Jeff King <peff@peff.net>
> > Date:   Sun Jun 9 04:07:59 2013 -0400
> > 
> >     t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4
> 
> OS X 10.8.4, apache 2.2.22

Hrm. That's quite odd. The patch in its entirety looks like this:

diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index 542241b..891edd7 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -1,5 +1,7 @@ LockFile accept.lock
 ServerName dummy
+<IfVersion < 2.4>
 LockFile accept.lock
+</IfVersion>
 PidFile httpd.pid
 DocumentRoot www

So it should not be having any effect at all on apache 2.2, unless it
somehow does not like the <IfVersion> tags.

Puzzled...

-Peff

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: HTTP tests fail on OS X
  2013-06-21  4:30 ` Jeff King
@ 2013-06-21  4:42   ` Jeff King
  2013-06-21  4:45     ` Brian Gernhardt
  0 siblings, 1 reply; 12+ messages in thread
From: Jeff King @ 2013-06-21  4:42 UTC (permalink / raw)
  To: Brian Gernhardt; +Cc: git@vger.kernel.org List

On Fri, Jun 21, 2013 at 12:30:52AM -0400, Jeff King wrote:

> > OS X 10.8.4, apache 2.2.22
> 
> Hrm. That's quite odd. The patch in its entirety looks like this:
> [...]
> So it should not be having any effect at all on apache 2.2, unless it
> somehow does not like the <IfVersion> tags.

Just to double-check, I ran all of the http tests in "next" (with my
series) successfully on apache 2.2.16. So the good news is I haven't
broken apache 2.2.x entirely. :)

I'm not sure if there is something different between 2.2.16 and 2.2.22,
or something with the particular build. Here's my -V output, in case it
helps:

    $ apache2 -V
    Server version: Apache/2.2.16 (Debian)
    Server built:   Mar  3 2013 12:12:28
    Server's Module Magic Number: 20051115:24
    Server loaded:  APR 1.4.2, APR-Util 1.3.9
    Compiled using: APR 1.4.2, APR-Util 1.3.9
    Architecture:   64-bit
    Server MPM:     Worker
      threaded:     yes (fixed thread count)
        forked:     yes (variable process count)
    Server compiled with....
     -D APACHE_MPM_DIR="server/mpm/worker"
     -D APR_HAS_SENDFILE
     -D APR_HAS_MMAP
     -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
     -D APR_USE_SYSVSEM_SERIALIZE
     -D APR_USE_PTHREAD_SERIALIZE
     -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
     -D APR_HAS_OTHER_CHILD
     -D AP_HAVE_RELIABLE_PIPED_LOGS
     -D DYNAMIC_MODULE_LIMIT=128
     -D HTTPD_ROOT="/etc/apache2"
     -D SUEXEC_BIN="/usr/lib/apache2/suexec"
     -D DEFAULT_PIDLOG="/var/run/apache2.pid"
     -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
     -D DEFAULT_ERRORLOG="logs/error_log"
     -D AP_TYPES_CONFIG_FILE="mime.types"
     -D SERVER_CONFIG_FILE="apache2.conf"

-Peff

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: HTTP tests fail on OS X
  2013-06-21  4:42   ` Jeff King
@ 2013-06-21  4:45     ` Brian Gernhardt
  2013-06-21  4:49       ` Jeff King
  0 siblings, 1 reply; 12+ messages in thread
From: Brian Gernhardt @ 2013-06-21  4:45 UTC (permalink / raw)
  To: Jeff King; +Cc: git@vger.kernel.org List


On Jun 21, 2013, at 12:42 AM, Jeff King <peff@peff.net> wrote:

> I'm not sure if there is something different between 2.2.16 and 2.2.22,
> or something with the particular build. Here's my -V output, in case it
> helps:
> 
>    $ apache2 -V
>    Server version: Apache/2.2.16 (Debian)
>    Server built:   Mar  3 2013 12:12:28
>    Server's Module Magic Number: 20051115:24
>    Server loaded:  APR 1.4.2, APR-Util 1.3.9
>    Compiled using: APR 1.4.2, APR-Util 1.3.9
>    Architecture:   64-bit
>    Server MPM:     Worker
>      threaded:     yes (fixed thread count)
>        forked:     yes (variable process count)
>    Server compiled with....
>     -D APACHE_MPM_DIR="server/mpm/worker"
>     -D APR_HAS_SENDFILE
>     -D APR_HAS_MMAP
>     -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
>     -D APR_USE_SYSVSEM_SERIALIZE
>     -D APR_USE_PTHREAD_SERIALIZE
>     -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
>     -D APR_HAS_OTHER_CHILD
>     -D AP_HAVE_RELIABLE_PIPED_LOGS
>     -D DYNAMIC_MODULE_LIMIT=128
>     -D HTTPD_ROOT="/etc/apache2"
>     -D SUEXEC_BIN="/usr/lib/apache2/suexec"
>     -D DEFAULT_PIDLOG="/var/run/apache2.pid"
>     -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
>     -D DEFAULT_ERRORLOG="logs/error_log"
>     -D AP_TYPES_CONFIG_FILE="mime.types"
>     -D SERVER_CONFIG_FILE="apache2.conf"

Doesn't look terribly different from mine.

$ apachectl -V
Server version: Apache/2.2.22 (Unix)
Server built:   Dec  9 2012 18:57:18
Server's Module Magic Number: 20051115:30
Server loaded:  APR 1.4.5, APR-Util 1.3.12
Compiled using: APR 1.4.5, APR-Util 1.3.12
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FLOCK_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/usr"
 -D SUEXEC_BIN="/usr/bin/suexec"
 -D DEFAULT_PIDLOG="/private/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/private/var/run/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/private/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: HTTP tests fail on OS X
  2013-06-21  4:45     ` Brian Gernhardt
@ 2013-06-21  4:49       ` Jeff King
  2013-06-21 17:03         ` Brian Gernhardt
  0 siblings, 1 reply; 12+ messages in thread
From: Jeff King @ 2013-06-21  4:49 UTC (permalink / raw)
  To: Brian Gernhardt; +Cc: git@vger.kernel.org List

On Fri, Jun 21, 2013 at 12:45:25AM -0400, Brian Gernhardt wrote:

> > I'm not sure if there is something different between 2.2.16 and 2.2.22,
> > or something with the particular build. Here's my -V output, in case it
> > helps:
> [...]
> Doesn't look terribly different from mine.

It turns out that 2.2.22 is in Debian testing, so it was easy for me to
downgrade from 2.4 and try it. Seems to also work fine for me. So I
don't think it's an apache version issue.

I also installed the prefork mpm in case that was part of the problem.
But it all seems fine here, and my build parameters look quite similar
to yours.

I'm not sure what else to look at...I guess try ratcheting up the
debugging/log level on your failing copy and see if it prints anything
useful.

-Peff

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: HTTP tests fail on OS X
  2013-06-21  4:49       ` Jeff King
@ 2013-06-21 17:03         ` Brian Gernhardt
  2013-06-21 18:03           ` Jeff King
  0 siblings, 1 reply; 12+ messages in thread
From: Brian Gernhardt @ 2013-06-21 17:03 UTC (permalink / raw)
  To: Jeff King; +Cc: git@vger.kernel.org List


On Jun 21, 2013, at 12:49 AM, Jeff King <peff@peff.net> wrote:

> I'm not sure what else to look at...I guess try ratcheting up the
> debugging/log level on your failing copy and see if it prints anything
> useful.

I found this error in the error.log:

[Fri Jun 21 12:59:59 2013] [emerg] (2)No such file or directory: Couldn't create accept lock (/private/var/run/accept.lock.64288) (5)

Annoying that httpd returns before it tries to create the lock.

Without the IfVersion directive, it creates the lock in the ./httpd directory instead.  Not sure why apache is doing that, it's very irritating.

~~ Brian

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: HTTP tests fail on OS X
  2013-06-21 17:03         ` Brian Gernhardt
@ 2013-06-21 18:03           ` Jeff King
  2013-06-21 18:08             ` Brian Gernhardt
  0 siblings, 1 reply; 12+ messages in thread
From: Jeff King @ 2013-06-21 18:03 UTC (permalink / raw)
  To: Brian Gernhardt; +Cc: git@vger.kernel.org List

On Fri, Jun 21, 2013 at 01:03:40PM -0400, Brian Gernhardt wrote:

> On Jun 21, 2013, at 12:49 AM, Jeff King <peff@peff.net> wrote:
> 
> > I'm not sure what else to look at...I guess try ratcheting up the
> > debugging/log level on your failing copy and see if it prints anything
> > useful.
> 
> I found this error in the error.log:
> 
> [Fri Jun 21 12:59:59 2013] [emerg] (2)No such file or directory: Couldn't create accept lock (/private/var/run/accept.lock.64288) (5)

Hmm. I am far from an apache expert, but I believe that is what would
happen if the LockFile directive was not there at all. IOW, it seems
like your apache is treating "<IfVersion < 2.4>" as false. Which seems
weird to me.

It's possible I'm using IfVersion wrong, though it does seem to work for
me elsewhere.

IfVersion comes from mod_version. I assume that if it were not loaded,
apache would complain about the directive entirely. But it's true that
we don't load it until later. Maybe try moving the IfVersion/Lockfile
stanza down below the mod_version LoadModule line?

-Peff

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: HTTP tests fail on OS X
  2013-06-21 18:03           ` Jeff King
@ 2013-06-21 18:08             ` Brian Gernhardt
  2013-06-21 18:12               ` [PATCH] lib-httpd/apache.conf: check version only after mod_version loads Jeff King
  0 siblings, 1 reply; 12+ messages in thread
From: Brian Gernhardt @ 2013-06-21 18:08 UTC (permalink / raw)
  To: Jeff King; +Cc: git@vger.kernel.org List


On Jun 21, 2013, at 2:03 PM, Jeff King <peff@peff.net> wrote:

> IfVersion comes from mod_version. I assume that if it were not loaded,
> apache would complain about the directive entirely. But it's true that
> we don't load it until later. Maybe try moving the IfVersion/Lockfile
> stanza down below the mod_version LoadModule line?

Apache is apparently overly accepting.  Moving the IfVersion below all the IfModules fixes it.

~~ Brian

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] lib-httpd/apache.conf: check version only after mod_version loads
  2013-06-21 18:08             ` Brian Gernhardt
@ 2013-06-21 18:12               ` Jeff King
  2013-06-21 18:15                 ` Brian Gernhardt
  2013-06-21 20:59                 ` Junio C Hamano
  0 siblings, 2 replies; 12+ messages in thread
From: Jeff King @ 2013-06-21 18:12 UTC (permalink / raw)
  To: Brian Gernhardt; +Cc: Junio C Hamano, git@vger.kernel.org List

On Fri, Jun 21, 2013 at 02:08:49PM -0400, Brian Gernhardt wrote:

> On Jun 21, 2013, at 2:03 PM, Jeff King <peff@peff.net> wrote:
> 
> > IfVersion comes from mod_version. I assume that if it were not
> > loaded, apache would complain about the directive entirely. But it's
> > true that we don't load it until later. Maybe try moving the
> > IfVersion/Lockfile stanza down below the mod_version LoadModule
> > line?
> 
> Apache is apparently overly accepting.  Moving the IfVersion below all
> the IfModules fixes it.

Cool. I think the patch should look like the one below, then.

Just to double-check that I have explained the issue correctly, can you
share the output of "apache2 -l"? Mine has:

  $ apache2 -l
  Compiled in modules:
    core.c
    mod_log_config.c
    mod_logio.c
    mod_version.c
    prefork.c
    http_core.c
    mod_so.c

which explains why it works here. I'm assuming you will not have
mod_version.c compiled in.

-- >8 --
Subject: lib-httpd/apache.conf: check version only after mod_version loads

Commit 0442743 introduced an <IfVersion> directive near the
top of the apache config file. However, at that point we
have not yet checked for and loaded the mod_version module.
This means that the directive will behave oddly if
mod_version is dynamically loaded, failing to match when it
should.

We can fix this by moving the whole block below the
LoadModule directive for mod_version.

Reported-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Jeff King <peff@peff.net>
---
 t/lib-httpd/apache.conf | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index 56ae548..dd17e3a 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -1,7 +1,4 @@ ServerName dummy
 ServerName dummy
-<IfVersion < 2.4>
-LockFile accept.lock
-</IfVersion>
 PidFile httpd.pid
 DocumentRoot www
 LogFormat "%h %l %u %t \"%r\" %>s %b" common
@@ -26,6 +23,10 @@ ErrorLog error.log
 	LoadModule version_module modules/mod_version.so
 </IfModule>
 
+<IfVersion < 2.4>
+LockFile accept.lock
+</IfVersion>
+
 <IfVersion < 2.1>
 <IfModule !mod_auth.c>
 	LoadModule auth_module modules/mod_auth.so
-- 
1.8.3.rc2.14.g7eee6b3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] lib-httpd/apache.conf: check version only after mod_version loads
  2013-06-21 18:12               ` [PATCH] lib-httpd/apache.conf: check version only after mod_version loads Jeff King
@ 2013-06-21 18:15                 ` Brian Gernhardt
  2013-06-21 18:18                   ` Jeff King
  2013-06-21 20:59                 ` Junio C Hamano
  1 sibling, 1 reply; 12+ messages in thread
From: Brian Gernhardt @ 2013-06-21 18:15 UTC (permalink / raw)
  To: Jeff King; +Cc: Junio C Hamano, git@vger.kernel.org List


On Jun 21, 2013, at 2:12 PM, Jeff King <peff@peff.net> wrote:

> On Fri, Jun 21, 2013 at 02:08:49PM -0400, Brian Gernhardt wrote:
> 
>> On Jun 21, 2013, at 2:03 PM, Jeff King <peff@peff.net> wrote:
>> 
>>> IfVersion comes from mod_version. I assume that if it were not
>>> loaded, apache would complain about the directive entirely. But it's
>>> true that we don't load it until later. Maybe try moving the
>>> IfVersion/Lockfile stanza down below the mod_version LoadModule
>>> line?
>> 
>> Apache is apparently overly accepting.  Moving the IfVersion below all
>> the IfModules fixes it.
> 
> Cool. I think the patch should look like the one below, then.

Basically identical to what I've done, you're just faster to the actual patch.  :-D

+1

> Just to double-check that I have explained the issue correctly, can you
> share the output of "apache2 -l"? Mine has:
> 
>  $ apache2 -l
>  Compiled in modules:
>    core.c
>    mod_log_config.c
>    mod_logio.c
>    mod_version.c
>    prefork.c
>    http_core.c
>    mod_so.c
> 
> which explains why it works here. I'm assuming you will not have
> mod_version.c compiled in.

Indeed I do not.

 $ httpd -l
 Compiled in modules:
   core.c
   prefork.c
   http_core.c
   mod_so.c

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] lib-httpd/apache.conf: check version only after mod_version loads
  2013-06-21 18:15                 ` Brian Gernhardt
@ 2013-06-21 18:18                   ` Jeff King
  0 siblings, 0 replies; 12+ messages in thread
From: Jeff King @ 2013-06-21 18:18 UTC (permalink / raw)
  To: Brian Gernhardt; +Cc: Junio C Hamano, git@vger.kernel.org List

On Fri, Jun 21, 2013 at 02:15:39PM -0400, Brian Gernhardt wrote:

> > Cool. I think the patch should look like the one below, then.
> 
> Basically identical to what I've done, you're just faster to the actual patch.  :-D

I started writing the rationale immediately after making the suggestion,
before you responded.  Lucky for me my guess turned out to be right. :)

> > which explains why it works here. I'm assuming you will not have
> > mod_version.c compiled in.
> 
> Indeed I do not.
> 
>  $ httpd -l
>  Compiled in modules:
>    core.c
>    prefork.c
>    http_core.c
>    mod_so.c

Makes sense. Thanks for the bug report.

-Peff

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] lib-httpd/apache.conf: check version only after mod_version loads
  2013-06-21 18:12               ` [PATCH] lib-httpd/apache.conf: check version only after mod_version loads Jeff King
  2013-06-21 18:15                 ` Brian Gernhardt
@ 2013-06-21 20:59                 ` Junio C Hamano
  1 sibling, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2013-06-21 20:59 UTC (permalink / raw)
  To: Jeff King; +Cc: Brian Gernhardt, git@vger.kernel.org List

Jeff King <peff@peff.net> writes:

> Cool. I think the patch should look like the one below, then.
>
> Just to double-check that I have explained the issue correctly, can you
> share the output of "apache2 -l"? Mine has:
>
>   $ apache2 -l
>   Compiled in modules:
>     core.c
>     mod_log_config.c
>     mod_logio.c
>     mod_version.c
>     prefork.c
>     http_core.c
>     mod_so.c
>
> which explains why it works here. I'm assuming you will not have
> mod_version.c compiled in.
>
> -- >8 --
> Subject: lib-httpd/apache.conf: check version only after mod_version loads
>
> Commit 0442743 introduced an <IfVersion> directive near the
> top of the apache config file. However, at that point we
> have not yet checked for and loaded the mod_version module.
> This means that the directive will behave oddly if
> mod_version is dynamically loaded, failing to match when it
> should.
>
> We can fix this by moving the whole block below the
> LoadModule directive for mod_version.
>
> Reported-by: Brian Gernhardt <brian@gernhardtsoftware.com>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
>  t/lib-httpd/apache.conf | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
> index 56ae548..dd17e3a 100644
> --- a/t/lib-httpd/apache.conf
> +++ b/t/lib-httpd/apache.conf
> @@ -1,7 +1,4 @@ ServerName dummy
>  ServerName dummy
> -<IfVersion < 2.4>
> -LockFile accept.lock
> -</IfVersion>
>  PidFile httpd.pid
>  DocumentRoot www
>  LogFormat "%h %l %u %t \"%r\" %>s %b" common
> @@ -26,6 +23,10 @@ ErrorLog error.log
>  	LoadModule version_module modules/mod_version.so
>  </IfModule>
>  
> +<IfVersion < 2.4>
> +LockFile accept.lock
> +</IfVersion>
> +

Once you see it in the patch form, it is very clear what this change
does and why it is necessary in the context ;-)

Thanks, both of you, for digging this down to the root cause; you
guys have done before it graduates to 'master', which I especially
appreciate.

Will queue.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-06-21 21:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-21  4:27 HTTP tests fail on OS X Brian Gernhardt
2013-06-21  4:30 ` Jeff King
2013-06-21  4:42   ` Jeff King
2013-06-21  4:45     ` Brian Gernhardt
2013-06-21  4:49       ` Jeff King
2013-06-21 17:03         ` Brian Gernhardt
2013-06-21 18:03           ` Jeff King
2013-06-21 18:08             ` Brian Gernhardt
2013-06-21 18:12               ` [PATCH] lib-httpd/apache.conf: check version only after mod_version loads Jeff King
2013-06-21 18:15                 ` Brian Gernhardt
2013-06-21 18:18                   ` Jeff King
2013-06-21 20:59                 ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).