Fix: application SIGBUS when starting in parallel with sessiond
authorDavid Goulet <dgoulet@efficios.com>
Wed, 6 Nov 2013 15:49:43 +0000 (10:49 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Wed, 6 Nov 2013 15:50:26 +0000 (10:50 -0500)
commit11e2c71ab5db9f95fcd7cc8e2a5489b73e95d5d8
tree7f25c616af32070c5f6eeed3160bc874e80f39e4
parentcaa259718045b322d161773d3f531be8a4c5322c
Fix: application SIGBUS when starting in parallel with sessiond

There is a race between application startup and sessiond startup, where there
is an intermediate state where applications can SIGBUS if they see a zero-sized
shm, if the shm has been created, but not ftruncated yet.

On the sessiond side, we need to ensure that the shared memory is writeable by
applications as long as its size is 0, which allow applications to perform
ftruncate and extend its size.

On the UST side, another commit needs to ensure that UST can read the shared
memory file descriptor with a read() system call before they try accessing it
through a memory map (which triggers the SIGBUS if the access goes beyond the
file size)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/shm.c
This page took 0.02528 seconds and 4 git commands to generate.