From 8fc4ab8303b941e858af680c27c9e2e47fe45df9 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 19 Feb 2024 13:28:53 -0500 Subject: [PATCH] Document application fork/clone vs statedump locking limitations Signed-off-by: Mathieu Desnoyers --- include/side/trace.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/side/trace.h b/include/side/trace.h index 53d5df8..647748e 100644 --- a/include/side/trace.h +++ b/include/side/trace.h @@ -169,6 +169,12 @@ void side_statedump_call_variadic(const struct side_event_state *state, * instrumentation of multi-threaded applications which rely on * locking to synchronize their data structures across threads, and * for libraries which have no control on application event loops. + * + * Applications using fork/clone with locks held should not take those + * locks (or block on any resource that depend on these locks) within + * their statedump callbacks registered with the agent thread. This + * could result in deadlocks when pthread_atfork handler waits for + * agent thread quiescence. */ enum side_statedump_mode { SIDE_STATEDUMP_MODE_POLLING, -- 2.34.1