Fix cluster access to unaligned memory (SIGBUS on old ARM)#7958
Merged
oranagra merged 1 commit intoredis:unstablefrom Oct 27, 2020
oranagra:cluster_align_mem
Merged
Fix cluster access to unaligned memory (SIGBUS on old ARM)#7958oranagra merged 1 commit intoredis:unstablefrom oranagra:cluster_align_mem
oranagra merged 1 commit intoredis:unstablefrom
oranagra:cluster_align_mem
Conversation
Turns out this was broken since version 4.0 when we added sds size classes. The cluster code uses sds for the receive buffer, and then casts it to a struct and accesses a 64 bit variable. This commit replaces the use of sds with a simple reallocated buffer.
Member
Author
|
cluster tests (with valgrind) pass. |
yossigo
approved these changes
Oct 27, 2020
Collaborator
|
@oranagra clang undefined behavior sanitizer seems to confirm this was the only case of unaligned access. |
JackieXie168
pushed a commit
to JackieXie168/redis
that referenced
this pull request
Nov 4, 2020
Turns out this was broken since version 4.0 when we added sds size classes. The cluster code uses sds for the receive buffer, and then casts it to a struct and accesses a 64 bit variable. This commit replaces the use of sds with a simple reallocated buffer.
hwware
added a commit
to hwware/redis
that referenced
this pull request
Dec 14, 2020
a small comment nit was found when i was reading redis#7958 .
Merged
oranagra
added a commit
that referenced
this pull request
Jan 12, 2021
Turns out this was broken since version 4.0 when we added sds size classes. The cluster code uses sds for the receive buffer, and then casts it to a struct and accesses a 64 bit variable. This commit replaces the use of sds with a simple reallocated buffer. (cherry picked from commit 380f604)
Merged
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.
Turns out this was broken since version 4.0 when we added sds size
classes.
The cluster code uses sds for the receive buffer, and then casts it to a
struct and accesses a 64 bit variable.
This commit replaces the use of sds with a simple reallocated buffer.