From c6e720fd71b70d6d55c5895689255d66d21e5f8e Mon Sep 17 00:00:00 2001 From: seanjin99 Date: Fri, 13 Mar 2026 12:06:01 -0400 Subject: [PATCH] Fix bus error in testConcurrentRsa on 32-bit ARM Remove __attribute__((aligned(32))) from RsaArgs struct. On 32-bit ARM, std::vector uses malloc which only guarantees 8-byte alignment, but the aligned(32) attribute requires 32-byte alignment. When the vector reallocates, elements may not be 32-byte aligned, causing bus errors due to strict alignment enforcement. This fixes test failures 1078-1079 (testConcurrentRsa) that crash with 'Bus error (core dumped)' when run individually on 32-bit ARM. UBSan output showed: runtime error: reference binding to misaligned address 0x0100f990 for type 'struct RsaArgs', which requires 32 byte alignment The alignment attribute was unnecessary - RSA operations don't require 32-byte alignment, and similar struct Vendor128Args in the same file correctly uses NOLINT comment instead of forcing alignment. --- test/main/cpp/concurrent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/main/cpp/concurrent.cpp b/test/main/cpp/concurrent.cpp index cd3433c..78ddc03 100644 --- a/test/main/cpp/concurrent.cpp +++ b/test/main/cpp/concurrent.cpp @@ -1,5 +1,5 @@ /** - * Copyright 2020 Comcast Cable Communications Management, LLC + * Copyright 2020-2026 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,7 +78,7 @@ struct RsaArgs { TestKc kc; Sec_Result result; -} __attribute__((aligned(32))); +}; void* concurrent_rsa(void* arg) { auto* args = static_cast(arg);