Fix: leak of lttng-consumerd global HTs in run-as worker
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 12 Jan 2019 19:17:58 +0000 (14:17 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 21 Jan 2019 18:39:24 +0000 (13:39 -0500)
All resources allocated by the consumerd before the launch
of the run-as worker process are leaked since the run-as process
is only fork()'ed (the original process image is preserved).

Moving the launch of the worker earlier in the initialization
of the consumerd works around this problem.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-consumerd/lttng-consumerd.c

index ddd07a14279eb3e88bc93b5497e8989a08cb2b3a..5d3467c1fefbba91d117230be98c931d0974aee0 100644 (file)
@@ -311,6 +311,10 @@ int main(int argc, char **argv)
 
        rcu_register_thread();
 
+       if (run_as_create_worker(argv[0], NULL, NULL) < 0) {
+               goto exit_set_signal_handler;
+       }
+
        if (set_signal_handler()) {
                retval = -1;
                goto exit_set_signal_handler;
@@ -411,10 +415,6 @@ int main(int argc, char **argv)
                set_ulimit();
        }
 
-       if (run_as_create_worker(argv[0], NULL, NULL) < 0) {
-               goto exit_init_data;
-       }
-
        /* create the consumer instance with and assign the callbacks */
        ctx = lttng_consumer_create(opt_type, lttng_consumer_read_subbuffer,
                NULL, lttng_consumer_on_recv_stream, NULL);
This page took 0.026891 seconds and 4 git commands to generate.