Skip to content

let EXTRA_CXXFLAGS override -fsanitize=address in test/Makefile - #2577

Merged
yhirose merged 1 commit into
yhirose:masterfrom
avionicharshit-byte:fix/allow-disabling-asan-in-tests
Sep 3, 2026
Merged

let EXTRA_CXXFLAGS override -fsanitize=address in test/Makefile#2577
yhirose merged 1 commit into
yhirose:masterfrom
avionicharshit-byte:fix/allow-disabling-asan-in-tests

Conversation

@avionicharshit-byte

@avionicharshit-byte avionicharshit-byte commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

the test suite cannot start on arm64 linux kernels built with a 39 bit virtual address space, raspberry pi os included. asan maps its allocator at a fixed 0x500000000000, the top user address there is 0x8000000000, so it aborts before the first test:

AddressSanitizer: CHECK failed: sanitizer_allocator_primary64.h:131 "((kSpaceBeg)) == ((address_range.Init(TotalSpaceSize, PrimaryAllocatorName, kSpaceBeg)))" (0x500000000000, 0xfffffffffffffff4)

there is no way to opt out today. EXTRA_CXXFLAGS sits before -fsanitize=address in CXXFLAGS, so -fno-sanitize=address loses. this moves $(EXTRA_CXXFLAGS) to the end. existing ci uses are unaffected, -m32 and -fno-exceptions are position independent and -std=c++17 already relies on last wins.

verified on a raspberry pi 4, aarch64, gcc 14.2.0. make CXX=g++ EXTRA_CXXFLAGS=-fno-sanitize=address test builds with zero warnings under the existing warning set, and the suite runs:

846 tests from 162 test suites ran
[  PASSED  ] 842 tests
[  SKIPPED ] 4 tests

the skips are environmental, 3 want CPPHTTPLIB_TEST_ISSUE_2431 and a sinkhole dns, 1 wants a comma decimal locale that is not installed.

this fixes nothing in httplib.h, arm64 and gcc both look clean.

@avionicharshit-byte
avionicharshit-byte marked this pull request as ready for review September 2, 2026 18:47
@avionicharshit-byte

Copy link
Copy Markdown
Contributor Author

the abi failure here isnt from this pr, its a one line reorder in test/Makefile with no library changes

abidiff builds against the last tag, which is v0.54.1, and 7d53a31 (#2575) added a Response param to
detail::encoding_type and Server::static_file_encoding after that tag was cut

master's own push run for that commit is red for the same two symbols
https://github.com/yhirose/cpp-httplib/actions/runs/33455962542

@yhirose
yhirose merged commit 9e2e33d into yhirose:master Sep 3, 2026
26 of 27 checks passed
@yhirose

yhirose commented Sep 3, 2026

Copy link
Copy Markdown
Owner

@avionicharshit-byte thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants