From: Jonathan Rajotte Date: Wed, 12 Jan 2022 23:18:08 +0000 (-0500) Subject: Fix: liblttng-ctl comm: lttng_channel is not packed X-Git-Tag: v2.13.5~48 X-Git-Url: https://git.liburcu.org/?a=commitdiff_plain;h=714363d38245d57d5fbb657f67bc069d6f4d8aff;hp=714363d38245d57d5fbb657f67bc069d6f4d8aff;p=lttng-tools.git Fix: liblttng-ctl comm: lttng_channel 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_channel): x86: 608 x86-64: 624 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. The only particularity is that we need to flatten the channels on listing. Most of the complexity is moved to `src/common/channel.c` Known drawbacks ========= None. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: Id5c9aaf3cf8b3d739b71263c02cae8d4d2fedfe3 ---