Skip to content

AddressSanitizer: misaligned access in setsockopt() #7968

@PiotrSikora

Description

@PiotrSikora

Description:

The argument passed to setsockopt() is not properly aligned, which ASan complains about when linked against libc++.

Repro steps:

bazel test --config=clang-asan --config=libc++ //test/...

Logs:

This is a list of tests that fail because of this failure:

//test/common/network:addr_family_aware_socket_option_impl_test          FAILED
//test/common/network:socket_option_factory_test                         FAILED
//test/common/network:socket_option_impl_test                            FAILED
//test/common/upstream:cluster_manager_impl_test                         FAILED
//test/config_test:example_configs_test                                  FAILED
//test/server:listener_manager_impl_test                                 FAILED

Call Stack:

[ RUN      ] AddrFamilyAwareSocketOptionImplTest.SetOptionSuccess
test/common/network/socket_option_test.h:45:15: runtime error: reference binding to misaligned address 0x60700001e899 for type 'const int', which requires 4 byte alignment
0x60700001e899: note: pointer points here
 00 00 00  08 01 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  b9 96 6e cc 00
              ^

cc @lizan

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions