Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
612e82f
Refs #24364: Add UBSan workflow
cferreiragonz Apr 30, 2026
6c37a46
Refs #24365: Add CMake Undefined Behavior option
cferreiragonz Apr 17, 2026
19a39ac
Refs #24365: Fix building of tests with UBSan
cferreiragonz Apr 17, 2026
55336b0
Refs #24365: Compliance with ODR enum type in tests
cferreiragonz Apr 30, 2026
6cb433e
Refs #24365: Regression Test Malicious Data
cferreiragonz Apr 30, 2026
5a92690
Refs #24365: Review - Meta file
cferreiragonz May 4, 2026
ee93f1d
Refs #24365: Ensure no duplicates originate in UBSAN report due to ad…
cferreiragonz May 4, 2026
0727a3d
Refs #24365: Avoid calling memcmp with empty payloads
cferreiragonz Apr 17, 2026
f59b1eb
Refs #24365: Fix UB in TimedEvent ctor
cferreiragonz Apr 30, 2026
feef536
Refs #24365: Fix UB in SampleLostStatus due to overflow
cferreiragonz Apr 30, 2026
a50fd3e
Refs #24365: Fix UB in CDRMessage
cferreiragonz May 4, 2026
f61244f
Refs #24365: Fix UB in statistics::DomainParticipant
cferreiragonz May 4, 2026
2754b17
Refs #24365: Fix UB in ParticipantTests magically
cferreiragonz May 4, 2026
6f7a6e2
Refs #24365: Fix UB in UserListenerTests due to downcast
cferreiragonz May 5, 2026
a94c850
Refs #24365: Fix UB in PoolConfig due to overflow
cferreiragonz May 5, 2026
f7c5aae
Refs #24365: Fix UB in DataWriterTests magically
cferreiragonz May 5, 2026
82bb891
Refs #24365: Fix UB in TCPv4Test due to wrong type cast
cferreiragonz May 5, 2026
0b22b1b
Refs #24365: Fix UB in Security tests with SharedSecretHandle
cferreiragonz May 5, 2026
deac399
Refs #24365: Fix UB in Log Options
cferreiragonz May 6, 2026
8c9ee0d
Refs #24365: Fix UB in MonitorServiceTests
cferreiragonz May 6, 2026
0b4ee95
Refs #24365: Skip false positive of sqlite3.c
cferreiragonz May 6, 2026
8005593
Refs #24365: Fix mac/windows build
cferreiragonz May 14, 2026
923051c
Refs #24365: Fix UB in DataReader/Writer blackbox tests
cferreiragonz May 18, 2026
19dd7ee
Refs #24365: Fix UB in Latency tests
cferreiragonz May 18, 2026
4723fa6
Refs #24365: Fix UB in StatisticsTests magically
cferreiragonz May 18, 2026
7af6acc
Refs #24365: Fix UB in RTPSStatisticsTests magically
cferreiragonz May 18, 2026
921e75e
Refs #24365: Fix UB in SecurityManager
cferreiragonz Jun 1, 2026
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
17 changes: 17 additions & 0 deletions .github/workflows/config/ubsan.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
names:
fastdds:
cmake-args:
- -DNO_TLS=OFF
- -DSECURITY=ON
- -DFASTDDS_STATISTICS=ON
- -DSANITIZER=Undefined
- -DCOMPILE_WARNING_AS_ERROR=ON
- -DEPROSIMA_BUILD_TESTS=ON
- -DRTPS_API_TESTS=ON
- -DFASTDDS_PIM_API_TESTS=ON
- -DPERFORMANCE_TESTS=ON
googletest-distribution:
cmake-args:
- -Dgtest_force_shared_crt=ON
- -DBUILD_SHARED_LIBS=ON
- -DBUILD_GMOCK=ON
190 changes: 190 additions & 0 deletions .github/workflows/reusable-sanitizers-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
description: 'Run Thread Sanitizer job for Fast DDS'
required: false
type: boolean
run_ubsan_fastdds:
description: 'Run Undefined Behavior Sanitizer job for Fast DDS'
required: false
type: boolean
colcon_build_args:
description: 'Optional colcon build arguments'
required: false
Expand Down Expand Up @@ -424,3 +428,189 @@ jobs:
run: |
Write-Host ${{ steps.report_summary.outcome }}
exit 1

ubsan_fastdds_build:
if: ${{ inputs.run_ubsan_fastdds == true }}
runs-on: ubuntu-24.04
steps:
- name: Free disk space
uses: eProsima/eProsima-CI/ubuntu/free_disk_space@v0

- name: Sync eProsima/Fast-DDS repository
uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: src/fastdds
submodules: true
ref: ${{ inputs.fastdds_ref }}

- name: Install Fix Python version
Comment thread
cferreiragonz marked this conversation as resolved.
uses: eProsima/eProsima-CI/external/setup-python@v0
with:
python-version: '3.11'

- name: Get minimum supported version of CMake
uses: eProsima/eProsima-CI/external/get-cmake@v0
with:
cmakeVersion: '3.28.6'

- name: Install apt packages
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
with:
packages: curl grep libasio-dev libtinyxml2-dev python3 python3-pip software-properties-common wget

- name: Install colcon
uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0

- name: Install Python dependencies
uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0
with:
packages: vcstool xmlschema

- name: Setup CCache
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0
if: ${{ !always() }}
with:
api_token: ${{ secrets.GITHUB_TOKEN }}

- name: Get Fast CDR branch
id: get_fastcdr_branch
uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0
with:
remote_repository: eProsima/Fast-CDR
fallback_branch: ${{ inputs.fastcdr_ref }}

- name: Download Fast CDR
uses: eProsima/eProsima-CI/external/checkout@v0
with:
repository: eProsima/Fast-CDR
path: ${{ github.workspace }}/src/fastcdr
ref: ${{ steps.get_fastcdr_branch.outputs.deduced_branch }}

- name: Fetch Fast DDS dependencies
uses: eProsima/eProsima-CI/ubuntu/vcs_import@v0
with:
vcs_repos_file: ${{ github.workspace }}/src/fastdds/fastdds.repos
destination_workspace: src
skip_existing: 'true'

- name: Fetch Fast DDS CI dependencies
uses: eProsima/eProsima-CI/ubuntu/vcs_import@v0
with:
vcs_repos_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_test.repos
destination_workspace: src
skip_existing: 'true'

- name: Show .meta file
id: show_meta
run: |
cat ${{ github.workspace }}/src/fastdds/.github/workflows/config/ubsan.meta

- name: Colcon build
continue-on-error: false
uses: eProsima/eProsima-CI/ubuntu/colcon_build@v0
with:
colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/ubsan.meta
colcon_build_args: ${{ inputs.colcon_build_args }}
cmake_args: ${{ inputs.cmake_args }}
cmake_args_default: ''
cmake_build_type: 'Debug'
workspace: ${{ github.workspace }}
workspace_dependencies: ''

- name: Pack workspace preserving permissions
shell: bash
run: |
tar -C "${{ github.workspace }}" -cpf "${{ runner.temp }}/ubsan_build_${{ inputs.label }}.tar" .

- name: Upload build artifacts
uses: eProsima/eProsima-CI/external/upload-artifact@v0
with:
name: build_artifacts_fastdds_ubsan_${{ inputs.label }}
path: ${{ runner.temp }}/ubsan_build_${{ inputs.label }}.tar

ubsan_fastdds_test:
if: ${{ inputs.run_ubsan_fastdds == true }}
needs: ubsan_fastdds_build
runs-on: ubuntu-24.04
env:
UBSAN_OPTIONS: halt_on_error=1:abort_on_error=1:print_stacktrace=1
steps:
- name: Free disk space
uses: eProsima/eProsima-CI/ubuntu/free_disk_space@v0

- name: Download build artifact
uses: eProsima/eProsima-CI/external/download-artifact@v0
with:
name: build_artifacts_fastdds_ubsan_${{ inputs.label }}
path: ${{ runner.temp }}

- name: Unpack workspace preserving permissions
shell: bash
run: |
tar -C "${{ github.workspace }}" -xpf "${{ runner.temp }}/ubsan_build_${{ inputs.label }}.tar"

- name: Install Fix Python version
uses: eProsima/eProsima-CI/external/setup-python@v0
with:
python-version: '3.11'

- name: Get minimum supported version of CMake
uses: eProsima/eProsima-CI/external/get-cmake@v0
with:
cmakeVersion: '3.28.6'

- name: Install apt packages
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
with:
packages: curl grep libasio-dev libtinyxml2-dev python3 python3-pip software-properties-common wget

- name: Install colcon
uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0

- name: Install Python dependencies
uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0
with:
packages: setuptools gcovr tomark xmltodict jsondiff pandas psutil

- name: Set up hosts file for DNS testing
run: |
sudo echo "" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 localhost.test" | sudo tee -a /etc/hosts
sudo echo "::1 localhost.test" | sudo tee -a /etc/hosts
sudo echo "154.56.134.194 www.eprosima.com.test" | sudo tee -a /etc/hosts
sudo echo "216.58.215.164 www.acme.com.test" | sudo tee -a /etc/hosts
sudo echo "2a00:1450:400e:803::2004 www.acme.com.test" | sudo tee -a /etc/hosts
sudo echo "140.82.121.4 www.foo.com.test" | sudo tee -a /etc/hosts
sudo echo "140.82.121.3 www.foo.com.test" | sudo tee -a /etc/hosts
sudo echo "ff1e::ffff:efff:1 acme.org.test" | sudo tee -a /etc/hosts

- name: Colcon test
id: test
continue-on-error: true
uses: eProsima/eProsima-CI/ubuntu/colcon_test@v0
with:
colcon_args_default: ''
colcon_test_args: ${{ inputs.colcon_test_args }}
colcon_test_args_default: '--event-handlers=console_direct+ --return-code-on-test-failure'
ctest_args: ${{ inputs.ctest_args }}
ctest_args_default: '--timeout 300 --label-exclude "xfail"'
packages_names: fastdds
workspace: ${{ github.workspace }}
workspace_dependencies: ''
test_report_artifact: ${{ format('test_report_{0}_{1}', inputs.label, github.job) }}

- name: Report sanitizer errors
run: |
# UBSan finding header lines look like:
# <file>:<line>:<col>: runtime error: <description>
# Filter on ": runtime error:" so we keep one line per finding (the header)
bash src/fastdds/.github/workflows/utils/specific_errors_filter.sh \
": runtime error:" \
log/latest_test/fastdds/stdout_stderr.log \
_tmp_specific_error_file.log

python3 src/fastdds/.github/workflows/utils/log_parser.py \
--log-file log/latest_test/fastdds/stdout_stderr.log \
--specific-error-file _tmp_specific_error_file.log \
--output-file $GITHUB_STEP_SUMMARY \
--sanitizer ubsan
5 changes: 5 additions & 0 deletions .github/workflows/sanitizers-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
description: 'Run Thread Sanitizer job for Fast DDS'
required: false
type: boolean
run_ubsan_fastdds:
description: 'Run Undefined Behavior Sanitizer job for Fast DDS'
required: false
type: boolean
colcon_build_args:
description: 'Optional colcon build arguments'
required: false
Expand Down Expand Up @@ -59,6 +63,7 @@ jobs:
label: ${{ inputs.label || 'fastdds-sanitizers-ci' }}
run_asan_fastdds: ${{ ((inputs.run_asan_fastdds == true) && true) || github.event_name == 'pull_request' }}
run_tsan_fastdds: ${{ ((inputs.run_tsan_fastdds == true) && true) || github.event_name == 'pull_request' }}
run_ubsan_fastdds: ${{ ((inputs.run_ubsan_fastdds == true) && true) || github.event_name == 'pull_request' }}
colcon_build_args: ${{ inputs.colcon_build_args || '' }}
colcon_test_args: ${{ inputs.colcon_test_args || '' }}
cmake_args: ${{ inputs.cmake_args || '' }}
Expand Down
Loading
Loading