Fixes for ASAN/MSAN#10
Open
vihangm wants to merge 13 commits into
Open
Conversation
…tizer Clang -fsanitize=function flags indirect calls when resolved symbols do not match exact C function pointer types even if the FFI is intentionally type-erased.
IREE_VM_ABI_* shims pass args/rets as target2 (void* ABI). The old typedef used native_function_target_t (3-arg callback), which Clang's function sanitizer correctly rejected at indirect call sites.
…nction) target2_t now lives in native_module.h. Annotate IREE_VM_ABI_DEFINE_SHIM bodies so Clang does not flag IREE_VM_ABI_EXPORT targets with concrete struct pointers.
…tive_function_target2_t Keeps EXPORT_FN tables consistent with the codegen VM ABI shim path.
Adjust call_shim_i32_i32, yieldable shims, and bytecode benchmark shim to match iree_vm_native_function_shim_t after target2.
Descriptors store iree_vm_ref_destroy_t (void (*)(void*)), while HAL-provided destroy hooks use typed pointers; Clang resolves the resolved symbol.
Typed HAL objects register destroy with identical layout to iree_hal_resource_vtable_t.destroy but Clang still flags mismatched prototypes.
iree_hal_cmd_apply_fn_t erases pointers to disparate apply_* signatures; annotate apply() only.
Zero iree_allocator_alloc_params_t before passing to allocator.ctl so padding is initialized. In the libc implementation, only read *inout_ptr for REALLOC; malloc and calloc callers use that slot as an uninitialized out-parameter.
Set path to an empty string view explicitly in the static device_infos used when cloning enumerated devices, avoiding partially initialized aggregates.
glibc memcpy is annotated nonnull; memcpy with NULL pointers is undefined even when the length is zero. Only copy when key or metadata length is positive.
Signed-off-by: Vihang Mehta <vihang@gimletlabs.ai>
Linux sysfs cluster_id values can exceed 63; shifting 1ull by that amount is undefined behavior. Fold the id modulo 64 so the shift is always valid.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.