uhd/host/lib/deps
Lars Amsel 12eae2d365 Host: RPC: Fix double free in rpclib call function
During tests with the reinitialization of the MPM, we discovered that the
USRP session sometimes ended with an access violation. The root cause was
a call to reset_timer_and_mgr, which was sent using notify_with_token
from the rpclib. This function internally performs a notify, which
itself makes a call. The call invokes the function as an async_call and
subsequently attempts to retrieve the result of the future from the
async_call, provided no timeout occurs.

The issue arose because the call did not use rvalue references for the
variadic array. As a result, the variadic array values were copied during
the call and then deallocated afterward. However, the rpclib also retained
a pointer to the variadic array, which led to a double free after the
async_call completed. The problem became evident when the memory
management code enabled heap protection (e.g., the ucrtd.dll on Windows,
which writes hex-D into unallocated memory). In most other cases, these
regions are initialized to 0, and freeing a 0 pointer is effectively a
no-op.

The fix introduces lvalue passing of the variadic array in the call
function, which prevents double free errors. This change ensures that the
callee no longer frees the array. The fix has also been applied to
async_call and send.
2025-12-10 13:14:58 +01:00
..
flatbuffers lib: deps: Ignore more warnings in our versions of rpclib, pybind11 2021-03-04 08:24:28 -06:00
pybind11 python: update to pybind11 for Python 3.11 2022-08-22 12:45:38 -05:00
rpclib Host: RPC: Fix double free in rpclib call function 2025-12-10 13:14:58 +01:00
0001-rpclib-replace-fmt-with-boost-format-but-leave-it-in.patch uhd: add cut-down rpclib source tree and import tool 2017-12-22 15:03:45 -08:00
0002-rpclib-use-the-real-boost-asio-namespace.patch uhd: add cut-down rpclib source tree and import tool 2017-12-22 15:03:45 -08:00
0003-rpclib-add-boost-system-error_code-and-include-rpc-c.patch uhd: add cut-down rpclib source tree and import tool 2017-12-22 15:03:45 -08:00
0004-rpclib-fix-hang-on-connection-error-during-construct.patch rpclib: add patch file for constructor hang 2019-10-15 08:13:45 -07:00
CMakeLists.txt python: pybind: Bump min pybind11 version to 2.7 (default on Ubuntu 22) 2024-06-11 10:20:08 +02:00
import_rpclib.py deps: rpclib: Replace distutils.dir_util with shutil 2022-01-14 14:36:39 -06:00
rpc_CMakeLists.txt cmake: Update coding style to use lowercase commands 2018-11-14 14:10:09 -08:00