lttng-ust:stable-2.12

Last commit made on 2024-04-19
Get this branch:
git clone -b stable-2.12 https://git.launchpad.net/lttng-ust

Branch merges

Branch information

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

Recent commits

d4126f5... by Mathieu Desnoyers

Version 2.12.10

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

26be141... by Mathieu Desnoyers

Add close_range wrapper to liblttng-ust-fd.so

glibc 2.34 implements close_range(2), which is used by the ssh client
(amongst others). This needs to be overridden to make sure ssh does not
close lttng-ust file descriptors.

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

6b0c6b7... by Olivier Dion <email address hidden>

lttng-ust(3): Fix wrong len_type for sequence

`len_type' of a sequence field must be of type unsigned integer. Some
provided examples in the man page were incorrectly using a type signed
integer, resulting in correct compilation, but error while decoding.

Change-Id: Icc685b330d0704660b36f703075f453d71c5e4cb
Signed-off-by: Olivier Dion <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

6d564f0... by Mathieu Desnoyers

Fix: libc wrapper: use initial-exec for malloc_nesting TLS

Use the initial-exec TLS model for the malloc_nesting nesting guard
variable to ensure that the glibc implementation of the TLS access don't
trigger infinite recursion by calling the memory allocator wrapper
functions, which can happen with global-dynamic.

Considering that the libc wrapper is meant to be loaded with LD_PRELOAD
anyway (never with dlopen(3)), we always expect the libc to have enough
space to hold the malloc_nesting variable.

In addition to change the malloc_nesting from global-dynamic to
initial-exec, this removes the URCU TLS compatibility layer from the
libc wrapper, which is a good thing: this compatibility layer relies
on pthread key and calloc internally, which makes it a bad fit for TLS
accesses guarding access to malloc wrappers, due to possible infinite
recursion.

Link: https://lists.lttng.org/pipermail/lttng-dev/2024-January/030697.html
Reported-by: Florian Weimer <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>
Change-Id: I72c42bc09c1a06e2922b184b85abeb9c94200ee2

32b9b7b... by Mathieu Desnoyers

Version 2.12.9

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

1a6b714... by Kienan Stewart <email address hidden>

fix: invoke MKDIR_P before changing directories

In autoconf < 2.72d `AC_PROG_MKDIR_P` may fall back to using
`install-sh` and that may be referenced as a relative path.

To avoid issues with relative paths causing the command to not be
found, the build directories are created before changing the working
directory.

One way to to test the behaviour prior to this commit is to configure
the build similar to the following:

    ./configure MKDIR_P="$(realpath --relative-to="$(pwd)" \
    $(command -v mkdir))" BUILD_EXAMPLES_FROM_TREE=1

Fixes https://bugs.lttng.org/issues/1404

Change-Id: I2d66254cd8c208f9236d55c6ef1b83c580560c7c
Signed-off-by: Kienan Stewart <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

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

fix: clean java inner class files in examples

Java classes that contain inner classes will result in additional class
files being created when compiled in the form of
'Class$InnerClass.class'. Expand the clean target to delete those
additional files.

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

3194ee9... by Olivier Dion <email address hidden>

ustfork: Fix warning about volatile qualifier

Clang is strict about the volatile qualifier on function pointers. It
also wants pointers to be passed to atomic builtins, even for
functions. Therefore, use the addresses of function pointers even if
unnecessary according to C standard.

Change-Id: I5d553a46671cc4bfbe8de5cec2425201459f60d2
Signed-off-by: Olivier Dion <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

d32dbe6... by Olivier Dion <email address hidden>

ustfork: Fix possible race conditions

Assuming that `dlsym(RTLD_NEXT, "symbol")' is invariant for "symbol",
then we could think that memory operations on the `plibc_func' pointers can
be safely done without atomics.

However, consider what would happen if a load to a`plibc_func' pointer
is torn apart by the compiler. Then a thread could see:

  1) NULL

  2) The stored value as returned by a dlsym() call

  3) A mix of 1) and 2)

The same goes for other optimizations that a compiler is authorized to
do (e.g. store tearing, load fusing).

One could question whether such race condition is even possible for the
clone(2) wrapper. Indeed, a thread must be cloned to get into
existence. Therefore, the main thread would always store the value of
`plibc_func' at least once before creating the first sibling thread,
preventing any possible race condition for this wrapper. However, this
assume that the main thread will not call the clone system call directly
before calling the libc wrapper! Thus, to be on the safe side, we do the
same for the clone wrapper.

Fix the race conditions by using the uatomic_read/uatomic_set functions,
on access to `plibc_func' pointers.

Change-Id: Ic4be25983b8836d2b333f367af9c18d2f6b75879
Signed-off-by: Olivier Dion <email address hidden>
Signed-off-by: Mathieu Desnoyers <email address hidden>

b115a3f... by Mathieu Desnoyers

Fix: FreeBSD: Pass flags arguments to rfork wrapper

Backported from:

commit e2a195a6849 ("Fix warnings on FreeBSD")

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