From: Jérémie Galarneau Date: Tue, 13 Oct 2020 18:55:33 +0000 (-0400) Subject: Fix: lttng-ctl: erroneous uses of LTTNG_PACKED X-Git-Tag: v2.13.0-rc1~464 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=7bd95aee4660c6419a4a65429fc27754481e7e90;hp=7bd95aee4660c6419a4a65429fc27754481e7e90 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 Change-Id: I095dc0dffc6bf9e15dc7a7ec797958a5780ef150 ---