Commit 6c8f1e7
test(helgrind): re-anchor benign test-fixture race suppressions
The valgrind-helgrind lane went red on basic/file_upload/deferred after the
DR-014 dispatch decomposition. Every surviving report is a benign false
positive of the same family: an MHD worker thread writes test-fixture or
lazy-cache state that the main thread published via the route-table
shared_mutex at register_path() and reads back only after the HTTP round-trip
completes. Helgrind runs with --history-level=approx on this lane and cannot
observe the happens-before that flows through the socket, so it flags the
worker write against the main-thread construction/reset. Each test is
single-request (littletest is sequential), so there is no real concurrent
access; TSan and DRD (both precise) are green on all three.
The decomposition did not introduce any race -- it split dispatch into its own
TUs (request_dispatcher.cpp / request_pipeline.cpp), and the changed inlining
lifted these write frames above the pre-existing per-symbol suppressions:
* basic: print_request_resource / print_response_resource stream a
request/response into a main-stack std::stringstream via
httpserver::operator<<; the top frame is now __ostream_insert / _M_insert /
xsputn, past fun:*basic_stringstream*.
* basic: http_resource::get_allow_header caches the `Allow:` string under its
own shared_mutex (exclusive-lock writer, double-checked); the constructor's
default-init on the main thread is the only unsynchronised touch and it
happens-before publication. Same benign class as the existing
get_allowed_methods / method_set entries.
* file_upload: print_file_upload_resource::render_post assigns a std::string
member (content = req.get_content()); top frame char_traits::assign, past
fun:*basic_string*.
* deferred: the deferred-body producer increments a file-scope `counter` in
test_callback on the worker, reset by the main thread between tests.
Re-anchor each on the exact test-fixture handler symbol (never a libhttpserver
locking frame), so a genuine library race stays unsuppressed per DR-008.
Suppression-file-only change; helgrind is Linux/valgrind-only and validated in
CI. memcheck and drd are unaffected.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015tAodxYJMEY4VxCX4dk62e1 parent 4ae4fd9 commit 6c8f1e7
1 file changed
Lines changed: 69 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
254 | 323 | | |
255 | 324 | | |
256 | 325 | | |
| |||
0 commit comments