Fix: ctf: wrongfully requiring CTF metadata signature for every section
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 22 Jul 2020 16:24:09 +0000 (12:24 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 25 Feb 2022 20:30:38 +0000 (15:30 -0500)
commit113aacf74aed646511e262737f4b4c96943890b0
treee7578ad84f35f3f9b2f8d8b9bd87cfd50f60e819
parentdfad4cb9d9923b02d9d13dac07aca6a2a13a083f
Fix: ctf: wrongfully requiring CTF metadata signature for every section

Issue
=====
When testing the special live tracing session case of sending the
metadata in multiple batches, we witnessed the CTF metadata decoder
returning an error if the "/* CTF 1.8" signature is omitted from the
metadata sections following the first one.

Here is the output of Babeltrace when this error occurs:
    07-22 12:18:38.518 539222 539222 W PLUGIN/CTF/META/DECODER ctf_metadata_decoder_append_content@decoder.c:242 [lttng-live] Missing "/* CTF major.minor" signature in plain text metadata file stream: mdec-addr=0x2398ec0
    07-22 12:18:38.518 539222 539222 E PLUGIN/CTF/META/DECODER ctf_metadata_decoder_append_content@decoder.c:251 [lttng-live] Invalid metadata version found in plain text signature: version=571641920.0, mdec-addr=0x2398ec0

We expect the decoder to only require this signature when decoding the
first section of plain-text metadata.

Solution
========
Only check for the signature when processing the first metadata section.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I3153abf58ade5f5b02362dbedde382f398f5ee4e
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7391
src/plugins/ctf/common/metadata/decoder.c
This page took 0.025758 seconds and 4 git commands to generate.