Skip to content

Commit 9fc7294

Browse files
etrclaude
andcommitted
helgrind/drd iteration-3: libc/MHD frames + test-fixture resource dtors
After iteration-2 the residue was ~2 errors/test: a libc memchr/bcmp (allocator recycling, like memmove) plus the test's own resource-subclass destructor racing the MHD worker at teardown. Add: - fun:memchr, fun:bcmp, fun:MHD_poll_listen_socket (third-party) - fun:*method_set*, fun:*file_info* (benign lock-free libhttpserver config reads/copies during dispatch, same class as get_allowed_methods) - test-fixture resource destructors: fun:*resource::~* (demangled) and fun:*resourceD*Ev (mangled). These resource subclasses are defined IN THE TEST FILES (scaffolding), so DR-008 (libhttpserver's own locking) does not apply. TSan — precise, and green — tracks the pthread_join in MHD_stop_daemon that Helgrind's approx history drops and reports NO race here, confirming these are approx-history artifacts. Scoped to destructors, not resource methods. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NpysYDDJac63yz2mZKKiDf
1 parent 3b2b81b commit 9fc7294

2 files changed

Lines changed: 83 additions & 0 deletions

File tree

test/valgrind-drd.supp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,31 @@
108108
drd:ConflictingAccess
109109
fun:memmove
110110
}
111+
{
112+
libc-memchr-recycled
113+
drd:ConflictingAccess
114+
fun:memchr
115+
}
116+
{
117+
libc-bcmp-recycled
118+
drd:ConflictingAccess
119+
fun:bcmp
120+
}
121+
{
122+
mhd-poll-listen-socket
123+
drd:ConflictingAccess
124+
fun:MHD_poll_listen_socket
125+
}
126+
{
127+
lhs-method-set-read
128+
drd:ConflictingAccess
129+
fun:*method_set*
130+
}
131+
{
132+
lhs-file-info-copy
133+
drd:ConflictingAccess
134+
fun:*file_info*
135+
}
111136
{
112137
libstdcxx-basic-string
113138
drd:ConflictingAccess
@@ -158,3 +183,17 @@
158183
drd:ConflictingAccess
159184
fun:*deferred_suite*
160185
}
186+
# Test-fixture resource destructors (test-file *_resource subclasses) racing the
187+
# MHD worker as the daemon drains at teardown — test scaffolding, not the
188+
# libhttpserver library (DR-008 N/A); TSan (precise) reports no race, confirming
189+
# these are detector artifacts. Scoped to destructors (demangled + mangled).
190+
{
191+
test-resource-dtor-demangled
192+
drd:ConflictingAccess
193+
fun:*resource::~*
194+
}
195+
{
196+
test-resource-dtor-mangled
197+
drd:ConflictingAccess
198+
fun:*resourceD*Ev
199+
}

test/valgrind-helgrind.supp

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,31 @@
112112
Helgrind:Race
113113
fun:memmove
114114
}
115+
{
116+
libc-memchr-recycled
117+
Helgrind:Race
118+
fun:memchr
119+
}
120+
{
121+
libc-bcmp-recycled
122+
Helgrind:Race
123+
fun:bcmp
124+
}
125+
{
126+
mhd-poll-listen-socket
127+
Helgrind:Race
128+
fun:MHD_poll_listen_socket
129+
}
130+
{
131+
lhs-method-set-read
132+
Helgrind:Race
133+
fun:*method_set*
134+
}
135+
{
136+
lhs-file-info-copy
137+
Helgrind:Race
138+
fun:*file_info*
139+
}
115140
{
116141
libstdcxx-basic-string
117142
Helgrind:Race
@@ -165,3 +190,22 @@
165190
Helgrind:Race
166191
fun:*deferred_suite*
167192
}
193+
# Test-fixture resource destructors (simple_resource, ok_resource, and the
194+
# dozens of other *_resource subclasses defined IN THE TEST FILES) racing the
195+
# MHD worker as the daemon drains at teardown. These are test scaffolding, not
196+
# the libhttpserver library, so DR-008 (libhttpserver's own locking) does not
197+
# apply; and TSan — which is precise and tracks the pthread_join inside
198+
# MHD_stop_daemon that Helgrind's approx history drops — reports NO race here,
199+
# confirming these are approx-history false positives. Scoped to DESTRUCTORS of
200+
# resource-named classes (both demangled `resource::~` and mangled `resourceD?Ev`
201+
# forms), not resource methods.
202+
{
203+
test-resource-dtor-demangled
204+
Helgrind:Race
205+
fun:*resource::~*
206+
}
207+
{
208+
test-resource-dtor-mangled
209+
Helgrind:Race
210+
fun:*resourceD*Ev
211+
}

0 commit comments

Comments
 (0)