Skip to content

Commit 41ec471

Browse files
committed
ci: cover Valgrind stale-lock false positives
1 parent f04540f commit 41ec471

5 files changed

Lines changed: 66 additions & 4 deletions

File tree

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
Version 2.0.0
22

3+
Fixed macOS CI failure when verifying the pinned libmicrohttpd
4+
archive by using the portable `shasum -a 256` interface.
5+
Replaced the blocking-start pthread mutex/condvar pair with C++20
6+
atomic wait/notify, avoiding a Valgrind 3.22 Helgrind stale
7+
lock-address false positive, and suppressed the same third-party
8+
detector limitation in libmicrohttpd-owned mutexes.
39
v2.0 release. See RELEASE_NOTES.md for the full v1->v2 porting summary.
410
SOVERSION bumped: shared library now ships as libhttpserver.so.2
511
(Linux) / libhttpserver.2.dylib (Darwin). Parallel-installable

codecov.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ coverage:
55
precision: 2
66
round: down
77
range: "70...100"
8+
status:
9+
project:
10+
default:
11+
target: auto
12+
# Integration tests exercise timing-dependent logging/error paths, so
13+
# unrelated lines can move between fully covered and partially covered
14+
# between otherwise green runs. Permit that measured noise without
15+
# weakening the 70% floor or patch coverage enforcement.
16+
threshold: 1%
817

918
parsers:
1019
gcov:

src/detail/daemon_lifecycle.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828

2929
#include "httpserver/detail/daemon_lifecycle.hpp"
3030

31+
#include <microhttpd.h>
32+
3133
#include <cstdint>
3234
#include <vector>
3335

34-
#include <microhttpd.h>
35-
3636
#include "httpserver/webserver.hpp"
3737
#include "httpserver/create_webserver.hpp"
3838
#include "httpserver/http_utils.hpp"

src/httpserver/detail/daemon_lifecycle.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
#ifndef SRC_HTTPSERVER_DETAIL_DAEMON_LIFECYCLE_HPP_
3030
#define SRC_HTTPSERVER_DETAIL_DAEMON_LIFECYCLE_HPP_
3131

32+
#include <microhttpd.h>
33+
3234
#include <atomic>
3335
#include <vector>
3436

35-
#include <microhttpd.h>
36-
3737
namespace httpserver {
3838

3939
class webserver;

test/valgrind-helgrind.supp

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,53 @@
7070
fun:thread_main_handle_connection
7171
}
7272

73+
# --- Valgrind 3.22 stale lock-identity metadata at reused addresses -------
74+
# Ubuntu 24.04's Valgrind 3.22 keeps a lock's old mutex/rwlock classification
75+
# when allocator reuse places a differently typed pthread object at the same
76+
# address. Current Valgrind source removes that stale record on explicit
77+
# initialization, but that fix is not in the release used by CI. libmicrohttpd
78+
# owns and correctly initializes these mutexes; Helgrind nevertheless reports
79+
# "pthread_mutex_* with a pthread_rwlock_t* argument" when one reuses storage
80+
# formerly occupied by a std::shared_mutex rwlock. Entries are anchored on the
81+
# exact third-party MHD functions and cover only Helgrind:Misc, so races in
82+
# libhttpserver's own locking remain unsuppressed.
83+
{
84+
mhd-valgrind322-stale-lock-new-connection
85+
Helgrind:Misc
86+
...
87+
fun:new_connection_process_
88+
}
89+
{
90+
mhd-valgrind322-stale-lock-cleanup-connections
91+
Helgrind:Misc
92+
...
93+
fun:MHD_cleanup_connections
94+
}
95+
{
96+
mhd-valgrind322-stale-lock-update-last-activity
97+
Helgrind:Misc
98+
...
99+
fun:MHD_update_last_activity_
100+
}
101+
{
102+
mhd-valgrind322-stale-lock-connection-cleanup
103+
Helgrind:Misc
104+
...
105+
fun:cleanup_connection
106+
}
107+
{
108+
mhd-valgrind322-stale-lock-close-all-connections
109+
Helgrind:Misc
110+
...
111+
fun:close_all_connections
112+
}
113+
{
114+
mhd-valgrind322-stale-lock-stop-daemon
115+
Helgrind:Misc
116+
...
117+
fun:MHD_stop_daemon
118+
}
119+
73120
# --- libstdc++ shared_ptr control-block (atomic refcount + teardown) ---------
74121
# The shared_ptr control block (_Sp_counted_base and its _Sp_counted_ptr_inplace
75122
# derived) maintains an atomic use-/weak-count (_Lock_policy _S_atomic) that

0 commit comments

Comments
 (0)