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 testing #9384

Open
jpr42 opened this issue Feb 3, 2025 · 0 comments
Open

Add UBSAN testing #9384

jpr42 opened this issue Feb 3, 2025 · 0 comments
Assignees
Labels
CI/Tests Anything related to CI or testing

Comments

@jpr42
Copy link
Contributor

jpr42 commented Feb 3, 2025

Similar to the existing address sanitization and thread sanitization it's worth adding undefined behavior sanitization testing:
https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html

Running VVL tests with UBSAN does show failing tests.

Here is an example:

[ RUN      ] NegativeCommand.MultiDraw
/home/juaramos/projects/Vulkan-ValidationLayers/layers/core_checks/cc_drawdispatch.cpp:284:96: runtime error: member access within misaligned address 0x7ffdc5bf777d for type 'const struct VkMultiDrawIndexedInfoEXT', which requires 4 byte alignment
0x7ffdc5bf777d: note: pointer points here
 00 00 00 00 00 00 00  01 00 00 00 00 00 00 00  00 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00  00
             ^ 
Command "/home/juaramos/projects/Vulkan-ValidationLayers/build-ci/install/bin/vk_layer_validation_tests" failed with return code -6

NOTE: This doesn't need to be a new CI pass. This can just be added to ASAN testing.

GCC / Clang accept the following: -fsanitize=address,undefined.

NOTE: I had to set the environment variable UBSAN_OPTIONS to abort_on_error=1:halt_on_error=1 to get lldb to quickly point me to the exact problem when running the tests in vscode.

@spencer-lunarg spencer-lunarg added the CI/Tests Anything related to CI or testing label Feb 4, 2025
@spencer-lunarg spencer-lunarg self-assigned this Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/Tests Anything related to CI or testing
Projects
None yet
Development

No branches or pull requests

2 participants