From d451f403bdbee1149ff83cd086773cbf60cbcbc5 Mon Sep 17 00:00:00 2001 From: sirknightj Date: Tue, 4 Feb 2025 23:06:50 -0800 Subject: [PATCH] Add debug for curl initialization and DRY for linux-sanitizers --- .github/workflows/linux-sanitizers.yml | 71 ++++++++++++++++++++++++++ src/source/CurlApiCallbacks.c | 2 + 2 files changed, 73 insertions(+) create mode 100644 .github/workflows/linux-sanitizers.yml 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 c045e0e1e..51c9d6b06 100644 --- a/src/source/CurlApiCallbacks.c +++ b/src/source/CurlApiCallbacks.c @@ -148,7 +148,9 @@ STATUS createCurlApiCallbacks(PCallbacksProvider pCallbacksProvider, PCHAR regio CHK_STATUS(initializeSslCallbacks()); // CURL global initialization + 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);