Hello Zoltan Chovan, Zoltan Martonka, Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/23061
to look at the new patch set (#2).
Change subject: [ARM ]Fix unaligned pointer warning in CBTree
......................................................................
[ARM ]Fix unaligned pointer warning in CBTree
On ARM-based platforms (e.g., Rocky Linux 9), building Kudu triggers
the following warning:
warning: taking address of packed member of ‘InternalNode<DMSTreeTraits>’
may result in an unaligned pointer value [-Waddress-of-packed-member]
This warning was raised in InternalNode::Insert(), where the address
of the packed member 'num_children_' is passed to
base::subtle::Release_Store(). Taking the address of a packed field
can lead to unaligned memory access, which is undefined behavior on
some architectures like ARM.
To fix this, avoid directly taking the address of the packed member.
Instead, cast the pointer through an intermediate uintptr_t to ensure
alignment safety, or use memcpy to avoid potential misalignment issues.
This change suppresses the warning and ensures safe access to memory
across architectures without changing the memory layout.
Tested on: Rocky Linux 9 (aarch64)
Change-Id: Ib8e6f7b0d3516409ae99e4c846f839b6868b3deb
---
M src/kudu/tablet/concurrent_btree.h
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/61/23061/2
--
To view, visit http://gerrit.cloudera.org:8080/23061
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ib8e6f7b0d3516409ae99e4c846f839b6868b3deb
Gerrit-Change-Number: 23061
Gerrit-PatchSet: 2
Gerrit-Owner: KeDeng <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Chovan <[email protected]>
Gerrit-Reviewer: Zoltan Martonka <[email protected]>