Skip to content

Allocator-aware implementation in posix_thread leads to crashes in dynamically loaded software #1709

@EikeAtOT

Description

@EikeAtOT

We experience crashes when loading plugin code (i.e. a .dylib on macOS) into host processes that have been built against an earlier version of boost::asio.
Before ca3cabafde6fb3daf12255d721f2a8374a1991ec the implementation of posix_thread was deleting its argument before return. In the current implementation this task is performed by the thread that calls ::pthread_join .

In an environment where a host process that is compiled with an asio version before above commit loads a plugin (i.e. .dylib) that is compiled against the new version the resolution of asio_detail_posix_thread_function is ambiguous and ultimately leads to a double-free of its argument.

A simple fix is to rename the thread-entry C-function (e.g. asio_detail_posix_thread_function_v2 ).

Reproducible (at least) on macOS 26.2 with Xcode 26.2 in at least 2 commercially available host-software products.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions