From: Jonathan Rajotte Date: Mon, 10 Jan 2022 22:27:13 +0000 (-0500) Subject: Fix: lttng-ctl: erroneous uses of LTTNG_PACKED X-Git-Tag: v2.12.9~32 X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;h=bad7720255c69c06010ccec2a8f6fedf3387e51d;hp=bad7720255c69c06010ccec2a8f6fedf3387e51d;p=lttng-tools.git 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 Signed-off-by: Jérémie Galarneau ---