Skip to content

Commit

Permalink
Add debug for curl initialization and DRY for linux-sanitizers
Browse files Browse the repository at this point in the history
  • Loading branch information
sirknightj committed Feb 5, 2025
1 parent eb9032c commit fc69275
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 55 deletions.
55 changes: 0 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,61 +300,6 @@ jobs:
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-22.04
env:
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/linux-sanitizers.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions src/source/CurlApiCallbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fc69275

Please sign in to comment.