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

gn: Disable function UBsan check to support new vulkan.hpp function pointers #1664

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gnoliyil
Copy link
Contributor

@gnoliyil gnoliyil commented Feb 24, 2025

KhronosGroup/Vulkan-Hpp#2020 added vk::PFN_... function pointer types as the preferred function pointers used in vulkan.hpp structs and functions.

These function pointer types use C++-styled types for the function arguments and return values, so the compiler treats them as types different from the C-styled "PFN_...` function pointers types. Vulkan-Hpp guarantees that they are binary identical during compile time, but UBsan's function sanitizer trigger a "function pointer type different" runtime error when these function pointers are invoked in the Vulkan-Loader (for example, debug_utils.c and allocation.c) -- see KhronosGroup/Vulkan-Hpp#2082 for example.

This change disables the function sanitizer from the Vulkan-Loader (where the function pointers are invoked) so that Vulkan applications created using Vulkan-Hpp can run correctly when UBsan is enabled.

Test: Vulkan example vkcontext with change https://fuchsia-review.googlesource.com/c/fuchsia/+/1208145 didn't crash on Fuchsia core.x64-asan build.

Bug: https://fxbug.dev/378964821

@ci-tester-lunarg
Copy link

Author gnoliyil not on autobuild list. Waiting for curator authorization before starting CI build.

1 similar comment
@ci-tester-lunarg
Copy link

Author gnoliyil not on autobuild list. Waiting for curator authorization before starting CI build.

KhronosGroup/Vulkan-Hpp#2020 added `vk::PFN_...` function pointer
types as the preferred function pointers used in vulkan.hpp structs
and functions.

These function pointer types use C++-styled types for the function
arguments and return values, so the compiler treats them as types
different from the C-styled "PFN_...` function pointers types.
Vulkan-Hpp guarantees that they are binary identical during compile
time, but UBsan's function sanitizer trigger a "function pointer
type different" runtime error when these function pointers are invoked
in the Vulkan-Loader (for example, debug_utils.c and allocation.c).

Thus, we need to disable the function sanitizer from the Vulkan-Loader
so that Vulkan applications created using Vulkan-Hpp can run correctly
when UBsan is enabled.

Test: Vulkan examples (https://fuchsia.googlesource.com/fuchsia/+/
main/src/graphics/tests/common/test_vkcontext.cc) didn't crash on
Fuchsia core.x64-asan build.

Bug: https://fxbug.dev/378964821

Change-Id: I8406daa884e741dbc8ade8c0e402550c450858e0
@ci-tester-lunarg
Copy link

Author gnoliyil not on autobuild list. Waiting for curator authorization before starting CI build.

1 similar comment
@ci-tester-lunarg
Copy link

Author gnoliyil not on autobuild list. Waiting for curator authorization before starting CI build.

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.

2 participants