Fix: lttng-ctl: erroneous uses of LTTNG_PACKED
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 10 Jan 2022 22:27:13 +0000 (17:27 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 28 Feb 2022 22:12:03 +0000 (17:12 -0500)
commitbad7720255c69c06010ccec2a8f6fedf3387e51d
tree270c391c20b46778c8462b743de05865096a132f
parent179ad61c39b5164f2b9f48f355fc1ad3ec73c8a4
Fix: lttng-ctl: erroneous uses of LTTNG_PACKED

The LTTNG_PACKED macro uses gcc attributes to indicate that a structure
should be packed. Hence, this macro obeys the same rules as the gcc
attribute.

Various mis-uses of the LTTNG_PACKED macros may result in structure not
being packed:
  - The LTTNG_PACKED macro should always be placed _before_ an identifier
    when a structure is declared in-place.
  - Adding LTTNG_PACKED at the definition site has no effect if the
    structure was declared elsewhere.

Those mis-uses cause issues when mixing the bitness (32/64) of the
session daemon and liblttng-ctl.

Outstanding issues include the following structures that are not
tagged as LTTNG_PACKED:
  - struct lttng_event
  - struct lttng_channel
  - struct lttng_event_context

Unfortunately, those structures are exposed by the public API and
can't be tagged as being "packed". Doing so would break the ABI
of liblttng-ctl.

These structures should be packed/unpacked explicitly.

JORAJ CHERRY PICK: Change-Id: I095dc0dffc6bf9e15dc7a7ec797958a5780ef150

Change-Id: I33f026a613813af312de65adee23ac829a071cf8
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/lttng/session-internal.h
include/lttng/snapshot-internal.h
src/common/sessiond-comm/sessiond-comm.h
This page took 0.025783 seconds and 4 git commands to generate.