Fix: bytecode interpreter context_get_index() leaves byte order uninitialized
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 30 Mar 2022 16:10:53 +0000 (12:10 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 1 Apr 2022 18:01:06 +0000 (14:01 -0400)
commit6f0a5631039e42ef0b9665942257867e1fab4faa
tree69c18469208ad50474b7cdfd676534ed5ebaa4ff
parentfd46f5c79a6a7178e35ce4f8ea21caa30da45cc4
Fix: bytecode interpreter context_get_index() leaves byte order uninitialized

Observed Issue
==============

With lttng-ust 2.13, when using the event notification capture feature
to capture a context field, e.g. '$ctx.cpu_id', the captured value is
often observed in reverse byte order.

This issue is not visible in lttng-ust 2.12 because it does not
implement the event notification capture feature. However, it would
become observable if a lttng-tools emits a filter bytecode
BYTECODE_OP_GET_SYMBOL instruction to load the context value. For
compatibility purposes, lttng-tools only uses
BYTECODE_OP_GET_CONTEXT_REF to load the filter context fields,
but nothing prevents a future lttng-tools version from using
BYTECODE_OP_GET_SYMBOL instead.

Cause
=====

Within the bytecode interpreter, context_get_index() leaves the "rev_bo"
field uninitialized in the top of stack.

Solution
========

Initialize the rev_bo field based on the context field type
reserve_byte_order field.

Known drawbacks
===============

None.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I74996d501cee3c269658d98dfc0d0050b74c5ddb
liblttng-ust/lttng-filter-interpreter.c
This page took 0.025363 seconds and 4 git commands to generate.