Ensure SocketOptionImpl.value_.data() is pointer-size-aligned.#38707
Ensure SocketOptionImpl.value_.data() is pointer-size-aligned.#38707RyanTheOptimist merged 1 commit intoenvoyproxy:mainfrom
Conversation
pointer-size-aligned, which is expected by the ASSERT in SocketOptionImpl's constructor. Signed-off-by: Bin Wu <wub@google.com>
|
/assign @RyanTheOptimist |
|
/retest |
RyanTheOptimist
left a comment
There was a problem hiding this comment.
Wow, this is such a great CL. Thanks for doing this!
| const std::vector<uint8_t> value_; | ||
| // The vector's data() is used by the setsockopt syscall, which needs to be int-size-aligned on | ||
| // some platforms, the AlignedAllocator here makes it pointer-size-aligned, which satisfies the | ||
| // requirement, although it can be slightly over-aligned. |
There was a problem hiding this comment.
Excellent comment!
|
@wu-bin which platforms were the ASAN tests failing on? Our Android NDK version (same version YT is using) doesn't support Otherwise, Envoy Mobile won't compile unfortunately on Android.. |
|
FYI, this is the CI failure: https://github.com/envoyproxy/envoy/actions/runs/13818727995/job/38658598098 |
There have been several instances that changes, particularily to source/* directories, have introduced C++ features not supported by the Android NDK or iOS XCode version for Envoy Mobile. Without triggering the mobile Android and iOS jobs on those changes, we don't catch them until after the fact. The latest example is the std::aligned_alloc PR: envoyproxy#38707. Which introduced build errors on Android that CI didn't catch at the time of the PR and only in a subsequent PR that triggered mobile CI: https://github.com/envoyproxy/envoy/actions/runs/13818727995/job/38658598098. This change causes any changes to `source/common/` to trigger Android and iOS CI. This is a start in allowing us to catch such changes in the PR making the changes. Signed-off-by: Ali Beyad <abeyad@google.com>
envoyproxy#38707 enabled a new aligned allocator using `std::aligned_alloc`. However, `std::aligned_alloc` is not available on the Android NDK we are using for Envoy Mobile, thereby causing Envoy Mobile Android CI to fail. This PR temporarily disables the aligned allocator on Android until a more permanent solution is implemented. Signed-off-by: Ali Beyad <abeyad@google.com>
envoyproxy#38707 enabled a new aligned allocator using `std::aligned_alloc`. However, `std::aligned_alloc` is not available on the Android NDK we are using for Envoy Mobile, thereby causing Envoy Mobile Android CI to fail. This PR temporarily disables the aligned allocator on Android until a more permanent solution is implemented. Signed-off-by: Ali Beyad <abeyad@google.com>
envoyproxy#38707 enabled a new aligned allocator using `std::aligned_alloc`. However, `std::aligned_alloc` is not available on the Android NDK we are using for Envoy Mobile, thereby causing Envoy Mobile Android CI to fail. This PR temporarily disables the aligned allocator on Android until a more permanent solution is implemented. Signed-off-by: Ali Beyad <abeyad@google.com>
|
Thanks everyone for the comments! I'm able to reproduce it, I'll send a fix to use posix_memalign on the older Android versions. Edit: I just sent #38735 to use posix_memalign. |
…38733) There have been several instances that changes, particularily to source/* directories, have introduced C++ features not supported by the Android NDK or iOS XCode version for Envoy Mobile. Without triggering the mobile Android and iOS jobs on those changes, we don't catch them until after the fact. The latest example is the std::aligned_alloc PR: #38707. Which introduced build errors on Android that CI didn't catch at the time of the PR and only in a subsequent PR that triggered mobile CI: https://github.com/envoyproxy/envoy/actions/runs/13818727995/job/38658598098. This change causes any changes to `source/common/` to trigger Android and iOS CI. This is a start in allowing us to catch such changes in the PR making the changes. Signed-off-by: Ali Beyad <abeyad@google.com>
…proxy#38707) This should fix envoyproxy#7968 for good. Commit Message: Ensure SocketOptionImpl.value_.data() is pointer-size-aligned. Additional Description: Risk Level: None Testing: Docs Changes: Release Notes: Platform Specific Features: Signed-off-by: Bin Wu <wub@google.com>
…nvoyproxy#38733) There have been several instances that changes, particularily to source/* directories, have introduced C++ features not supported by the Android NDK or iOS XCode version for Envoy Mobile. Without triggering the mobile Android and iOS jobs on those changes, we don't catch them until after the fact. The latest example is the std::aligned_alloc PR: envoyproxy#38707. Which introduced build errors on Android that CI didn't catch at the time of the PR and only in a subsequent PR that triggered mobile CI: https://github.com/envoyproxy/envoy/actions/runs/13818727995/job/38658598098. This change causes any changes to `source/common/` to trigger Android and iOS CI. This is a start in allowing us to catch such changes in the PR making the changes. Signed-off-by: Ali Beyad <abeyad@google.com>
…proxy#38707) This should fix envoyproxy#7968 for good. Commit Message: Ensure SocketOptionImpl.value_.data() is pointer-size-aligned. Additional Description: Risk Level: None Testing: Docs Changes: Release Notes: Platform Specific Features: Signed-off-by: Bin Wu <wub@google.com>
…nvoyproxy#38733) There have been several instances that changes, particularily to source/* directories, have introduced C++ features not supported by the Android NDK or iOS XCode version for Envoy Mobile. Without triggering the mobile Android and iOS jobs on those changes, we don't catch them until after the fact. The latest example is the std::aligned_alloc PR: envoyproxy#38707. Which introduced build errors on Android that CI didn't catch at the time of the PR and only in a subsequent PR that triggered mobile CI: https://github.com/envoyproxy/envoy/actions/runs/13818727995/job/38658598098. This change causes any changes to `source/common/` to trigger Android and iOS CI. This is a start in allowing us to catch such changes in the PR making the changes. Signed-off-by: Ali Beyad <abeyad@google.com>
This should fix #7968 for good.
Commit Message: Ensure SocketOptionImpl.value_.data() is pointer-size-aligned.
Additional Description:
Risk Level: None
Testing:
Docs Changes:
Release Notes:
Platform Specific Features: