Fix: liblttng-ctl comm: lttng_event_context is not packed
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 12 Jan 2022 23:18:08 +0000 (18:18 -0500)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 25 Feb 2022 15:35:09 +0000 (10:35 -0500)
commita4a3d6bd4a06e907f9cec07456f42ab08d59829a
tree41e028c5626ca0fa1ec3736f122c61be44d8c69f
parentfe5e9e652b42a7fc4a9aecd0c392370b3c9722d6
Fix: liblttng-ctl comm: lttng_event_context is not packed

Observed issue
==============

The size of the struct differs between bitness for x86-64 and x86
leading to serialization/deserialization problem across client
(liblttng-ctl) and lttng-sessiond.

sizeof(struct lttng_event_context):

  x86: 308
  x86-64: 312

The struct cannot be marked as LTTNG_PACKED since it is part of the API.

Solution
========

Adopt a similar pattern to the new API with a "serialize" &
"create_from_buffer" approach.

Most of the complexity is moved to `src/common/event.c`

Known drawbacks
=========

None.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ieb400eab2a2df4070ff51cb2b44929d3ea945ce4
include/lttng/event-internal.h
src/bin/lttng-sessiond/client.c
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/cmd.h
src/bin/lttng-sessiond/context.c
src/bin/lttng-sessiond/context.h
src/common/event.c
src/common/sessiond-comm/sessiond-comm.h
src/lib/lttng-ctl/lttng-ctl.c
This page took 0.026485 seconds and 4 git commands to generate.