Fix undefined behavior defined by ASAN#1451
Merged
Merged
Conversation
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #1451 +/- ##
============================================
- Coverage 70.81% 70.78% -0.04%
============================================
Files 119 119
Lines 64691 64703 +12
============================================
- Hits 45812 45797 -15
- Misses 18879 18906 +27
|
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech> Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
kronwerk
pushed a commit
to kronwerk/valkey
that referenced
this pull request
Jan 27, 2025
Asan now supports making sure you are passing in the correct pointer type, which seems useful but we can't support it since we pass in an incorrect pointer in several places. This is most commonly done with generic free functions, where we simply cast it to the correct type. It's not a lot of code to clean up, so it seems appropriate to cleanup instead of disabling the check. --------- Signed-off-by: Madelyn Olson <madelyneolson@gmail.com> Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
vitarb
pushed a commit
to vitarb/valkey
that referenced
this pull request
Jun 24, 2025
Asan now supports making sure you are passing in the correct pointer type, which seems useful but we can't support it since we pass in an incorrect pointer in several places. This is most commonly done with generic free functions, where we simply cast it to the correct type. It's not a lot of code to clean up, so it seems appropriate to cleanup instead of disabling the check. --------- Signed-off-by: Madelyn Olson <madelyneolson@gmail.com> Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
vitarb
pushed a commit
to vitarb/valkey
that referenced
this pull request
Jun 24, 2025
Asan now supports making sure you are passing in the correct pointer type, which seems useful but we can't support it since we pass in an incorrect pointer in several places. This is most commonly done with generic free functions, where we simply cast it to the correct type. It's not a lot of code to clean up, so it seems appropriate to cleanup instead of disabling the check. --------- Signed-off-by: Madelyn Olson <madelyneolson@gmail.com> Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
zuiderkwast
added a commit
to vitarb/valkey
that referenced
this pull request
Aug 15, 2025
Asan now supports making sure you are passing in the correct pointer type, which seems useful but we can't support it since we pass in an incorrect pointer in several places. This is most commonly done with generic free functions, where we simply cast it to the correct type. It's not a lot of code to clean up, so it seems appropriate to cleanup instead of disabling the check. --------- Signed-off-by: Madelyn Olson <madelyneolson@gmail.com> Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
zuiderkwast
added a commit
to vitarb/valkey
that referenced
this pull request
Aug 15, 2025
Asan now supports making sure you are passing in the correct pointer type, which seems useful but we can't support it since we pass in an incorrect pointer in several places. This is most commonly done with generic free functions, where we simply cast it to the correct type. It's not a lot of code to clean up, so it seems appropriate to cleanup instead of disabling the check. --------- Signed-off-by: Madelyn Olson <madelyneolson@gmail.com> Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech> Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
zuiderkwast
added a commit
to vitarb/valkey
that referenced
this pull request
Aug 21, 2025
Asan now supports making sure you are passing in the correct pointer type, which seems useful but we can't support it since we pass in an incorrect pointer in several places. This is most commonly done with generic free functions, where we simply cast it to the correct type. It's not a lot of code to clean up, so it seems appropriate to cleanup instead of disabling the check. --------- Signed-off-by: Madelyn Olson <madelyneolson@gmail.com> Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech> Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
zuiderkwast
added a commit
that referenced
this pull request
Aug 22, 2025
Asan now supports making sure you are passing in the correct pointer type, which seems useful but we can't support it since we pass in an incorrect pointer in several places. This is most commonly done with generic free functions, where we simply cast it to the correct type. It's not a lot of code to clean up, so it seems appropriate to cleanup instead of disabling the check. --------- Signed-off-by: Madelyn Olson <madelyneolson@gmail.com> Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech> Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
sarthakaggarwal97
pushed a commit
to sarthakaggarwal97/valkey
that referenced
this pull request
Sep 16, 2025
Asan now supports making sure you are passing in the correct pointer type, which seems useful but we can't support it since we pass in an incorrect pointer in several places. This is most commonly done with generic free functions, where we simply cast it to the correct type. It's not a lot of code to clean up, so it seems appropriate to cleanup instead of disabling the check. --------- Signed-off-by: Madelyn Olson <madelyneolson@gmail.com> Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech> Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Merged
sarthakaggarwal97
added a commit
to sarthakaggarwal97/valkey
that referenced
this pull request
Apr 16, 2026
Replace (void (*)(void*))sdsfree casts with sdsfreeVoid (which already exists on 7.2 in sds.c). Add engineLibraryFreeVoid wrapper in functions.c. Remove unnecessary cast on zfree (already void*). Fixes UBSan error: 'call to function sdsfree through pointer to incorrect function type void (*)(void *)' at adlist.c:185. Minimal backport of valkey-io#1451 from unstable. Signed-off-by: Sarthak Aggarwal <sarthagg@amazon.com>
sarthakaggarwal97
added a commit
to sarthakaggarwal97/valkey
that referenced
this pull request
Apr 27, 2026
Replace (void (*)(void*))sdsfree casts with sdsfreeVoid (which already exists on 7.2 in sds.c). Add engineLibraryFreeVoid wrapper in functions.c. Remove unnecessary cast on zfree (already void*). Fixes UBSan error: 'call to function sdsfree through pointer to incorrect function type void (*)(void *)' at adlist.c:185. Minimal backport of valkey-io#1451 from unstable. Signed-off-by: Sarthak Aggarwal <sarthagg@amazon.com> (cherry picked from commit 5eeedb1)
sarthakaggarwal97
added a commit
to sarthakaggarwal97/valkey
that referenced
this pull request
May 4, 2026
Replace (void (*)(void*))sdsfree casts with sdsfreeVoid (which already exists on 7.2 in sds.c). Add engineLibraryFreeVoid wrapper in functions.c. Remove unnecessary cast on zfree (already void*). Fixes UBSan error: 'call to function sdsfree through pointer to incorrect function type void (*)(void *)' at adlist.c:185. Minimal backport of valkey-io#1451 from unstable. Signed-off-by: Sarthak Aggarwal <sarthagg@amazon.com> (cherry picked from commit 5eeedb1)
madolson
pushed a commit
that referenced
this pull request
May 6, 2026
Replace (void (*)(void*))sdsfree casts with sdsfreeVoid (which already exists on 7.2 in sds.c). Add engineLibraryFreeVoid wrapper in functions.c. Remove unnecessary cast on zfree (already void*). Fixes UBSan error: 'call to function sdsfree through pointer to incorrect function type void (*)(void *)' at adlist.c:185. Minimal backport of #1451 from unstable. Signed-off-by: Sarthak Aggarwal <sarthagg@amazon.com> (cherry picked from commit 5eeedb1)
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.
Asan now supports making sure you are passing in the correct pointer type, which seems useful but we can't support it since we pass in an incorrect pointer in several places. This is most commonly done with generic free functions, where we simply cast it to the correct type.
Example: https://github.com/valkey-io/valkey/actions/runs/12334182647/job/34424037283#step:6:318.
It's not a lot of code to clean up, so it seems appropriate to cleanup instead of disabling the check.
Validating run: https://github.com/valkey-io/valkey/actions/runs/12382893783/job/34564554891