Commit 47c3747
valgrind/helgrind: suppress libstdc++ _Sp_locker atomic<shared_ptr> FP
Run 29304424198 (3d6cf0b) drove helgrind from 168 residual errors down to a
single one, and confirmed drd fully green (the MHD poll-listen `...` +
MHD_queue_response frames landed). The lone remaining helgrind report is a
libstdc++ atomic-shared-ptr false positive, not a libhttpserver locking race:
Possible data race during read of size 8 ...
std::_Sp_locker::_Sp_locker
std::atomic_load_explicit<resource_hook_table>(shared_ptr*)
httpserver::ensure_table (http_resource.cpp:96)
httpserver::http_resource::add_hook (http_resource.cpp:214)
ensure_table() uses the correct lock-free idiom — atomic_load_explicit(acquire)
plus atomic_compare_exchange_strong_explicit(acq_rel) — so every concurrent
access to hook_table_ goes through the std::atomic_* free functions. libstdc++
implements those with an internal _Sp_locker spinlock whose happens-before
Helgrind cannot model (same blind spot as the _Sp_counted_base::_M_release entry
already suppressed). TSan, which models the atomics precisely, is green on this
same test — corroborating it is a detector artifact. Matched on the third-party
_Sp_locker frame (never the libhttpserver caller): a genuinely unsynchronised
shared_ptr access would surface a non-_Sp_locker frame and stay unsuppressed, so
DR-008 is preserved. Mirrored into the drd supp for symmetry/future-proofing
(drd did not flag it this run).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NpysYDDJac63yz2mZKKiDf1 parent 3d6cf0b commit 47c3747
2 files changed
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
85 | 100 | | |
86 | 101 | | |
87 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
82 | 102 | | |
83 | 103 | | |
84 | 104 | | |
| |||
0 commit comments