|
|
|
# Copyright (C) The c-ares project and its contributors
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
env:
|
|
|
|
CIRRUS_CLONE_DEPTH: 1
|
|
|
|
CMAKE_FLAGS: "-DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -G Ninja"
|
|
|
|
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON"
|
|
|
|
|
|
|
|
task:
|
|
|
|
matrix:
|
|
|
|
- name: "Debian arm64"
|
|
|
|
env:
|
|
|
|
DIST: "DEBIAN-ARM"
|
|
|
|
LC_ALL: "C"
|
|
|
|
SCAN_BUILD: "scan-build"
|
|
|
|
MAKE: "make"
|
|
|
|
# For whatever reason, ASAN and UBSAN are likely to result in compiler
|
|
|
|
# termination on debian arm64. I can't tell if this is really a crash
|
|
|
|
# or something like the OOM killer:
|
|
|
|
# /usr/bin/c++ -DHAVE_CONFIG_H=1 -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -I/tmp/cirrus-ci-build/cmakebld/test -I/tmp/cirrus-ci-build/cmakebld -I/tmp/cirrus-ci-build/cmakebld/src/lib -I/tmp/cirrus-ci-build -I/tmp/cirrus-ci-build/src/lib -I/tmp/cirrus-ci-build/include -fsanitize=address -Wall -Wextra -Wcast-align -Wformat-security -Wmissing-declarations -Wmissing-format-attribute -Wpacked-bitfield-compat -Wredundant-decls -Wvla -Wno-unused-parameter -Wconversion -Wfloat-equal -Wsign-conversion -fdiagnostics-color=always -g -fno-omit-frame-pointer -O0 -DGTEST_HAS_PTHREAD=1 -std=c++14 -MD -MT test/CMakeFiles/arestest.dir/ares-test-parse-a.cc.o -MF test/CMakeFiles/arestest.dir/ares-test-parse-a.cc.o.d -o test/CMakeFiles/arestest.dir/ares-test-parse-a.cc.o -c /tmp/cirrus-ci-build/test/ares-test-parse-a.cc
|
|
|
|
# c++: fatal error: Killed signal terminated program cc1plus
|
|
|
|
# Skip for now on arm.
|
|
|
|
BUILD_ASAN: "no"
|
|
|
|
BUILD_UBSAN: "no"
|
|
|
|
BUILD_ANALYZE: "yes"
|
|
|
|
TEST_DEBUGGER: "gdb"
|
|
|
|
arm_container:
|
|
|
|
image: debian:latest
|
|
|
|
- name: "FreeBSD amd64"
|
|
|
|
env:
|
|
|
|
DIST: "FREEBSD"
|
|
|
|
SCAN_BUILD: "scan-build"
|
|
|
|
TEST_DEBUGGER: "lldb"
|
|
|
|
MAKE: "gmake"
|
|
|
|
BUILD_ANALYZE: "yes"
|
|
|
|
TEST_SYMBOL_VISIBILITY: "yes"
|
|
|
|
freebsd_instance:
|
|
|
|
image_family: freebsd-14-1
|
|
|
|
matrix:
|
|
|
|
- name: "CMAKE"
|
|
|
|
env:
|
|
|
|
BUILD_TYPE: "cmake"
|
|
|
|
- name: "AUTOTOOLS"
|
|
|
|
env:
|
|
|
|
BUILD_TYPE: "autotools"
|
|
|
|
- name: "ASAN"
|
|
|
|
# ASAN on Linux automatically includes Leak Sanitizer
|
|
|
|
# FreeBSD just hangs trying to run tests, think it may be trying to run leak sanitizer
|
|
|
|
only_if: $BUILD_ASAN == 'yes'
|
|
|
|
env:
|
|
|
|
BUILD_TYPE: "asan"
|
|
|
|
CC: "clang"
|
|
|
|
TEST_DEBUGGER: "none"
|
|
|
|
CONFIG_OPTS: "--enable-debug"
|
|
|
|
CFLAGS: "-fsanitize=address"
|
|
|
|
CXXFLAGS: "-fsanitize=address"
|
|
|
|
LDFLAGS: "-fsanitize=address"
|
|
|
|
- name: "UBSAN"
|
|
|
|
# FreeBSD just hangs trying to run tests, think it may be trying to run leak sanitizer
|
|
|
|
only_if: $BUILD_UBSAN == 'yes'
|
|
|
|
env:
|
|
|
|
BUILD_TYPE: "ubsan"
|
|
|
|
CC: "clang"
|
|
|
|
TEST_DEBUGGER: "none"
|
|
|
|
CONFIG_OPTS: "--enable-debug"
|
|
|
|
CFLAGS: "-fsanitize=undefined -fno-sanitize-recover"
|
|
|
|
CXXFLAGS: "-fsanitize=undefined -fno-sanitize-recover"
|
|
|
|
LDFLAGS: "-fsanitize=undefined"
|
|
|
|
- name: "ANALYZE"
|
|
|
|
only_if: $BUILD_ANALYZE == 'yes'
|
|
|
|
env:
|
|
|
|
BUILD_TYPE: "analyze"
|
|
|
|
CC: "clang"
|
|
|
|
TEST_DEBUGGER: "lldb"
|
|
|
|
SCAN_WRAP: "${SCAN_BUILD} -v --status-bugs"
|
|
|
|
CONFIG_OPTS: "--enable-debug --disable-tests"
|
|
|
|
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=OFF"
|
|
|
|
- name: "VALGRIND"
|
|
|
|
# FreeBSD just hangs trying to run tests, think it may be trying to run leak sanitizer
|
|
|
|
only_if: $BUILD_VALGRIND == 'yes'
|
|
|
|
env:
|
|
|
|
BUILD_TYPE: "valgrind"
|
|
|
|
TEST_WRAP: "valgrind --leak-check=full"
|
|
|
|
TEST_FILTER: "-4 --gtest_filter=-*Container*:-*LiveSearchANY*"
|
|
|
|
|
|
|
|
install_script:
|
|
|
|
- |
|
|
|
|
case "${DIST}" in
|
|
|
|
UBUNTU|DEBIAN*)
|
|
|
|
export DEBIAN_FRONTEND=noninteractive && \
|
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y cmake ninja-build autoconf automake libtool g++ libgmock-dev pkg-config
|
|
|
|
case "${BUILD_TYPE}" in
|
|
|
|
asan|lsan|ubsan)
|
|
|
|
apt-get install -yq clang lldb
|
|
|
|
;;
|
|
|
|
analyze)
|
|
|
|
apt-get install -yq clang clang-tools lldb
|
|
|
|
;;
|
|
|
|
valgrind)
|
|
|
|
apt-get install -yq valgrind
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
apt-get install -yq gdb
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
FREEBSD)
|
|
|
|
# pkg upgrade -y && \
|
|
|
|
pkg install -y bash cmake ninja googletest pkgconf llvm gmake
|
|
|
|
ln -sf /usr/local/bin/bash /bin/bash
|
Implement TCP FastOpen (TFO) RFC7413 (#840)
TCP Fast Open (TFO) allows TCP connection establishment in 0-RTT when a
client and server have previously communicated. The SYN packet will also
contain the initial data packet from the client to the server. This
means there should be virtually no slowdown over UDP when both sides
support TCP FastOpen, which is unfortunately not always the case. For
instance, `1.1.1.1` appears to support TFO, however `8.8.8.8` does not.
This implementation supports Linux, Android, FreeBSD, MacOS, and iOS.
While Windows does have support for TCP FastOpen it does so via
completion APIs only, and that can't be used with polling APIs like used
by every other OS. We could implement it in the future if desired for
those using `ARES_OPT_EVENT_THREAD`, but it would probably require
adopting IOCP completely on Windows.
Sysctls are required to be set appropriately:
- Linux: `net.ipv4.tcp_fastopen`:
- `1` = client only (typically default)
- `2` = server only
- `3` = client and server
- MacOS: `net.inet.tcp.fastopen`
- `1` = client only
- `2` = server only
- `3` = client and server (typically default)
- FreeBSD: `net.inet.tcp.fastopen.server_enable` (boolean) and
`net.inet.tcp.fastopen.client_enable` (boolean)
This feature is always-on, when running on an OS with the capability
enabled. Though some middleboxes have impacted end-to-end TFO and caused
connectivity errors, all modern OSs perform automatic blackholing of IPs
that have issues with TFO. It is not expected this to cause any issues
in the modern day implementations.
This will also help with improving latency for future DoT and DoH
implementations.
Authored-By: Brad House (@bradh352)
4 months ago
|
|
|
# Enable TCP FastOpen
|
|
|
|
sysctl net.inet.tcp.fastopen.server_enable=1
|
|
|
|
sysctl net.inet.tcp.fastopen.client_enable=1
|
|
|
|
case "${BUILD_TYPE}" in
|
|
|
|
autotools)
|
|
|
|
pkg install -y autoconf automake libtool
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
script:
|
|
|
|
- ./ci/build.sh
|
|
|
|
- ./ci/test.sh
|
|
|
|
- if [ "$BUILD_TYPE" = "autotools" -a "$DIST" = "DEBIAN" ]; then ./ci/distcheck.sh ; fi
|
|
|
|
|