lttng-ust:stable-2.10

Last commit made on 2022-07-29
Get this branch:
git clone -b stable-2.10 https://git.launchpad.net/lttng-ust

Branch merges

Branch information

Name:
stable-2.10
Repository:
lp:lttng-ust

Recent commits

94b4db5... by Michael Jeanson <email address hidden>

fix: Unify possible CPU number fallback

The MUSL specific fallback to get the number of possible CPUs in the
system has the same issue with hot-unplugged CPUs as the Glibc
implementation we worked around by using the possible CPU mask from
sysfs.

To address this, unify our fallback code across all C libraries to get
the maximum CPU id from the directories in "/sys/devices/system/cpu".

Change-Id: I5541742dc1de8e011a942880825fa88c656f0905
Signed-off-by: Michael Jeanson <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

a9e8902... by Mathieu Desnoyers

Fix: remove unused align.h header

Signed-off-by: Mathieu Desnoyers <email address hidden>
Change-Id: I3a3ea23e36de36ac59b0d350b8ac2bdcfca4a139

bb6e798... by Michael Jeanson <email address hidden>

fix: removed accidental VLA in _get_num_possible_cpus()

The LTTNG_UST_PAGE_SIZE define can either point to a literal value or
the sysconf() function making buf[] a VLA. Replace this by a
cpumask specifc define that will always be a literal value.

Change-Id: I8d329f314878e8018939f979861918969e3ec8ac
Signed-off-by: Michael Jeanson <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

aaa2311... by Michael Jeanson <email address hidden>

Add unit tests for num possible cpus

Change-Id: I90eff0090b28cef64a8f4a5bd9745971ed89c711
Signed-off-by: Michael Jeanson <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

f1d40e2... by Michael Jeanson <email address hidden>

fix: num_possible_cpus() with hot-unplugged CPUs

We rely on sysconf(_SC_NPROCESSORS_CONF) to get the maximum possible
number of CPUs that can be attached to the system for the lifetime of an
application. We use this value to allocate an array of per-CPU buffers
that is indexed by the numerical id of the CPUs.

As such we expect that the highest possible CPU id would be one less
than the number returned by sysconf(_SC_NPROCESSORS_CONF) which is
unfortunatly not always the case and can vary across libc
implementations and versions.

Glibc up to 2.35 will count the number of "cpuX" directories in
"/sys/devices/system/cpu" which doesn't include CPUS that were
hot-unplugged.

This information is however provided by the kernel in
"/sys/devices/system/cpu/possible" in the form of a mask listing all the
CPUs that could possibly be hot-plugged in the system.

This patch changes the implementation of num_possible_cpus() to first
try parsing the possible CPU mask to extract the highest possible value
and if this fails fallback to the previous behavior.

Change-Id: I1a3cb1a446154ec443a391d6689cb7d4165726fd
Signed-off-by: Michael Jeanson <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

9cafd2a... by Mathieu Desnoyers

Version 2.10.7

Signed-off-by: Mathieu Desnoyers <email address hidden>

ddb1c6d... by Jonathan Rajotte

Fix: set FD_CLOEXEC on incoming FDs.

The stream shm FDs are allocated by the consumer process, and then
passed to the applications over unix sockets. When opening those
file descriptors on reception, the FD_CLOEXEC flag is not set.

In a fork + exec scenario, parent process streams shm FDs and channel
wake FDs are present in the resulting child process.

Set FD_CLOEXEC on reception (ustcomm_recv_fds_unix_sock) to
prevent such scenario.

Change-Id: Id58077b272be9c1ab239846639ffd8103b3d50f1
Signed-off-by: Jonathan Rajotte <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

473aa42... by Francis Deslauriers <email address hidden>

Fix: lttng-ust-comm.c: return number of fd rather size of array

There are two conflicting comments for this function. One says it
returns the size of the received data and the other says it returns the
number of fd received.

It's more useful to receive the number of fd.

Signed-off-by: Francis Deslauriers <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>
Change-Id: I74084b461d396c3e623fa55100e6dd7e59dbea83

a4df804... by Mathieu Desnoyers

Fix: tracepoint.h: Disable address sanitizer on pointer array section variables

The tracepoint header declares pointer global variables meant to be
placed contiguously within the __tracepoints_ptrs section, and then used
as an array of pointers when loading an executable or shared object.

Clang Address Sanitizer adds redzones around each variable, thus leading to
detection of a global buffer overflow.

Those redzones should not be placed within this section, because it
defeats its purpose. Therefore, teach asan not to add redzones
around those variables with an attribute.

Note that there does not appear to be any issue with gcc (tested with
gcc-8 with address sanitization enabled), and gcc ignores the
no_sanitize_address attribute when applied to a global variable.

Fixes: #1238

Signed-off-by: Mathieu Desnoyers <email address hidden>

faef9f9... by Mathieu Desnoyers

Fix: jhash.h: remove out-of-bound reads

jhash.h implements "special" code for valgrind because it reads memory
out-of-bound (and then applies a mask) when reading strings.

Considering that lttng-ust does not use jhash.h in a fast-path, remove
this "optimization" and use the verifiable VALGRIND code instead. This
fixes an ASan splat.

Fixes: #1238

Signed-off-by: Mathieu Desnoyers <email address hidden>