Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,64 @@ jobs:
echo "## Sanitizer Results: ${{ matrix.os }} / ${{ matrix.compiler }} (main monitor)" >> "$GITHUB_STEP_SUMMARY"
echo '' >> "$GITHUB_STEP_SUMMARY"
echo "Status: **${STATUS}** (non-blocking)" >> "$GITHUB_STEP_SUMMARY"

# ==========================================================================
# Phase 4: TSan — Thread Sanitizer (parallel, non-blocking)
# Linux GCC + Clang only (TSan/ASan mutually exclusive)
# Monitors mutex safety in I/O adapter registry and workqueue.
# fail-fast: false — all configurations run to completion
# ==========================================================================
tsan:
name: TSan / ${{ matrix.os }} / ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
include:
# Linux - GCC with TSan
- os: ubuntu-latest
compiler: gcc
cc: gcc

# Linux - Clang with TSan
- os: ubuntu-latest
compiler: clang
cc: clang

steps:
- uses: actions/checkout@v5

- name: Install dependencies (Linux)
run: |
sudo apt-get update
sudo apt-get install -y meson ninja-build
if [ "${{ matrix.compiler }}" = "clang" ]; then
sudo apt-get install -y clang
fi

- name: Configure with TSan
run: >
meson setup builddir-tsan
-Db_sanitize=thread
-Db_lundef=false
-Dtests=true
--buildtype=debug
env:
CC: ${{ matrix.cc }}

- name: Build
run: meson compile -C builddir-tsan

- name: Test
run: meson test -C builddir-tsan --print-errorlogs
env:
TSAN_OPTIONS: halt_on_error=1:second_deadlock_stack=1

- name: Publish results
if: always()
run: |
STATUS="${{ job.status }}"
echo "## TSan Results: ${{ matrix.os }} / ${{ matrix.compiler }} (main monitor)" >> "$GITHUB_STEP_SUMMARY"
echo '' >> "$GITHUB_STEP_SUMMARY"
echo "Status: **${STATUS}** (non-blocking)" >> "$GITHUB_STEP_SUMMARY"
14 changes: 14 additions & 0 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,17 @@ jobs:
env:
ASAN_OPTIONS: abort_on_error=1:halt_on_error=1
UBSAN_OPTIONS: abort_on_error=1:halt_on_error=1:print_stacktrace=1

- name: Sanitizers / TSan
if: matrix.os == 'ubuntu-latest'
run: |
meson setup builddir-tsan \
-Db_sanitize=thread \
-Db_lundef=false \
-Dtests=true \
--buildtype=debug
meson compile -C builddir-tsan
meson test -C builddir-tsan --print-errorlogs
env:
TSAN_OPTIONS: halt_on_error=1:second_deadlock_stack=1
CC: ${{ matrix.cc }}
44 changes: 44 additions & 0 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2451,3 +2451,47 @@ test_io_dispatch_exe = executable(
install: false,
)
test('io_dispatch', test_io_dispatch_exe)

# ============================================================================
# Concurrent I/O Adapter Registry Stress Test (#459)
# Exercises mutex safety under TSan: concurrent find, register/unregister,
# and mixed readers+writers. Linux/macOS only (pthreads; skipped on Windows).
# ============================================================================

test_io_adapter_concurrent_exe = executable(
'test_io_adapter_concurrent',
files('test_io_adapter_concurrent.c',
'../wirelog/io/io_adapter.c',
'../wirelog/io/csv_adapter.c',
'../wirelog/io/csv_reader.c',
'../wirelog/io/io_ctx.c',
'../wirelog/intern.c'),
thread_src,
include_directories: [wirelog_inc, wirelog_src_inc],
c_args: ['-DWIRELOG_BUILDING'],
dependencies: [threads_dep],
install: false,
)
test('io_adapter_concurrent', test_io_adapter_concurrent_exe)

# ============================================================================
# Mock Adapter Error-Path Tests for ASan (#459)
# Exercises NULL inputs, boundary scheme lengths, registry-full, and
# error-string clearing. ASan catches out-of-bounds writes on scheme copy.
# ============================================================================

test_io_adapter_asan_exe = executable(
'test_io_adapter_asan',
files('test_io_adapter_asan.c',
'../wirelog/io/io_adapter.c',
'../wirelog/io/csv_adapter.c',
'../wirelog/io/csv_reader.c',
'../wirelog/io/io_ctx.c',
'../wirelog/intern.c'),
thread_src,
include_directories: [wirelog_inc, wirelog_src_inc],
c_args: ['-DWIRELOG_BUILDING'],
dependencies: [threads_dep],
install: false,
)
test('io_adapter_asan', test_io_adapter_asan_exe)
Loading
Loading