From: Jonathan Rajotte Date: Fri, 8 Mar 2019 15:01:12 +0000 (-0500) Subject: Move wait_shm_mmap initialization to library constructor X-Git-Tag: v2.12.0-rc1~54 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=060577e34998f721439135e8fc533a0e52d98ff1;hp=060577e34998f721439135e8fc533a0e52d98ff1;p=lttng-ust.git Move wait_shm_mmap initialization to library constructor Prevent us from deadlocking ourself if some glibc implementation decide to hold the dl_load_* locks on fork operation. This happens on Yocto Rocko and up when performing python tracing (import lttngust). Why Yocto decided to patch glibc this way is a mystery (ongoing effort) [1][2][3]. Anyhow, we can prevent this by moving the initialization of the wait_shm_mmap to the library constructor since the dl_load_* locks are nestable mutex. Nothing in the git log for the wait_shm_mmap indicate a specific reason to why it was done inside the listener thread. Doing it inside wait_for_sessiond can help in some corner cases were /dev/shm (or the shm path) files are unlinked. This is not much of an advantage. [1] From yocto master branch: ee9db1a9152e8757ce4d831ff9f4472ff5a57dad [2] From OE-Core: f2e586ebf59a9b7d5b216fc92aeb892069a4b0c1 [3] https://www.mail-archive.com/openembedded-core@lists.openembedded.org/msg101186.html This was tested on a Yocto Rocko qemu x86-64 image with python agent enabled. Signed-off-by: Jonathan Rajotte Signed-off-by: Mathieu Desnoyers ---