Actions
Bug #11408
closedConcurrency issues that thread sanitizer found
Start date:
03/07/2023
Due date:
% Done:
100%
Estimated time:
Description
Running test.http
with thread sanitizer yields a few issues:
Wt::Http::Client
: concurrent reads and writes of theimpl_
weak_ptr
:abort()
can be called concurrently withemitDone()
, andabort()
callsimpl_.lock()
whileemitDone
reset()
s it. Since we don't have astd::atomic<std::weak_ptr<...>>
in C++14 we should probably guard it with a mutex. (Note: while the reference count itself is atomic for ashared_ptr
andweak_ptr
, the operations on a specificweak_ptr
are NOT atomic.) (log 1)Wt::Http::ResponseContinuation
: concurrent reads and writes towaiting_
:haveMoreData()
readswaiting_
whilewaitForMoreData()
writes to itResponseContinuation::resource_
is read inhaveMoreData()
(while we have a lock onmutex_
), whileResponse::createContinuation()
may write to it (log 1)WebController
: concurrent reads and writes torunning_
: whenWServer::stop()
is calledrunning_
is set tofalse
(mutex_
is locked there).handleRequest
andrequestDataReceived
checkrunning_
without lockingmutex_
. Either we need to add an appropriate lock when checkingrunning_
, orrunning_
should be turned into anstd::atomic_bool
.http_client_server_test4
checksisDone()
, which readsdone_
without a lock, whileonDone
may be writing to it. We can grab thedoneMutex_
when checkingisDone()
. (log 1)- Signal-related races that I think might be test-specific. (log 1)
Files
Updated by Roel Standaert over 1 year ago
- Related to Bug #11301: test.http server race can result in use-after-free added
Updated by Roel Standaert over 1 year ago
- Related to Bug #11302: Race when closing HTTP listening sockets can result in use-after-free added
Updated by Matthias Van Ceulebroeck over 1 year ago
- Target version changed from 4.10.0 to 4.10.1
Updated by Matthias Van Ceulebroeck over 1 year ago
- Status changed from New to InProgress
- Assignee set to Matthias Van Ceulebroeck
Updated by Matthias Van Ceulebroeck over 1 year ago
- Status changed from InProgress to Review
- Assignee deleted (
Matthias Van Ceulebroeck)
Updated by Matthias Van Ceulebroeck over 1 year ago
- Assignee set to Marnik Roosen
Updated by Matthias Van Ceulebroeck over 1 year ago
- Status changed from Review to Implemented @Emweb
- Assignee changed from Marnik Roosen to Matthias Van Ceulebroeck
Updated by Matthias Van Ceulebroeck over 1 year ago
- % Done changed from 0 to 100
Updated by Matthias Van Ceulebroeck about 1 year ago
- Status changed from Implemented @Emweb to Closed
Actions