KeDeng has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/23053 )

Change subject: [arm64] Fix TestLeafNode unit test by ensuring proper node 
alignment
......................................................................

[arm64] Fix TestLeafNode unit test by ensuring proper node alignment

The following error occurs when running `bin/cbtree-test
--gtest_filter=TestCBTree.TestLeafNode` in an Rocky ARM environment.

*** Aborted at 1748486900 (unix time) try "date -d @1748486900" if you are 
using GNU date ***
PC: @                0x0 (unknown)
*** SIGBUS (@0xffffc794b2af) received by PID 32172 (TID 0xffff838a0040) from 
PID 18446744072762995375; stack trace: ***
    @     0xffff83f0e890 google::(anonymous namespace)::FailureSignalHandler()
    @     0xffff853b07a0 ([vdso]+0x79f)
    @           0x279efc kudu::tablet::btree::VersionField::Lock()
    @           0x2815e4 kudu::tablet::btree::NodeBase<>::Lock()
    @           0x2788a4 kudu::tablet::btree::TestCBTree::InsertInLeaf<>()
    @           0x269d18 
kudu::tablet::btree::TestCBTree_TestLeafNode_Test::TestBody()
    @     0xffff83de0608 
testing::internal::HandleExceptionsInMethodIfSupported<>()
    @     0xffff83dd2348 testing::Test::Run()
    @     0xffff83dd24e8 testing::TestInfo::Run()
    @     0xffff83dd2b90 testing::TestSuite::Run()
    @     0xffff83dd7274 testing::internal::UnitTestImpl::RunAllTests()
    @     0xffff83dd25f0 testing::UnitTest::Run()
    @     0xffff85335f84 (unknown)
    @     0xffff853353e4 (unknown)
    @     0xffff838e7280 __libc_start_call_main
    @     0xffff838e7358 __libc_start_main_alias_2
    @           0x2698b0 _start
Bus error

The TestLeafNode unit test was triggering SIGBUS crashes on ARM64
architectures due to unaligned access of atomic version fields.
This occurred because the test created LeafNode instances on the stack
without guaranteed alignment, while ARM64 strictly requires 8-byte
alignment for atomic uint64_t operations.

This test-specific fix complements the production code alignment
measures and ensures:
- Unit tests respect the same alignment requirements as production
- ARM64 environments don't trigger SIGBUS during test execution
- Test reliability across different architectures

Testing environment:
- ARM64 (Neoverse-N1) with Rocky Linux 9.5
- Docker container runtime
- Strict alignment enforcement causing SIGBUS on unaligned access

We extend our gratitude to Zoltan for his essential testing validation
and remediation recommendations in this fix.

Change-Id: Ib838699ce3f966b2e7c371d5c74701f2f8d21a55
Change-I: I6fea46308f942ded97d93d27ae466fd13a31b53
Reviewed-on: http://gerrit.cloudera.org:8080/23049
Reviewed-by: Zoltan Martonka <[email protected]>
Tested-by: Alexey Serbin <[email protected]>
Reviewed-by: Alexey Serbin <[email protected]>
(cherry picked from commit fd5d0225880ae36f2437c83fa46c3a65c86f8931)
Reviewed-on: http://gerrit.cloudera.org:8080/23053
Reviewed-by: KeDeng <[email protected]>
Tested-by: KeDeng <[email protected]>
---
M src/kudu/tablet/cbtree-test.cc
1 file changed, 17 insertions(+), 5 deletions(-)

Approvals:
  KeDeng: Looks good to me, approved; Verified

--
To view, visit http://gerrit.cloudera.org:8080/23053
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: branch-1.18.x
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib838699ce3f966b2e7c371d5c74701f2f8d21a55
Gerrit-Change-Number: 23053
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Abhishek Chennaka <[email protected]>
Gerrit-Reviewer: KeDeng <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Martonka <[email protected]>

Reply via email to