Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UBSAN to ASAN builds #678

Merged
merged 1 commit into from
Nov 4, 2023
Merged

Add UBSAN to ASAN builds #678

merged 1 commit into from
Nov 4, 2023

Conversation

argilo
Copy link
Member

@argilo argilo commented Oct 23, 2023

Adding the Undefined Behaviour Sanitizer (UBSAN) to ASAN builds will allow more bugs to be uncovered. I already found a number of bugs this way:

Signed-off-by: Clayton Smith <[email protected]>
@jdemel
Copy link
Contributor

jdemel commented Nov 4, 2023

This changes runtime behavior. A quick search indicated that this change may affect performance. Do we want this to happen? Maybe it is sufficient to add a CI test with this option enabled.

@argilo
Copy link
Member Author

argilo commented Nov 4, 2023

ASAN changes runtime behaviour and reduces performance in the same way; it's only meant to be used for finding bugs. The intent here is to add more checks so that more bugs can be caught. I think that's compatible with the intent of #192, which added an ASAN build type in the first place, and seems to have been aimed at finding bugs by hand.

Running CI tests with ASAN+UBSAN at least once for each platform we care about (x86, ARM) would definitely help catch more bugs. The UBSAN_OPTIONS="halt_on_error=1" environment variable would need to be set, since UBSAN's default behaviour is to print an error message and carry on.

@jdemel
Copy link
Contributor

jdemel commented Nov 4, 2023

Got it.

CMake provides -DCMAKE_BUILD_TYPE=ASAN. We just add the options here. The way this cmake file works is not obvious.

I merge this PR now. We can add the CI tests in another PR.

@jdemel jdemel merged commit d162b6b into gnuradio:main Nov 4, 2023
32 checks passed
@argilo argilo deleted the add-ubsan branch November 4, 2023 15:08
Alesha72003 pushed a commit to Alesha72003/volk that referenced this pull request May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants