From: Mathieu Desnoyers Date: Mon, 19 Feb 2024 18:28:53 +0000 (-0500) Subject: Document application fork/clone vs statedump locking limitations X-Git-Url: http://git.efficios.com/?p=libside.git;a=commitdiff_plain;h=8fc4ab8303b941e858af680c27c9e2e47fe45df9 Document application fork/clone vs statedump locking limitations Signed-off-by: Mathieu Desnoyers --- 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,