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:25:08 +0000 (17:25 -0500)
commitc559ee63d6a599e594d65b96298229690685e948
treee125e9ade07964236352b1bf8985fb2b2e838604
parentc922647daed3dd022be11980063b5fb816d8c091
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.cpp
This page took 0.025069 seconds and 4 git commands to generate.