Fix: lttng-ctl: erroneous uses of LTTNG_PACKED
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 13 Oct 2020 18:55:33 +0000 (14:55 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 13 Oct 2020 19:43:26 +0000 (15:43 -0400)
commit7bd95aee4660c6419a4a65429fc27754481e7e90
treedd2b3bf5be967663c4d0368fd2eaa20f83542340
parentf28ecb10121fd234be3cc473196ae058bc5a7ca7
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.

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