cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: bugs: runtests.pl can fail to detect that its test port is in use

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Thu, 19 Feb 2004 22:58:01 +0100 (CET)

On Thu, 19 Feb 2004, spage wrote:

Thanks for your feedback!

> I'm installing curl-7.11.0 on Solaris 5.6.
>
> When I run `make test`, it prints "System characteristics", then
> displays
> binding stream socket: Address already in use
> and hangs.
>
> It turns out port 8999 is indeed already in use on our Solaris machine, by
> some process that is NOT a plain HTTP server. But tests/runtests.pl has
> some bugs such that it does not detect this, and goes on to run tests
> against that port.

As you've found out by now, the test script needs adjusting in several
aspects. I'm aware of this. Unfortunately, I don't see these matters as very
high-prio so they tend to not get fixed. Feel free to fix and send in the
patches!

> So curl's 52 error code indicates there's something on the port. This
> is a different curl error code than when nothing's listening on the
> port, which I think is "curl: (7) Failed to connect to 127.0.0.1"
>
> bug 1: runtests.pl doesn't analyze this return code for curl errors
> like 52.

It doesn't have to. If the server is a fine server, the proper results are in
the output file. It it isn't, the correct output is missing. There really is
no need to check the return code.

> bug 2: In my case log/verifiedserver doesn't exist. But runtests.pl doesn't
> check for errors from open() , which sets $! to "No such file or directory"
> in my case.

And why is this a problem? I mean apart from it being a dubious programming
practise?

> bug 3: runtests.pl looks at the first line of output from the curl request,
> and only if it evaluates to "true" does it assume an Unknown HTTP server is
> running.

... no. It checks the first line, and if that evaluates true, we get the pid
of the test server. If it evaluates false, we consider the server to be
something else and we return -2 (line 343).

> So if the service on port 8999 returns something but its first line is 0,
> runtests.pl will think no server is running on the port. Unlikely, but
> could happen. I think it should check if anything's in @file.

It could indeed, but I don't see how that would change the general result.

> bug 4: It may not be an "HTTP server" running on 8999, it would be more
> correct to print the diagnostic "Unknown service already listening on port
> $HOSTPORT\n".

Certainly, but that's nothing I worry about much! ;-)

> Hope you find this useful. Let me know if there's a bug reporting form for
> curl I should be using instead.

There is, but I don't mind talking bugs here instead.

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
   [[ Do not send mails to this email address. They won't reach me. ]]
Received on 2004-02-19