diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f3af92c0..7fc64aa25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: env: CC: gcc-14 CXX: g++-14 - AWS_KVS_LOG_LEVEL: 2 + AWS_KVS_LOG_LEVEL: 7 steps: - name: Clone repository uses: actions/checkout@v3 @@ -57,7 +57,7 @@ jobs: mac-os-build-clang: runs-on: macos-13 env: - AWS_KVS_LOG_LEVEL: 2 + AWS_KVS_LOG_LEVEL: 7 permissions: id-token: write contents: read @@ -86,7 +86,7 @@ jobs: mac-os-m1-build-clang: runs-on: macos-latest env: - AWS_KVS_LOG_LEVEL: 2 + AWS_KVS_LOG_LEVEL: 7 permissions: id-token: write contents: read @@ -117,7 +117,7 @@ jobs: env: CC: gcc-13 CXX: g++-13 - AWS_KVS_LOG_LEVEL: 2 + AWS_KVS_LOG_LEVEL: 7 permissions: id-token: write contents: read @@ -151,7 +151,7 @@ jobs: env: CC: gcc-14 CXX: g++-14 - AWS_KVS_LOG_LEVEL: 2 + AWS_KVS_LOG_LEVEL: 7 LDFLAGS: -L/usr/local/opt/openssl@3/lib CPPFLAGS: -I/usr/local/opt/openssl@3/include OPENSSL_ROOT_DIR: /usr/local/opt/openssl@3/ @@ -179,7 +179,7 @@ jobs: mac-os-build-clang-local-openssl: runs-on: macos-13 env: - AWS_KVS_LOG_LEVEL: 2 + AWS_KVS_LOG_LEVEL: 7 LDFLAGS: -L/usr/local/opt/openssl@3/lib CPPFLAGS: -I/usr/local/opt/openssl@3/include OPENSSL_ROOT_DIR: /usr/local/opt/openssl@3/ @@ -209,19 +209,26 @@ jobs: linux-gcc-code-coverage: runs-on: ubuntu-latest + container: + image: public.ecr.aws/ubuntu/ubuntu:20.04_stable env: - AWS_KVS_LOG_LEVEL: 2 + AWS_KVS_LOG_LEVEL: 7 + DEBIAN_FRONTEND: noninteractive permissions: id-token: write contents: read steps: - name: Clone repository uses: actions/checkout@v3 + - name: Install dependenices + run: | + apt-get update + apt-get install -y git build-essential automake pkg-config cmake gcovr ggcov lcov - name: Build repository run: | mkdir build && cd build cmake .. -DCODE_COVERAGE=TRUE -DBUILD_TEST=TRUE -DBUILD_COMMON_LWS=TRUE - make + make -j$(nproc) - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 with: @@ -232,150 +239,37 @@ jobs: - name: Run tests run: | cd build - ulimit -c unlimited -S - timeout --signal=SIGABRT 150m ./tst/producer_test --gtest_break_on_failure + timeout --signal=SIGABRT 150m ./tst/producer_test - name: Code coverage run: | cd build for test_file in $(find cproducer.dir kvsCommonCurl.dir kvsCommonLws.dir -name '*.gcno'); do gcov $test_file; done bash <(curl -s https://codecov.io/bash) - address-sanitizer: - runs-on: ubuntu-latest - permissions: - id-token: write - contents: read - env: - CC: clang - CXX: clang++ - AWS_KVS_LOG_LEVEL: 2 - steps: - - name: Clone repository - uses: actions/checkout@v3 - - name: Build repository - run: | - mkdir build && cd build - cmake .. -DBUILD_TEST=TRUE -DADDRESS_SANITIZER=TRUE -DBUILD_COMMON_LWS=TRUE - make - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} - aws-region: ${{ secrets.AWS_REGION }} - role-duration-seconds: 10800 - - name: Run tests - run: | - cd build - ulimit -c unlimited -S - timeout --signal=SIGABRT 150m ./tst/producer_test --gtest_break_on_failure - - undefined-behavior-sanitizer: - runs-on: ubuntu-latest - permissions: - id-token: write - contents: read - env: - CC: clang - CXX: clang++ - AWS_KVS_LOG_LEVEL: 2 - steps: - - name: Clone repository - uses: actions/checkout@v3 - - name: Build repository - run: | - mkdir build && cd build - cmake .. -DBUILD_TEST=TRUE -DUNDEFINED_BEHAVIOR_SANITIZER=TRUE -DBUILD_COMMON_LWS=TRUE - make - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} - aws-region: ${{ secrets.AWS_REGION }} - role-duration-seconds: 10800 - - name: Run tests - run: | - cd build - ulimit -c unlimited -S - timeout --signal=SIGABRT 150m ./tst/producer_test --gtest_break_on_failure - - # memory-sanitizer: - # runs-on: ubuntu-20.04 - # permissions: - # id-token: write - # contents: read - # env: - # CC: clang - # CXX: clang++ - # AWS_KVS_LOG_LEVEL: 2 - # steps: - # - name: Clone repository - # uses: actions/checkout@v3 - # - name: Configure AWS Credentials - # uses: aws-actions/configure-aws-credentials@v4 - # with: - # role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - # role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} - # aws-region: ${{ secrets.AWS_REGION }} - # - name: Build repository - # run: | - # mkdir build && cd build - # cmake .. -DBUILD_TEST=TRUE -DMEMORY_SANITIZER=TRUE -DBUILD_COMMON_LWS=TRUE - # make - # ulimit -c unlimited -S - # timeout --signal=SIGABRT 150m ./tst/producer_test --gtest_break_on_failure - - # thread-sanitizer: - # runs-on: ubuntu-20.04 - # permissions: - # id-token: write - # contents: read - # env: - # CC: clang - # CXX: clang++ - # AWS_KVS_LOG_LEVEL: 2 - # steps: - # - name: Clone repository - # uses: actions/checkout@v3 - # - name: Configure AWS Credentials - # uses: aws-actions/configure-aws-credentials@v4 - # with: - # role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - # role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} - # aws-region: ${{ secrets.AWS_REGION }} - # - name: Build repository - # run: | - # mkdir build && cd build - # cmake .. -DBUILD_TEST=TRUE -DTHREAD_SANITIZER=TRUE -DBUILD_COMMON_LWS=TRUE - # make - # - name: Run tests - # run: | - # cd build - # ulimit -c unlimited -S - # timeout --signal=SIGABRT 150m ./tst/producer_test --gtest_break_on_failure - ubuntu-gcc: runs-on: ubuntu-latest + container: + image: public.ecr.aws/ubuntu/ubuntu:20.04_stable env: - AWS_KVS_LOG_LEVEL: 2 + AWS_KVS_LOG_LEVEL: 7 CC: gcc CXX: g++ + DEBIAN_FRONTEND: noninteractive permissions: id-token: write contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install dependencies run: | - sudo apt clean && sudo apt update - sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6' + apt-get update + apt-get install -y git build-essential automake pkg-config cmake - name: Build repository run: | mkdir build && cd build - cmake .. -DBUILD_TEST=TRUE - make + cmake .. -DBUILD_TEST=ON + make -j$(nproc) - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 with: @@ -386,13 +280,12 @@ jobs: - name: Run tests run: | cd build - ulimit -c unlimited -S - timeout --signal=SIGABRT 150m ./tst/producer_test --gtest_break_on_failure + timeout --signal=SIGABRT 150m ./tst/producer_test windows-msvc: runs-on: windows-2022 env: - AWS_KVS_LOG_LEVEL: 2 + AWS_KVS_LOG_LEVEL: 7 permissions: id-token: write contents: read @@ -479,23 +372,41 @@ jobs: linux-build-gcc-static: runs-on: ubuntu-latest + container: + image: public.ecr.aws/ubuntu/ubuntu:20.04_stable + env: + DEBIAN_FRONTEND: noninteractive + AWS_KVS_LOG_LEVEL: 7 steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 + - name: Install dependencies + run: | + apt-get update + apt-get install -y git cmake build-essential automake pkg-config - name: Build Repository run: | mkdir build && cd build cmake .. -DBUILD_STATIC=ON - make + make -j$(nproc) linux-thread-size-check: runs-on: ubuntu-latest + container: + image: public.ecr.aws/ubuntu/ubuntu:20.04_stable + env: + DEBIAN_FRONTEND: noninteractive + AWS_KVS_LOG_LEVEL: 7 permissions: id-token: write contents: read steps: - name: Clone repository uses: actions/checkout@v3 + - name: Install dependencies + run: | + apt-get update + apt-get install -y git cmake build-essential automake pkg-config - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 with: diff --git a/.github/workflows/linux-sanitizers.yml b/.github/workflows/linux-sanitizers.yml new file mode 100644 index 000000000..81afa64d8 --- /dev/null +++ b/.github/workflows/linux-sanitizers.yml @@ -0,0 +1,71 @@ +name: Linux sanitizers + +on: + push: + branches: + - develop + - master + pull_request: + branches: + - develop + - master + +jobs: + linux-sanitizers: + strategy: + matrix: + sanitizer: + - ADDRESS_SANITIZER + - UNDEFINED_BEHAVIOR_SANITIZER + # - THREAD_SANITIZER + # - MEMORY_SANITIZER + config: + - name: With Common LWS + cmake_flags: "-DBUILD_TEST=ON -DBUILD_COMMON_LWS=ON" + + fail-fast: false + + runs-on: ubuntu-latest + container: + image: public.ecr.aws/ubuntu/ubuntu:20.04_stable + + timeout-minutes: 80 + + env: + CC: clang + CXX: clang++ + AWS_KVS_LOG_LEVEL: 7 + DEBIAN_FRONTEND: noninteractive + + permissions: + id-token: write + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + apt-get update + apt-get -y install git build-essential automake pkg-config cmake clang + + - name: Build repository - ${{ matrix.config.name }} + run: | + mkdir -p build + cd build + cmake .. -D${{ matrix.sanitizer }}=ON ${{ matrix.config.cmake_flags }} + make -j$(nproc) + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} + aws-region: ${{ secrets.AWS_REGION }} + role-duration-seconds: 10800 + + - name: Run tests - ${{ matrix.config.name }} + working-directory: ./build + run: | + timeout --signal=SIGABRT 150m ./tst/producer_test diff --git a/src/source/CurlApiCallbacks.c b/src/source/CurlApiCallbacks.c index 9c3373f32..51c9d6b06 100644 --- a/src/source/CurlApiCallbacks.c +++ b/src/source/CurlApiCallbacks.c @@ -151,7 +151,7 @@ STATUS createCurlApiCallbacks(PCallbacksProvider pCallbacksProvider, PCHAR regio DLOGD("Initializing curl"); CHK(0 == curl_global_init(CURL_GLOBAL_ALL), STATUS_CURL_LIBRARY_INIT_FAILED); DLOGD("Successfully initialized curl"); - + // Not in shutdown ATOMIC_STORE_BOOL(&pCurlApiCallbacks->shutdown, FALSE);