Commit 660fe65
committed
fix(bench): unblock Linux/Windows bench builds
Two independent failures in the Benchmark workflow after the Stage
10/12 tests landed:
Linux bench (gcc-14, -O3 -Werror)
-Wfree-nonheap-object fires a false positive inside
domain_hash_sha256's std::vector<uint8_t>::push_back + insert
chain. GCC 14's -O3 optimizer inlines _M_realloc_append's _Guard
destructor, loses track of the allocation's provenance, and flags
the allocator's deallocate call as "called on pointer with
nonzero offset".
Fix by rewriting the buffer construction as a single sized-vector
constructor + memcpy fills. One allocation, no push_back / insert
intermediates for the optimizer to lose track of. Functionally
identical; all 22 CborStrict tests stay green on MSVC Debug,
including the three domain-hash determinism checks.
Windows bench (MSVC, LNK2038 CRT mismatch)
The Windows job passed only `-A x64` at configure time — no
CMAKE_BUILD_TYPE. That made the Botan ExternalProject rule in
common/crypto/src/CMakeLists.txt:78-84 match its
"multi-config + CMAKE_BUILD_TYPE unset" branch and default Botan
to --msvc-runtime=MDd (Debug CRT). The later
`cmake --build --config Release` step compiled bench_main with
MD (Release CRT), producing a link-time CRT mismatch against the
Debug Botan archive.
Not a cache issue — deleting the cache reproduced the same wrong
Botan config on every fresh configure. Fix at the workflow level
(the correct idiom anyway): pass CMAKE_BUILD_TYPE=Release on the
Windows bench so Botan's configure-time choice aligns with the
Release binary that links against it.
No behavior change on the test / release / debug paths that build
with explicit CMAKE_BUILD_TYPE; this only addresses the Benchmark
workflow's Windows path.1 parent 30da51d commit 660fe65
2 files changed
Lines changed: 17 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
304 | 307 | | |
305 | | - | |
| 308 | + | |
| 309 | + | |
306 | 310 | | |
307 | 311 | | |
308 | 312 | | |
| |||
0 commit comments