Skip to content

Fix cluster access to unaligned memory (SIGBUS on old ARM)#7958

Merged
oranagra merged 1 commit intoredis:unstablefrom
oranagra:cluster_align_mem
Oct 27, 2020
Merged

Fix cluster access to unaligned memory (SIGBUS on old ARM)#7958
oranagra merged 1 commit intoredis:unstablefrom
oranagra:cluster_align_mem

Conversation

@oranagra
Copy link
Member

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.

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.
@oranagra oranagra requested a review from yossigo October 25, 2020 15:23
@oranagra
Copy link
Member Author

cluster tests (with valgrind) pass.

@oranagra oranagra linked an issue Oct 25, 2020 that may be closed by this pull request
@oranagra oranagra merged commit 380f604 into redis:unstable Oct 27, 2020
@oranagra oranagra deleted the cluster_align_mem branch October 27, 2020 14:36
@yossigo
Copy link
Collaborator

yossigo commented Oct 27, 2020

@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 .
@oranagra oranagra mentioned this pull request Jan 11, 2021
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)
@oranagra oranagra mentioned this pull request Jan 13, 2021
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.

Redis Cluster crashes on certain armhf platforms.

2 participants