Skip to content

Fix warnings found by the Undefined Behavior Sanitizer#274

Open
bjosv wants to merge 5 commits into
awslabs:mainfrom
Nordix:ubsan-fixes
Open

Fix warnings found by the Undefined Behavior Sanitizer#274
bjosv wants to merge 5 commits into
awslabs:mainfrom
Nordix:ubsan-fixes

Conversation

@bjosv

@bjosv bjosv commented Aug 7, 2025

Copy link
Copy Markdown

Fixes runtime error warnings found when running the tests with the undefined behavior sanitizer enabled.

grep "runtime error" aws-c-auth/build/Testing/Temporary/LastTest.log

aws-c-common/source/hash_table.c:68:16: runtime error: call to function aws_byte_cursor_eq through pointer to incorrect function type 'bool (*)(const void *, const void *)'
...

Description of changes:
Add a callback function that uses correct signature aws_hash_callback_eq_fn (as seen in aws-c-mqtt).

Since the CI-build is not using -fno-sanitize-recover=all, and the warnings are recoverable they will not fail the CI build.
The warnings are also found when a user incorporates aws-sdk-cpp into a project and build it using an UB sanitizer.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

bjosv added 5 commits August 7, 2025 14:51
Fixes runtime error warnings found when running the tests
with the undefined behavior sanitizer enabled.

"runtime error: call to function aws_byte_cursor_eq through pointer
 to incorrect function type 'bool (*)(const void *, const void *)'"

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
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.

1 participant