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()whileemitDonereset()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_ptrandweak_ptr, the operations on a specificweak_ptrare 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).handleRequestandrequestDataReceivedcheckrunning_without lockingmutex_. Either we need to add an appropriate lock when checkingrunning_, orrunning_should be turned into anstd::atomic_bool.http_client_server_test4checksisDone(), which readsdone_without a lock, whileonDonemay 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 almost 3 years ago
- Related to Bug #11301: test.http server race can result in use-after-free added
Updated by Roel Standaert almost 3 years ago
- Related to Bug #11302: Race when closing HTTP listening sockets can result in use-after-free added
Updated by Matthias Van Ceulebroeck over 2 years ago
- Target version changed from 4.10.0 to 4.10.1
Updated by Matthias Van Ceulebroeck over 2 years ago
- Status changed from New to InProgress
- Assignee set to Matthias Van Ceulebroeck
Updated by Matthias Van Ceulebroeck over 2 years ago
- Status changed from InProgress to Review
- Assignee deleted (
Matthias Van Ceulebroeck)
Updated by Matthias Van Ceulebroeck over 2 years ago
- Assignee set to Marnik Roosen
Updated by Matthias Van Ceulebroeck over 2 years ago
- Status changed from Review to Implemented @Emweb
- Assignee changed from Marnik Roosen to Matthias Van Ceulebroeck
Updated by Matthias Van Ceulebroeck over 2 years ago
- % Done changed from 0 to 100
Updated by Matthias Van Ceulebroeck about 2 years ago
- Status changed from Implemented @Emweb to Closed
Actions