Actions
Bug #14268
openHeap-use-after-free in `http_server_clean_close` test
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
01/20/2026
Due date:
% Done:
0%
Estimated time:
Description
Problem¶
A heap-use-after-free crash was identified in the test.http executable, specifically in the http_server_clean_close test case when running it multiple times (floating bug) on Ubuntu 24.04 with AddressSanitizer (ASan) enabled.
Probably, the root Cause¶
The crash occurs during server shutdown in http::server::Server::handleStop().
handleStop()callstcp_listeners_.clear(), which destroys theTcpListenerobjects.- Each
TcpListenerowns anew_connection(TcpConnectionPtr), which in turn owns anasio::ip::tcp::socket. - However, an asynchronous
async_accept()operation might still be pending on that socket. - When
asioattempts to cancel the pending operation (due to the acceptor closing), it accesses the socket object that has already been freed.
ASan Trace Highlights¶
- Freed by:
http::server::TcpConnection::~TcpConnection()called viatcp_listeners_.clear()inServer::handleStop(). - Read (UAF):
boost::asio::detail::io_object_impl<...>::get_service()within the asio accept completion chain.
How to Reproduce¶
- Was reproduced on current master and on 4.10.3
- Use an environment with Ubuntu 24.04.
- Build
wtwith tests and ASan enabled:cmake -DBUILD_TESTS=ON -DCMAKE_CXX_FLAGS="-fsanitize=address" ... make - Run the specific test case under stress:
for i in {1..100}; do ./test.http --run_test=http_server_clean_close || break; doneThe crash usually occurs within 20 iterations.
No data to display
Actions