Re: ab issues (just on macOS?)
What I did was force the ab from the test framework to bind itself to 127.0.0.1 and all is now working OK. > On Apr 10, 2018, at 1:33 PM, Joe Orton wrote: > > On Tue, Apr 10, 2018 at 08:47:03AM -0400, Jim Jagielski wrote: >> My understanding is that this patch was specifically designed >> to address this exact situation, so I am confused why it >> seems to be causing the problem... It's like ab tries ::1, >> doesn't connect and then fails immediately instead of >> then trying 127.0.0.1... > > Can you run ab under something strace-like to see what it's trying to > do? > > Since the test suite defaults to v4-only, possibly we should switch the > test suite to run against http://127.0.0.1:N/ rather than relying on > localhost resolving properly, though exposing these bugs is a good > thing. > > Regardsm Joe
Re: ab issues (just on macOS?)
On Tue, Apr 10, 2018 at 08:47:03AM -0400, Jim Jagielski wrote: > My understanding is that this patch was specifically designed > to address this exact situation, so I am confused why it > seems to be causing the problem... It's like ab tries ::1, > doesn't connect and then fails immediately instead of > then trying 127.0.0.1... Can you run ab under something strace-like to see what it's trying to do? Since the test suite defaults to v4-only, possibly we should switch the test suite to run against http://127.0.0.1:N/ rather than relying on localhost resolving properly, though exposing these bugs is a good thing. Regardsm Joe
Re: ab issues (just on macOS?)
My understanding is that this patch was specifically designed to address this exact situation, so I am confused why it seems to be causing the problem... It's like ab tries ::1, doesn't connect and then fails immediately instead of then trying 127.0.0.1... > On Apr 10, 2018, at 7:14 AM, Jim Jagielski wrote: > > Yeah... this seems related to > >http://svn.apache.org/viewvc?view=revision&revision=1826891 > >> On Apr 10, 2018, at 7:06 AM, Jim Jagielski wrote: >> >> % host localhost. >> localhost has address 127.0.0.1 >> localhost has IPv6 address ::1 >> >> What I think is going on is that ab is using ::1 but httpd is just bound on >> 127.0.0.1 >> >> >>> On Apr 9, 2018, at 7:19 PM, Daniel Ruggeri wrote: >>> >>> That's interesting. Does your machine bind on both IPv6 and IPv4? I would >>> assume just v4 and you have a localhost as ::1 in your hosts file. Is that >>> the case? >>> -- >>> Daniel Ruggeri >>> >>> On April 9, 2018 4:43:42 PM CDT, Jim Jagielski wrote: OK... if I change the test to use 127.0.0.1 instead of localhost, all is well. So I'm guessing it is an IPv6 issue... ? >> >
Re: ab issues (just on macOS?)
My test and build system is IPv4 w/ IPv6 Local Link Only. > On Apr 10, 2018, at 7:19 AM, Eric Covener wrote: > > On Tue, Apr 10, 2018 at 7:14 AM, Jim Jagielski wrote: >> Yeah... this seems related to >> >>http://svn.apache.org/viewvc?view=revision&revision=1826891 > > Hrm -- My test config is all ipv4-only on linux (Listen 0.0.0.0:*) so > w/o that patch if localhost returned ::1 first you'd get the same > symptom. > > -- > Eric Covener > cove...@gmail.com
Re: ab issues (just on macOS?)
Some Linux setups mention ::1 for localhost first in /etc/hosts. I vaguely remember once having been bitten by that. > Am 10.04.2018 um 13:19 schrieb Eric Covener : > > On Tue, Apr 10, 2018 at 7:14 AM, Jim Jagielski wrote: >> Yeah... this seems related to >> >>http://svn.apache.org/viewvc?view=revision&revision=1826891 > > Hrm -- My test config is all ipv4-only on linux (Listen 0.0.0.0:*) so > w/o that patch if localhost returned ::1 first you'd get the same > symptom. > > -- > Eric Covener > cove...@gmail.com
Re: ab issues (just on macOS?)
On Tue, Apr 10, 2018 at 7:14 AM, Jim Jagielski wrote: > Yeah... this seems related to > > http://svn.apache.org/viewvc?view=revision&revision=1826891 Hrm -- My test config is all ipv4-only on linux (Listen 0.0.0.0:*) so w/o that patch if localhost returned ::1 first you'd get the same symptom. -- Eric Covener cove...@gmail.com
Re: ab issues (just on macOS?)
Yeah... this seems related to http://svn.apache.org/viewvc?view=revision&revision=1826891 > On Apr 10, 2018, at 7:06 AM, Jim Jagielski wrote: > > % host localhost. > localhost has address 127.0.0.1 > localhost has IPv6 address ::1 > > What I think is going on is that ab is using ::1 but httpd is just bound on > 127.0.0.1 > > >> On Apr 9, 2018, at 7:19 PM, Daniel Ruggeri wrote: >> >> That's interesting. Does your machine bind on both IPv6 and IPv4? I would >> assume just v4 and you have a localhost as ::1 in your hosts file. Is that >> the case? >> -- >> Daniel Ruggeri >> >> On April 9, 2018 4:43:42 PM CDT, Jim Jagielski wrote: >>> OK... if I change the test to use 127.0.0.1 instead of localhost, all >>> is well. So I'm guessing it is an IPv6 issue... ? >
Re: ab issues (just on macOS?)
% host localhost. localhost has address 127.0.0.1 localhost has IPv6 address ::1 What I think is going on is that ab is using ::1 but httpd is just bound on 127.0.0.1 > On Apr 9, 2018, at 7:19 PM, Daniel Ruggeri wrote: > > That's interesting. Does your machine bind on both IPv6 and IPv4? I would > assume just v4 and you have a localhost as ::1 in your hosts file. Is that > the case? > -- > Daniel Ruggeri > > On April 9, 2018 4:43:42 PM CDT, Jim Jagielski wrote: >> OK... if I change the test to use 127.0.0.1 instead of localhost, all >> is well. So I'm guessing it is an IPv6 issue... ?
Re: ab issues (just on macOS?)
That's interesting. Does your machine bind on both IPv6 and IPv4? I would assume just v4 and you have a localhost as ::1 in your hosts file. Is that the case? -- Daniel Ruggeri On April 9, 2018 4:43:42 PM CDT, Jim Jagielski wrote: >OK... if I change the test to use 127.0.0.1 instead of localhost, all >is well. So I'm guessing it is an IPv6 issue... ?
Re: ab issues (just on macOS?)
OK... if I change the test to use 127.0.0.1 instead of localhost, all is well. So I'm guessing it is an IPv6 issue... ?
Re: ab issues (just on macOS?)
No problem w/ the script: /opt/perl5/bin/perl ./scr.pl Result was Hello there > On Apr 9, 2018, at 2:14 PM, Daniel Ruggeri wrote: > > use strict; > use IPC::Open3; > use Symbol; > > my $results = run_and_gather_output("echo 'Hello there'"); > print "Result was " . join("", @{$results->{stdout}}) . "\n"; > > sub run_and_gather_output { >my $command = shift; >my ($cin, $cout, $cerr); >$cerr = gensym(); >my $pid = open3($cin, $cout, $cerr, $command); >waitpid( $pid, 0 ); >my $status = $? >> 8; >my @cstdout = <$cout>; >my @cstderr = <$cerr>; >return { status => $status, stdout => \@cstdout, stderr => \@cstderr }; > }
Re: ab issues (just on macOS?)
On 2018-04-09 11:00, Jim Jagielski wrote: Anyone else seeing issues w/ the Perl test framework's ab test... t/ab/base.t .. 1..5 # Running under perl version 5.020003 for darwin # Current time local: Mon Apr 9 11:59:20 2018 # Current time GMT: Mon Apr 9 15:59:20 2018 # Using Test.pm version 1.26 # Using Apache/Test.pm version 1.41 # # running: # /usr/local2/apache2/bin/ab -q -n 10 http://localhost:8529/ not ok 1 not ok 2 # # running: # /usr/local2/apache2/bin/ab -q -n 10 https://localhost:8532/ # Failed test 1 in t/ab/base.t at line 33 # Failed test 2 in t/ab/base.t at line 34 not ok 3 # Failed test 3 in t/ab/base.t at line 39 not ok 4 # Test 4 got: "4" (t/ab/base.t at line 40) # Expected: "0" (https had stderr output:$VAR1 = [ # ' #', # 'Test aborted after 10 failures #', # ' #', # 'apr_socket_connect(): Connection refused (61) #' #]; #) ok 5 Failed 4/5 subtests I just recently added this test to start getting coverage on ab. It uses IPC::Open3 which is a potential hiccup. Would you mind running this script like so: `perl ./script.pl`? use strict; use IPC::Open3; use Symbol; my $results = run_and_gather_output("echo 'Hello there'"); print "Result was " . join("", @{$results->{stdout}}) . "\n"; sub run_and_gather_output { my $command = shift; my ($cin, $cout, $cerr); $cerr = gensym(); my $pid = open3($cin, $cout, $cerr, $command); waitpid( $pid, 0 ); my $status = $? >> 8; my @cstdout = <$cout>; my @cstderr = <$cerr>; return { status => $status, stdout => \@cstdout, stderr => \@cstderr }; } Depending on if/where this fails, it should point out why your machine may be having problems (I don't have a way to test this on macOS). I *DID* see some strange behavior on my Linux box in that open3 munged both STDERR and STDOUT into a single stream... which is very unexpected. -- Daniel Ruggeri
ab issues (just on macOS?)
Anyone else seeing issues w/ the Perl test framework's ab test... t/ab/base.t .. 1..5 # Running under perl version 5.020003 for darwin # Current time local: Mon Apr 9 11:59:20 2018 # Current time GMT: Mon Apr 9 15:59:20 2018 # Using Test.pm version 1.26 # Using Apache/Test.pm version 1.41 # # running: # /usr/local2/apache2/bin/ab -q -n 10 http://localhost:8529/ not ok 1 not ok 2 # # running: # /usr/local2/apache2/bin/ab -q -n 10 https://localhost:8532/ # Failed test 1 in t/ab/base.t at line 33 # Failed test 2 in t/ab/base.t at line 34 not ok 3 # Failed test 3 in t/ab/base.t at line 39 not ok 4 # Test 4 got: "4" (t/ab/base.t at line 40) # Expected: "0" (https had stderr output:$VAR1 = [ # ' #', # 'Test aborted after 10 failures #', # ' #', # 'apr_socket_connect(): Connection refused (61) #' #]; #) ok 5 Failed 4/5 subtests