Skip to content

Commit d9e45b8

Browse files
committed
Add debug for curl initialization and DRY for linux-sanitizers
1 parent 3eadab8 commit d9e45b8

File tree

3 files changed

+73
-115
lines changed

3 files changed

+73
-115
lines changed

.github/workflows/ci.yml

-115
Original file line numberDiff line numberDiff line change
@@ -227,121 +227,6 @@ jobs:
227227
for test_file in $(find cproducer.dir kvsCommonCurl.dir kvsCommonLws.dir -name '*.gcno'); do gcov $test_file; done
228228
bash <(curl -s https://codecov.io/bash)
229229
230-
address-sanitizer:
231-
runs-on: ubuntu-22.04
232-
permissions:
233-
id-token: write
234-
contents: read
235-
env:
236-
CC: clang
237-
CXX: clang++
238-
AWS_KVS_LOG_LEVEL: 2
239-
steps:
240-
- name: Clone repository
241-
uses: actions/checkout@v3
242-
- name: Build repository
243-
run: |
244-
mkdir build && cd build
245-
cmake .. -DBUILD_TEST=TRUE -DADDRESS_SANITIZER=TRUE -DBUILD_COMMON_LWS=TRUE
246-
make
247-
- name: Configure AWS Credentials
248-
uses: aws-actions/configure-aws-credentials@v4
249-
with:
250-
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
251-
role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
252-
aws-region: ${{ secrets.AWS_REGION }}
253-
role-duration-seconds: 10800
254-
- name: Run tests
255-
run: |
256-
cd build
257-
ulimit -c unlimited -S
258-
timeout --signal=SIGABRT 150m ./tst/producer_test --gtest_break_on_failure
259-
260-
undefined-behavior-sanitizer:
261-
runs-on: ubuntu-22.04
262-
permissions:
263-
id-token: write
264-
contents: read
265-
env:
266-
CC: clang
267-
CXX: clang++
268-
AWS_KVS_LOG_LEVEL: 2
269-
steps:
270-
- name: Clone repository
271-
uses: actions/checkout@v3
272-
- name: Build repository
273-
run: |
274-
mkdir build && cd build
275-
cmake .. -DBUILD_TEST=TRUE -DUNDEFINED_BEHAVIOR_SANITIZER=TRUE -DBUILD_COMMON_LWS=TRUE
276-
make
277-
- name: Configure AWS Credentials
278-
uses: aws-actions/configure-aws-credentials@v4
279-
with:
280-
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
281-
role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
282-
aws-region: ${{ secrets.AWS_REGION }}
283-
role-duration-seconds: 10800
284-
- name: Run tests
285-
run: |
286-
cd build
287-
ulimit -c unlimited -S
288-
timeout --signal=SIGABRT 150m ./tst/producer_test --gtest_break_on_failure
289-
290-
# memory-sanitizer:
291-
# runs-on: ubuntu-20.04
292-
# permissions:
293-
# id-token: write
294-
# contents: read
295-
# env:
296-
# CC: clang
297-
# CXX: clang++
298-
# AWS_KVS_LOG_LEVEL: 2
299-
# steps:
300-
# - name: Clone repository
301-
# uses: actions/checkout@v3
302-
# - name: Configure AWS Credentials
303-
# uses: aws-actions/configure-aws-credentials@v4
304-
# with:
305-
# role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
306-
# role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
307-
# aws-region: ${{ secrets.AWS_REGION }}
308-
# - name: Build repository
309-
# run: |
310-
# mkdir build && cd build
311-
# cmake .. -DBUILD_TEST=TRUE -DMEMORY_SANITIZER=TRUE -DBUILD_COMMON_LWS=TRUE
312-
# make
313-
# ulimit -c unlimited -S
314-
# timeout --signal=SIGABRT 150m ./tst/producer_test --gtest_break_on_failure
315-
316-
# thread-sanitizer:
317-
# runs-on: ubuntu-20.04
318-
# permissions:
319-
# id-token: write
320-
# contents: read
321-
# env:
322-
# CC: clang
323-
# CXX: clang++
324-
# AWS_KVS_LOG_LEVEL: 2
325-
# steps:
326-
# - name: Clone repository
327-
# uses: actions/checkout@v3
328-
# - name: Configure AWS Credentials
329-
# uses: aws-actions/configure-aws-credentials@v4
330-
# with:
331-
# role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
332-
# role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
333-
# aws-region: ${{ secrets.AWS_REGION }}
334-
# - name: Build repository
335-
# run: |
336-
# mkdir build && cd build
337-
# cmake .. -DBUILD_TEST=TRUE -DTHREAD_SANITIZER=TRUE -DBUILD_COMMON_LWS=TRUE
338-
# make
339-
# - name: Run tests
340-
# run: |
341-
# cd build
342-
# ulimit -c unlimited -S
343-
# timeout --signal=SIGABRT 150m ./tst/producer_test --gtest_break_on_failure
344-
345230
ubuntu-gcc:
346231
runs-on: ubuntu-22.04
347232
env:
+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Linux sanitizers
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- master
8+
pull_request:
9+
branches:
10+
- develop
11+
- master
12+
13+
jobs:
14+
linux-sanitizers:
15+
strategy:
16+
matrix:
17+
sanitizer:
18+
- ADDRESS_SANITIZER
19+
- UNDEFINED_BEHAVIOR_SANITIZER
20+
# - THREAD_SANITIZER
21+
# - MEMORY_SANITIZER
22+
config:
23+
- name: With Common LWS
24+
cmake_flags: "-DBUILD_TEST=ON -DBUILD_COMMON_LWS=ON"
25+
26+
fail-fast: false
27+
28+
runs-on: ubuntu-latest
29+
container:
30+
image: public.ecr.aws/ubuntu/ubuntu:20.04_stable
31+
32+
timeout-minutes: 80
33+
34+
env:
35+
CC: clang
36+
CXX: clang++
37+
AWS_KVS_LOG_LEVEL: 7
38+
DEBIAN_FRONTEND: noninteractive
39+
40+
permissions:
41+
id-token: write
42+
contents: read
43+
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v4
47+
48+
- name: Install dependencies
49+
run: |
50+
apt-get update
51+
apt-get -y install git build-essential automake pkg-config cmake clang
52+
53+
- name: Build repository - ${{ matrix.config.name }}
54+
run: |
55+
mkdir -p build
56+
cd build
57+
cmake .. -D${{ matrix.sanitizer }}=ON ${{ matrix.config.cmake_flags }}
58+
make -j$(nproc)
59+
60+
- name: Configure AWS Credentials
61+
uses: aws-actions/configure-aws-credentials@v4
62+
with:
63+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
64+
role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
65+
aws-region: ${{ secrets.AWS_REGION }}
66+
role-duration-seconds: 10800
67+
68+
- name: Run tests - ${{ matrix.config.name }}
69+
working-directory: ./build
70+
run: |
71+
timeout --signal=SIGABRT 150m ./tst/producer_test

src/source/CurlApiCallbacks.c

+2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ STATUS createCurlApiCallbacks(PCallbacksProvider pCallbacksProvider, PCHAR regio
148148
CHK_STATUS(initializeSslCallbacks());
149149

150150
// CURL global initialization
151+
DLOGD("Initializing curl");
151152
CHK(0 == curl_global_init(CURL_GLOBAL_ALL), STATUS_CURL_LIBRARY_INIT_FAILED);
153+
DLOGD("Successfully initialized curl");
152154

153155
// Not in shutdown
154156
ATOMIC_STORE_BOOL(&pCurlApiCallbacks->shutdown, FALSE);

0 commit comments

Comments
 (0)