curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

runtests.pl: runhttp2server() fails to return error

From: Christian Weisgerber via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 20 Aug 2020 00:15:17 +0200

Hi,
the switch to using dynamic port numbers for all tests has introduced
a bug.

In curl 7.72.0, specifically after this commit...
https://github.com/curl/curl/commit/c8ec04065aa5a69a3eeae61dd921662ae821aacb
... runtests.pl no longer handles it if the HTTP2 server fails to start.

The problem is in runhttp2server(). After ten attempts of

        ($http2pid, $pid2) = startnew($cmd, $pidfile, 15, 0);
        if($http2pid <= 0 || !pidexists($http2pid)) {

have been exhausted, it falls through to

    return ($http2pid, $pid2, $port);

and returns the $http2pid even if that PID doesn't exist. This is
interpreted as success by the caller, and subsequent tests that try
to use the HTTP2 server will report failure.

This scenario arises if curl is build against libnghttp2, but the
nghttpx executable is not available.

$ ./runtests.pl -v 1700
Prototype mismatch: sub main::decode_base64 ($) vs none at getpart.pm line 36.
CMD (0): ../src/curl --version 1>log/curlverout.log 2>log/curlvererr.log
********* System characteristics ********
* curl 7.72.0 (x86_64-unknown-openbsd6.7)
* libcurl/7.72.0 LibreSSL/3.2.1 zlib/1.2.3 nghttp2/1.41.0
* Features: AsynchDNS HTTP2 HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL UnixSockets
* Disabled:
* Host: ariolc.mips.inka.de
* System: OpenBSD ariolc.mips.inka.de 6.7 GENERIC.MP#1 amd64
* OS: openbsd
* Servers: HTTP-IPv6 HTTP-unix FTP-IPv6
* Env:
* Seed: 259231
* Unix socket paths:
* HTTP-Unix:http66638.sock
*****************************************
startnew: perl -I. ./httpserver.pl --pidfile ".http_server.pid" --logfile "log/http_server.log" --portfile .http_server.port --ipv4 --port 0 --srcdir "."
RUN: ../src/curl --max-time 13 --output log/http_verify.out --silent --verbose --globoff "http://127.0.0.1:14258/verifiedserver" 2>log/http_verify.log
CMD (0): ../src/curl --max-time 13 --output log/http_verify.out --silent --verbose --globoff "http://127.0.0.1:14258/verifiedserver" 2>log/http_verify.log
RUN: HTTP server is on PID 37572 port 14258
* pid http => 37572 39605
startnew: perl -I. ./http2-server.pl --port 23224 --pidfile ".http_v2_server.pid" --logfile "log/http_v2_server.log" --connect 127.0.0.1:14258
startnew: child process has died, server might start up
RUN: failed to start the HTTP/2 server
startnew: perl -I. ./http2-server.pl --port 23620 --pidfile ".http_v2_server.pid" --logfile "log/http_v2_server.log" --connect 127.0.0.1:14258
startnew: child process has died, server might start up
RUN: failed to start the HTTP/2 server
startnew: perl -I. ./http2-server.pl --port 23690 --pidfile ".http_v2_server.pid" --logfile "log/http_v2_server.log" --connect 127.0.0.1:14258
startnew: child process has died, server might start up
RUN: failed to start the HTTP/2 server
startnew: perl -I. ./http2-server.pl --port 23954 --pidfile ".http_v2_server.pid" --logfile "log/http_v2_server.log" --connect 127.0.0.1:14258
startnew: child process has died, server might start up
RUN: failed to start the HTTP/2 server
startnew: perl -I. ./http2-server.pl --port 24849 --pidfile ".http_v2_server.pid" --logfile "log/http_v2_server.log" --connect 127.0.0.1:14258
startnew: child process has died, server might start up
RUN: failed to start the HTTP/2 server
startnew: perl -I. ./http2-server.pl --port 25115 --pidfile ".http_v2_server.pid" --logfile "log/http_v2_server.log" --connect 127.0.0.1:14258
startnew: child process has died, server might start up
RUN: failed to start the HTTP/2 server
startnew: perl -I. ./http2-server.pl --port 25589 --pidfile ".http_v2_server.pid" --logfile "log/http_v2_server.log" --connect 127.0.0.1:14258
startnew: child process has died, server might start up
RUN: failed to start the HTTP/2 server
startnew: perl -I. ./http2-server.pl --port 26432 --pidfile ".http_v2_server.pid" --logfile "log/http_v2_server.log" --connect 127.0.0.1:14258
startnew: child process has died, server might start up
RUN: failed to start the HTTP/2 server
startnew: perl -I. ./http2-server.pl --port 27303 --pidfile ".http_v2_server.pid" --logfile "log/http_v2_server.log" --connect 127.0.0.1:14258
startnew: child process has died, server might start up
RUN: failed to start the HTTP/2 server
startnew: perl -I. ./http2-server.pl --port 27734 --pidfile ".http_v2_server.pid" --logfile "log/http_v2_server.log" --connect 127.0.0.1:14258
startnew: child process has died, server might start up
RUN: failed to start the HTTP/2 server
* pid http/2 => 43856 0
test 1700...[HTTP/2 GET with Upgrade:]
../src/curl --include --trace-ascii log/trace1700 --trace-time http://127.0.0.1:27734/1700 --http2 http://127.0.0.1:27734/17000001 >log/stdout1700 2>log/stderr1700
CMD (1792): ../src/curl --include --trace-ascii log/trace1700 --trace-time http://127.0.0.1:27734/1700 --http2 http://127.0.0.1:27734/17000001 >log/stdout1700 2>log/stderr1700

 1700: stdout FAILED:
Terminated
--- log/check-expected Thu Aug 20 00:05:33 2020
+++ log/check-generated Thu Aug 20 00:05:33 2020
@@ -1,24 +0,0 @@
-HTTP/1.1 101 Switching Protocols[CR][LF]
-Connection: Upgrade[CR][LF]
-Upgrade: h2c[CR][LF]
-[CR][LF]
-HTTP/2 200 [CR][LF]
-date: Thu, 09 Nov 2010 14:49:00 GMT[CR][LF]
-last-modified: Tue, 13 Jun 2000 12:10:00 GMT[CR][LF]
-etag: "21025-dc7-39462498"[CR][LF]
-accept-ranges: bytes[CR][LF]
-content-length: 6[CR][LF]
-content-type: text/html[CR][LF]
-funny-head: yesyes[CR][LF]
-server: cut-out[CR][LF]
-via: 1.1 nghttpx[CR][LF]
-[CR][LF]
--foo-[LF]
-HTTP/2 200 [CR][LF]
-date: Thu, 09 Nov 2010 14:49:00 GMT[CR][LF]
-content-length: 6[CR][LF]
-content-type: text/html[CR][LF]
-server: cut-out[CR][LF]
-via: 1.1 nghttpx[CR][LF]
-[CR][LF]
--maa-[LF]

 - abort tests
* kill pid for http => 37572
* kill pid for http => 39605
* kill pid for http/2 => 43856
* kill pid for http/2 => 0
RUN: Process with pid 37572 signalled to die
RUN: Process with pid 39605 signalled to die
RUN: Process with pid 43856 already dead
RUN: Process with pid 39605 gracefully died
RUN: Process with pid 37572 forced to die with SIGKILL
TESTDONE: 0 tests out of 1 reported OK: 0%
TESTFAIL: These test cases failed: 1700
TESTDONE: 1 tests were considered during 52 seconds.

-- 
Christian "naddy" Weisgerber                          naddy_at_mips.inka.de
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2020-08-20