Fix: sessiond: uninitialized bytes sent to lttng-ust
Valgrind reports:
==
3421594== Thread 9 UST registratio:
==
3421594== Syscall param sendmsg(msg.msg_iov[0]) points to uninitialised byte(s)
==
3421594== at 0x4DCA12D: __libc_sendmsg (sendmsg.c:28)
==
3421594== by 0x4DCA12D: sendmsg (sendmsg.c:25)
==
3421594== by 0x4B6BDE2: ustcomm_send_unix_sock (ustcomm.c:323)
==
3421594== by 0x4B31549: lttng_ust_ctl_send_counter_data_to_ust (ustctl.c:3167)
==
3421594== by 0x18E8D8: send_counter_data_to_ust(ust_app*, lttng_ust_abi_object_data*) (event-notifier-error-accounting.cpp:535)
==
3421594== by 0x18EDE4: event_notifier_error_accounting_register_app(ust_app*) (event-notifier-error-accounting.cpp:647)
==
3421594== by 0x1AA796: ust_app_setup_event_notifier_group(ust_app*) (ust-app.cpp:4252)
==
3421594== by 0x184AC1: thread_dispatch_ust_registration(void*) (dispatch.cpp:420)
==
3421594== by 0x178192: launch_thread(void*) (thread.cpp:68)
==
3421594== by 0x4DBE608: start_thread (pthread_create.c:477)
==
3421594== by 0x4EF8162: clone (clone.S:95)
==
3421594== Address 0x6f3e2fc is 28 bytes inside a block of size 192 alloc'd
==
3421594== at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==
3421594== by 0x4B2BC3F: zmalloc (macros.h:23)
==
3421594== by 0x4B2BC3F: lttng_ust_ctl_duplicate_ust_object_data (ustctl.c:1332)
==
3421594== by 0x18ED4F: event_notifier_error_accounting_register_app(ust_app*) (event-notifier-error-accounting.cpp:638)
==
3421594== by 0x1AA796: ust_app_setup_event_notifier_group(ust_app*) (ust-app.cpp:4252)
==
3421594== by 0x184AC1: thread_dispatch_ust_registration(void*) (dispatch.cpp:420)
==
3421594== by 0x178192: launch_thread(void*) (thread.cpp:68)
==
3421594== by 0x4DBE608: start_thread (pthread_create.c:477)
==
3421594== by 0x4EF8162: clone (clone.S:95)
==
3421594== Uninitialised value was created by a stack allocation
==
3421594== at 0x18DCF3: ust_error_accounting_entry_create(ust_app const*) (event-notifier-error-accounting.cpp:377)
The underflow/overflow indices are left uninitialized and are ultimately
sent.
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I6dfff2e39a8fda0e74dd874ab34be66845629069