Fix context mismatch across UST version due to legacy array context field
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 24 Jan 2022 22:05:39 +0000 (17:05 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 25 Jan 2022 22:26:06 +0000 (17:26 -0500)
commitfefafa3644e59939908c879103b207aee042d616
tree3b5b1408c735f9d0ed42b13488334587600badd0
parent395004a13b038fde13364a662d735d16937ea2d1
Fix context mismatch across UST version due to legacy array context field

Observed issue
==============

Tracing applications linked against both LTTng-UST 2.12.x and 2.13.1 in
the same session fails with:

"Error: Registering application channel due to context field mismatch"

for some applications with the "procname" context enabled.

Cause
=====

The procname context uses the legacy array field type prior to LTTng-UST
2.13, and uses the array_nestable field type starting from LTTng-UST
2.13. The field comparison in lttng-sessiond is unaware of the fact that
they map to the exact same binary trace layout and are therefore
compatible.

Solution
========

Introduce a new fixup function "ust_app_fixup_legacy_context_fields" in
lttng-sessiond for channel context fields, which detects the presence of
the legacy array, struct and variant types, and rewrites them as
array_nestable, struct_nestable, and variant_nestable types.

Reject the legacy sequence type in channel context fields because it is
not used by LTTng-UST 2.12 and older.

Rewriting those legacy context types as the new "nestable" types ensures
that field comparison functions will correctly handle a mix of 2.12 and
2.13 LTTng-UST tracers using a procname context to a given session's
channel.

Known Drawbacks
===============

None.

Fixes: fb2772932 ("Validate channel context mismatch across UST applications")
Change-Id: Ic51b92130ae8e1f7b510924f78ff46459dc2f578
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/ust-app.c
This page took 0.025125 seconds and 4 git commands to generate.