]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1872732, r1872777, r1874128, r1874190, r1874256, r1874542, r1874716, r1874720...
authorJoe Orton <jorton@apache.org>
Fri, 20 Mar 2020 10:58:53 +0000 (10:58 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 20 Mar 2020 10:58:53 +0000 (10:58 +0000)
Non-x86 testing seems reasonably reliable; note some known failures
currently.

Add Travis job with --enable-mods-static=reallyall.

Back off a little when svn export is timing out.

Add Travis job which runs under UBSan ("Undefined Behaviour Sanitizer").
mod_http2 disabled for now until https://github.com/icing/mod_h2/pull/194
is merged.

Add gcc 9 job, enable enhanced malloc debugging for pool-debug job.

Add an i386 build using a multilib packages and "gcc -m32".
(All other Travis builds are 64-bit arches currently)

Switch to using httpd-tests git repo.

Fix travis config validation warnings.

Update docs. The expr_string.t failure has not been seen since
the workaround was added AFAICT.  The async filter bug
is still breaking the tests regularly. [skip ci].

Add simple test for apxs to catch regression in r1872042.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1875466 13f79535-47bb-0310-9956-ffa450edef68

.travis.yml
test/README.travis
test/travis_before_linux.sh
test/travis_run_linux.sh

index ebb29ca25aba0f33d87230bf2899659665836e85..4b9ce8f51a479a0da60122cb7306fc08bd6773a7 100644 (file)
@@ -1,8 +1,7 @@
 language: c
 os:
   - linux
-dist:
-  - bionic
+dist: bionic
 cache:
   directories:
     - /home/travis/perl5
@@ -31,7 +30,7 @@ env:
   global:
     - MFLAGS=-j2
 
-matrix:
+jobs:
   include:
     - name: Linux Ubuntu, Default module set
     # -------------------------------------------------------------------------
@@ -48,8 +47,37 @@ matrix:
       env: CONFIG="--enable-mods-shared=reallyall"
            TEST_ARGS="-v"
     # -------------------------------------------------------------------------
-    - name: Linux Ubuntu, Default, all-modules
+    - name: Linux i386 Ubuntu, Shared MPMs, most modules, maintainer-mode w/-Werror
+      env: CONFIG="--enable-mods-shared=reallyall --disable-xml2enc --disable-proxy-html --enable-mpms-shared=all --enable-maintainer-mode"
+           PKG_CONFIG_PATH="/usr/lib/i386-linux-gnu/pkgconfig"
+           NOTEST_CFLAGS="-Werror"
+           CC="gcc -m32"
+           APR_VERSION=1.7.0
+           APU_VERSION=1.6.1 APU_CONFIG="--with-crypto"
+      addons:
+        apt:
+          sources:
+            - sourceline: 'deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe'
+          packages:
+            - cpanminus
+            - libc6-dev-i386
+            - gcc-multilib
+            - libexpat1-dev:i386
+            - libssl-dev:i386
+            - lib32z1-dev
+            - libbrotli-dev:i386
+            - libpcre2-dev:i386
+            - libtool-bin
+            - perl-doc
+            - libapr1-dev
+            - libbrotli-dev:i386
+    # -------------------------------------------------------------------------
+    - name: Linux Ubuntu, Default, all-modules + install
       env: CONFIG="--enable-mods-shared=reallyall"
+           TEST_INSTALL=1
+    # -------------------------------------------------------------------------
+    - name: Linux Ubuntu, Default, all-static modules
+      env: CONFIG="--enable-mods-static=reallyall"
     # -------------------------------------------------------------------------
     - name: Linux Ubuntu, Default, all-modules, random test order
       env: CONFIG="--enable-mods-shared=reallyall"
@@ -79,8 +107,6 @@ matrix:
            SKIP_TESTING=1
       addons:
         apt:
-          sources:
-            - ubuntu-toolchain-r-test
           packages:
             - gcc-8
             - libtool-bin
@@ -95,6 +121,27 @@ matrix:
             - libjansson-dev
             - libpcre2-dev
     # -------------------------------------------------------------------------
+    - name: Linux Ubuntu, GCC 9 maintainer-mode w/-Werror
+      env: CONFIG="--enable-mods-shared=reallyall --enable-maintainer-mode NOTEST_CFLAGS=-Werror CC=gcc-9"
+           SKIP_TESTING=1
+      addons:
+        apt:
+          sources:
+            - sourceline: 'ppa:ubuntu-toolchain-r/test'
+          packages:
+            - gcc-9
+            - libtool-bin
+            - libapr1-dev
+            - libaprutil1-dev
+            - perl-doc
+            - lua5.3-dev
+            - libbrotli-dev
+            - libcurl4-openssl-dev
+            - libsystemd-dev
+            - libnghttp2-dev
+            - libjansson-dev
+            - libpcre2-dev
+    # -------------------------------------------------------------------------
     # MFLAGS= works around https://bz.apache.org/bugzilla/show_bug.cgi?id=63942
     - if: branch != 2.4.x
       name: Linux Ubuntu, Regenerate ap_expr
@@ -133,9 +180,9 @@ matrix:
     # -------------------------------------------------------------------------
     - name: Linux Ubuntu, APR 1.7.0 --enable-pool-debug, APR-util 1.6.1
       env: APR_VERSION=1.7.0 APR_CONFIG="--enable-pool-debug"
-           APU_VERSION=1.6.1
-           APU_CONFIG="--with-crypto"
+           APU_VERSION=1.6.1 APU_CONFIG="--with-crypto"
            CONFIG="--enable-mods-shared=reallyall"
+           TEST_MALLOC=1
     # -------------------------------------------------------------------------
     - name: Linux Ubuntu, litmus WebDAV tests
       env: CONFIG="--enable-dav --enable-dav-fs"
@@ -170,11 +217,18 @@ matrix:
       env: APR_VERSION=1.4.8 APU_VERSION=1.4.2
            CONFIG="--enable-mods-shared=reallyall"
     # -------------------------------------------------------------------------
+    - if: branch != 2.4.x
+      name: Linux Ubuntu, UBSan
+      env: NOTEST_CFLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined" NOTEST_LIBS=-lubsan
+           CONFIG="--enable-mods-shared=reallyall --disable-http2" TEST_UBSAN=1
 
+# CPAN modules are to be used with the system Perl and always with
+# CC=gcc, e.g. for the CC="gcc -m32" case the builds are not correct
+# otherwise.
 before_install:
   - if [ "$TRAVIS_OS_NAME" = "linux" ]; then
         cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib);
-        cpanm --notest Net::SSL LWP::Protocol::https ExtUtils::Embed Test::More AnyEvent DateTime HTTP::DAV Protocol::HTTP2::Client FCGI;
+        CC=gcc cpanm --notest Net::SSL LWP::Protocol::https ExtUtils::Embed Test::More AnyEvent DateTime HTTP::DAV Protocol::HTTP2::Client FCGI Apache::Test;
     fi
 
 before_script:
index 0954c3576e63f66bc9b8f59bc33054a94dd80397..1af91a2afc6e3c4f2547c03226246ba5dcb134b6 100644 (file)
@@ -28,6 +28,10 @@ The Travis scripts use the following environment variables:
 * SKIP_TESTING - if set, the Perl test framework is not run for the
   build.
 
+* TEST_UBSAN - set for builds using UBSan ("Undefined Behaviour Sanitizer")
+
+* TEST_MALLOC - set for builds using enhanced malloc debugging.
+
 Caching
 -------
 
@@ -43,16 +47,14 @@ TODO list
 * MacOS build
 * Windows build
 * clang-on-Linux build
-* Multi-arch testing
- - non-x86_64 images lack installed cpanminus and don't enable caching.
-   ppc64le builds seem unreasonably slow to install CPAN deps each time
-   (15-20 minutes) - not sure why.  s390x is enabled & seems reasonably fast.
- - Testing support for arm64.
 * Use containers for non-Ubuntu-based Linux testing
-* E-mail notifications
 * VPATH builds
 * sanity checks for use of APLOGNO() - empty arguments, accidental duplicates, etc.
  - not sure how exactly
+* Known test failures
+ - "apt-get install" timeout/fails - workaround by moving apt install to before_script phase?
+ - t/apache/rwrite.t, t/apache/pass_brigade.t
+   see msg <CAKQ1sVMbDcUouu+_bfp8T5HO5+=ORWhLx361+b4qyLux5xyhwA@mail.gmail.com> etc
 
 Testing from a Feature Branch
 -----------------------------
index 0a8e056d46c9bd1ac939f818d335efab351e7bb7..3d9550169da0cb3651e6a00d7c27ced6f233a2d6 100755 (executable)
@@ -25,7 +25,7 @@ function run_svn_export() {
            if [ $i -eq $max_tries ]; then
                exit 1
            else
-               sleep 180
+               sleep $((100 * i))
            fi
        fi
    done
@@ -72,23 +72,10 @@ function install_apx() {
 
 
 if ! test -v SKIP_TESTING; then
-    # The test/framework checkout is cached at ~/root/framework, which
-    # is copied to test/framework within the httpd build directory.
-    # Renew the cache here if the last-changed revision is stale.
-    framework=https://svn.apache.org/repos/asf/httpd/test/framework/trunk
-    fcache=$HOME/root/framework
-    frev=`svn info --no-newline --show-item last-changed-revision ${framework}`
-    if [ -d ${fcache} -a ! -f ${fcache}/.revision-is-${frev} ]; then
-        : Purging stale cache at ${fcache}
-        rm -rf ${fcache}
-    fi
-
-    if [ ! -d ${fcache} ]; then
-        run_svn_export ${framework} ${frev} ${fcache} 5
-        touch ${fcache}/.revision-is-${frev}
-    fi
-
-    cp -a ${fcache} test/perl-framework
+    ### Temporary: purge old svn checkout from the cache
+    rm -rf $HOME/root/framework
+    # Make a shallow clone of httpd-tests git repo.
+    git clone --depth=1 https://github.com/apache/httpd-tests.git test/perl-framework
 fi
 
 if test -v APR_VERSION; then
index 90ac2c81389944d3dd4582cc3920443d38f6c308..f8fd6c5c4ecaacd34c869159cd1a7ea98bb1841a 100755 (executable)
@@ -2,6 +2,9 @@
 ### Installed apr/apr-util don't include the *.m4 files but the
 ### Debian packages helpfully install them, so use the system APR to buildconf
 ./buildconf --with-apr=/usr/bin/apr-1-config ${BUILDCONFIG}
+
+PREFIX=${PREFIX:-$HOME/build/httpd-root}
+
 # For trunk, "make check" is sufficient to run the test suite.
 # For 2.4.x, the test suite must be run manually
 if test ! -v SKIP_TESTING; then
@@ -9,8 +12,6 @@ if test ! -v SKIP_TESTING; then
     if grep -q ^check: Makefile.in; then
         CONFIG="--with-test-suite=test/perl-framework $CONFIG"
         WITH_TEST_SUITE=1
-    else
-        CONFIG="--prefix=$HOME/build/httpd-root $CONFIG"
     fi
 fi
 if test -v APR_VERSION; then
@@ -23,16 +24,42 @@ if test -v APU_VERSION; then
 else
     CONFIG="$CONFIG --with-apr-util=/usr"
 fi
-./configure $CONFIG
+
+./configure --prefix=$PREFIX $CONFIG
 make $MFLAGS
+
+if test -v TEST_INSTALL; then
+   make install
+   pushd $PREFIX
+     test `./bin/apxs -q PREFIX` = $PREFIX
+     test `$PWD/bin/apxs -q PREFIX` = $PREFIX
+     ./bin/apxs -g -n foobar
+     cd foobar; make
+   popd
+fi
+
 if ! test -v SKIP_TESTING; then
+    set +e
+
+    if test -v TEST_MALLOC; then
+        # Enable enhanced glibc malloc debugging, see mallopt(3)
+        export MALLOC_PERTURB_=65 MALLOC_CHECK_=3
+        export LIBC_FATAL_STDERR_=1
+    fi
+
+    if test -v TEST_UBSAN; then
+        export UBSAN_OPTIONS="log_path=$PWD/ubsan.log"
+    fi
+
     if test -v WITH_TEST_SUITE; then
         make check TESTS="${TEST_ARGS}"
+        RV=$?
     else
-        make install
+        test -v TEST_INSTALL || make install
         pushd test/perl-framework
-            perl Makefile.PL -apxs $HOME/build/httpd-root/bin/apxs
+            perl Makefile.PL -apxs $PREFIX/bin/apxs
             make test APACHE_TEST_EXTRA_ARGS="${TEST_ARGS}"
+            RV=$?
         popd
     fi
     if test -v LITMUS; then
@@ -40,7 +67,28 @@ if ! test -v SKIP_TESTING; then
            mkdir -p t/htdocs/modules/dav
            ./t/TEST -start
            litmus http://localhost:8529/modules/dav/
+           RV=$?
            ./t/TEST -stop
         popd
     fi
+
+    if grep -q 'Segmentation fault' test/perl-framework/t/logs/error_log; then
+        grep -C5 'Segmentation fault' test/perl-framework/t/logs/error_log
+        RV=2
+    fi
+
+    if test -v TEST_UBSAN && ls ubsan.log.* &> /dev/null; then
+        cat ubsan.log.*
+        RV=3
+    fi
+
+    # With LIBC_FATAL_STDERR_/MALLOC_CHECK_ glibc will abort when
+    # malloc errors are detected.  This should get caught by the
+    # segfault grep above, but in case it is not, catch it here too:
+    if grep 'glibc detected' test/perl-framework/t/logs/error_log; then
+        grep -C20 'glibc detected' test/perl-framework/t/logs/error_log
+        RV=4
+    fi
+
+    exit $RV
 fi