mcc0nnell opened a new pull request, #847: URL: https://github.com/apache/celix/pull/847
Fixes #708. BufferedPushStream can execute nextEvent on its worker thread while another call to forEach() replaces that consumer. Replacing the stored std::function can destroy the previous callback while it is still in flight, resulting in the use-after-free reported by ASan. This change makes the current consumer a shared_ptr and uses atomic load/store operations so each event invocation keeps a stable snapshot of the consumer for the duration of the callback. It also adds a deterministic regression test that: * blocks the first consumer while it is executing; * replaces it with a second consumer; * releases the first callback; * verifies both consumers receive the expected events without invalidating the in-flight callback. The existing Ubuntu CI matrix passes with GCC and Clang, including the ASan/UBSan-enabled Conan builds. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
