Hello community, here is the log from the commit of package lttng-ust for openSUSE:Factory checked in at 2018-01-02 16:33:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lttng-ust (Old) and /work/SRC/openSUSE:Factory/.lttng-ust.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lttng-ust" Tue Jan 2 16:33:00 2018 rev:2 rq:560605 version:2.10.1 Changes: -------- --- /work/SRC/openSUSE:Factory/lttng-ust/lttng-ust.changes 2017-09-27 16:54:22.355343769 +0200 +++ /work/SRC/openSUSE:Factory/.lttng-ust.new/lttng-ust.changes 2018-01-02 16:33:03.395113664 +0100 @@ -1,0 +2,14 @@ +Fri Dec 29 18:52:22 UTC 2017 - sor.ale...@meowr.ru + +- Update to version 2.10.1: + * Fix: Specify SONAME in python-lttngust's LoadLibrary. + * Fix: Ensure the fd tracker is initialised when called from + constructors. + * Fix: fd of an elf object must be registered to the fd tracker. + * Fix: liblttng-ust-fd.so: Override the fclose symbol. + * Fix: lttng-gen-tp: Only replace the file extension. + * Fix: Move fsync after ftruncate. + * Fix: Synch buffer file metadata on buffer allocation. +- Drop baselibs.conf. + +------------------------------------------------------------------- Old: ---- baselibs.conf lttng-ust-2.10.0.tar.bz2 lttng-ust-2.10.0.tar.bz2.asc New: ---- lttng-ust-2.10.1.tar.bz2 lttng-ust-2.10.1.tar.bz2.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lttng-ust.spec ++++++ --- /var/tmp/diff_new_pack.CNOyid/_old 2018-01-02 16:33:04.166856312 +0100 +++ /var/tmp/diff_new_pack.CNOyid/_new 2018-01-02 16:33:04.166856312 +0100 @@ -19,7 +19,7 @@ %define sover 0 %define sover_ctl 4 Name: lttng-ust -Version: 2.10.0 +Version: 2.10.1 Release: 0 Summary: Linux Trace Toolkit Userspace Tracer library License: GPL-2.0 @@ -28,7 +28,6 @@ Source: https://lttng.org/files/lttng-ust/lttng-ust-%{version}.tar.bz2 Source1: https://lttng.org/files/lttng-ust/lttng-ust-%{version}.tar.bz2.asc Source2: %{name}.keyring -Source3: baselibs.conf # PATCH-FIX-OPENSUSE lttng-ust-copying.patch Patch0: lttng-ust-copying.patch BuildRequires: asciidoc ++++++ lttng-ust-2.10.0.tar.bz2 -> lttng-ust-2.10.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.10.0/ChangeLog new/lttng-ust-2.10.1/ChangeLog --- old/lttng-ust-2.10.0/ChangeLog 2017-08-01 21:07:00.000000000 +0200 +++ new/lttng-ust-2.10.1/ChangeLog 2017-11-30 15:57:50.000000000 +0100 @@ -1,3 +1,12 @@ +2017-11-30 (National Mason Jar Day) lttng-ust 2.10.1 + * Fix: specify SONAME in python-lttngust LoadLibrary + * Fix: ensure fd tracker is initialized when called from constructors + * Fix: fd of an elf object must be registered to the fd tracker + * Fix: liblttng-ust-fd.so: override fclose symbol + * Fix: lttng-gen-tp: only replace file extension + * Fix: move fsync after ftruncate + * Fix: sync buffer file metadata on buffer allocation + 2017-08-01 (World Wide Web Day) lttng-ust 2.10.0 * lttng-ust(3): reword and fix style of `LTTNG_UST_ALLOW_BLOCKING` variable * lttng-ust(3): specify "If set" instead of "if set to 1" for some variables diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.10.0/configure new/lttng-ust-2.10.1/configure --- old/lttng-ust-2.10.0/configure 2017-08-01 21:16:49.000000000 +0200 +++ new/lttng-ust-2.10.1/configure 2017-11-30 15:58:25.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for lttng-ust 2.10.0. +# Generated by GNU Autoconf 2.69 for lttng-ust 2.10.1. # # Report bugs to <mathieu dot desnoyers at efficios dot com>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='lttng-ust' PACKAGE_TARNAME='lttng-ust' -PACKAGE_VERSION='2.10.0' -PACKAGE_STRING='lttng-ust 2.10.0' +PACKAGE_VERSION='2.10.1' +PACKAGE_STRING='lttng-ust 2.10.1' PACKAGE_BUGREPORT='mathieu dot desnoyers at efficios dot com' PACKAGE_URL='https://lttng.org' @@ -1421,7 +1421,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures lttng-ust 2.10.0 to adapt to many kinds of systems. +\`configure' configures lttng-ust 2.10.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1493,7 +1493,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of lttng-ust 2.10.0:";; + short | recursive ) echo "Configuration of lttng-ust 2.10.1:";; esac cat <<\_ACEOF @@ -1651,7 +1651,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -lttng-ust configure 2.10.0 +lttng-ust configure 2.10.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2371,7 +2371,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by lttng-ust $as_me 2.10.0, which was +It was created by lttng-ust $as_me 2.10.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2727,7 +2727,7 @@ MINOR_VERSION=10 -PATCHLEVEL_VERSION=0 +PATCHLEVEL_VERSION=1 # Following the numbering scheme proposed by libtool for the library version @@ -3375,7 +3375,7 @@ # Define the identity of the package. PACKAGE='lttng-ust' - VERSION='2.10.0' + VERSION='2.10.1' cat >>confdefs.h <<_ACEOF @@ -22362,7 +22362,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by lttng-ust $as_me 2.10.0, which was +This file was extended by lttng-ust $as_me 2.10.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22433,7 +22433,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -lttng-ust config.status 2.10.0 +lttng-ust config.status 2.10.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.10.0/configure.ac new/lttng-ust-2.10.1/configure.ac --- old/lttng-ust-2.10.0/configure.ac 2017-08-01 21:16:28.000000000 +0200 +++ new/lttng-ust-2.10.1/configure.ac 2017-11-30 15:57:56.000000000 +0100 @@ -1,7 +1,7 @@ dnl Version infos m4_define([V_MAJOR], [2]) m4_define([V_MINOR], [10]) -m4_define([V_PATCH], [0]) +m4_define([V_PATCH], [1]) dnl m4_define([V_EXTRA], []) m4_define([V_NAME], [[KeKriek]]) m4_define([V_DESC], [[From Brasserie Dunham, a sour mashed golden wheat ale fermented with local sour cherries from Tougas orchards. Fresh sweet cherry notes with some tartness, lively carbonation with a dry finish.]]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.10.0/doc/man/lttng-gen-tp.1 new/lttng-ust-2.10.1/doc/man/lttng-gen-tp.1 --- old/lttng-ust-2.10.0/doc/man/lttng-gen-tp.1 2017-08-01 21:08:43.000000000 +0200 +++ new/lttng-ust-2.10.1/doc/man/lttng-gen-tp.1 2017-11-30 15:58:48.000000000 +0100 @@ -2,12 +2,12 @@ .\" Title: lttng-gen-tp .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> -.\" Date: 08/01/2017 +.\" Date: 11/30/2017 .\" Manual: LTTng Manual -.\" Source: LTTng 2.10.0- +.\" Source: LTTng 2.10.1 .\" Language: English .\" -.TH "LTTNG\-GEN\-TP" "1" "08/01/2017" "LTTng 2\&.10\&.0\-" "LTTng Manual" +.TH "LTTNG\-GEN\-TP" "1" "11/30/2017" "LTTng 2\&.10\&.1" "LTTng Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.10.0/doc/man/lttng-ust-cyg-profile.3 new/lttng-ust-2.10.1/doc/man/lttng-ust-cyg-profile.3 --- old/lttng-ust-2.10.0/doc/man/lttng-ust-cyg-profile.3 2017-08-01 21:08:44.000000000 +0200 +++ new/lttng-ust-2.10.1/doc/man/lttng-ust-cyg-profile.3 2017-11-30 15:58:49.000000000 +0100 @@ -2,12 +2,12 @@ .\" Title: lttng-ust-dl .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> -.\" Date: 08/01/2017 +.\" Date: 11/30/2017 .\" Manual: LTTng Manual -.\" Source: LTTng 2.10.0- +.\" Source: LTTng 2.10.1 .\" Language: English .\" -.TH "LTTNG\-UST\-DL" "3" "08/01/2017" "LTTng 2\&.10\&.0\-" "LTTng Manual" +.TH "LTTNG\-UST\-DL" "3" "11/30/2017" "LTTng 2\&.10\&.1" "LTTng Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.10.0/doc/man/lttng-ust-dl.3 new/lttng-ust-2.10.1/doc/man/lttng-ust-dl.3 --- old/lttng-ust-2.10.0/doc/man/lttng-ust-dl.3 2017-08-01 21:08:44.000000000 +0200 +++ new/lttng-ust-2.10.1/doc/man/lttng-ust-dl.3 2017-11-30 15:58:49.000000000 +0100 @@ -2,12 +2,12 @@ .\" Title: lttng-ust-dl .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> -.\" Date: 08/01/2017 +.\" Date: 11/30/2017 .\" Manual: LTTng Manual -.\" Source: LTTng 2.10.0- +.\" Source: LTTng 2.10.1 .\" Language: English .\" -.TH "LTTNG\-UST\-DL" "3" "08/01/2017" "LTTng 2\&.10\&.0\-" "LTTng Manual" +.TH "LTTNG\-UST\-DL" "3" "11/30/2017" "LTTng 2\&.10\&.1" "LTTng Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.10.0/doc/man/lttng-ust.3 new/lttng-ust-2.10.1/doc/man/lttng-ust.3 --- old/lttng-ust-2.10.0/doc/man/lttng-ust.3 2017-08-01 21:08:45.000000000 +0200 +++ new/lttng-ust-2.10.1/doc/man/lttng-ust.3 2017-11-30 15:58:49.000000000 +0100 @@ -2,12 +2,12 @@ .\" Title: lttng-ust .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> -.\" Date: 08/01/2017 +.\" Date: 11/30/2017 .\" Manual: LTTng Manual -.\" Source: LTTng 2.10.0- +.\" Source: LTTng 2.10.1 .\" Language: English .\" -.TH "LTTNG\-UST" "3" "08/01/2017" "LTTng 2\&.10\&.0\-" "LTTng Manual" +.TH "LTTNG\-UST" "3" "11/30/2017" "LTTng 2\&.10\&.1" "LTTng Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.10.0/doc/man/tracef.3 new/lttng-ust-2.10.1/doc/man/tracef.3 --- old/lttng-ust-2.10.0/doc/man/tracef.3 2017-08-01 21:08:43.000000000 +0200 +++ new/lttng-ust-2.10.1/doc/man/tracef.3 2017-11-30 15:58:48.000000000 +0100 @@ -2,12 +2,12 @@ .\" Title: tracef .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> -.\" Date: 08/01/2017 +.\" Date: 11/30/2017 .\" Manual: LTTng Manual -.\" Source: LTTng 2.10.0- +.\" Source: LTTng 2.10.1 .\" Language: English .\" -.TH "TRACEF" "3" "08/01/2017" "LTTng 2\&.10\&.0\-" "LTTng Manual" +.TH "TRACEF" "3" "11/30/2017" "LTTng 2\&.10\&.1" "LTTng Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.10.0/doc/man/tracelog.3 new/lttng-ust-2.10.1/doc/man/tracelog.3 --- old/lttng-ust-2.10.0/doc/man/tracelog.3 2017-08-01 21:08:43.000000000 +0200 +++ new/lttng-ust-2.10.1/doc/man/tracelog.3 2017-11-30 15:58:48.000000000 +0100 @@ -2,12 +2,12 @@ .\" Title: tracelog .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> -.\" Date: 08/01/2017 +.\" Date: 11/30/2017 .\" Manual: LTTng Manual -.\" Source: LTTng 2.10.0- +.\" Source: LTTng 2.10.1 .\" Language: English .\" -.TH "TRACELOG" "3" "08/01/2017" "LTTng 2\&.10\&.0\-" "LTTng Manual" +.TH "TRACELOG" "3" "11/30/2017" "LTTng 2\&.10\&.1" "LTTng Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.10.0/include/ust-fd.h new/lttng-ust-2.10.1/include/ust-fd.h --- old/lttng-ust-2.10.0/include/ust-fd.h 2017-07-28 22:58:49.000000000 +0200 +++ new/lttng-ust-2.10.1/include/ust-fd.h 2017-11-08 00:04:26.000000000 +0100 @@ -24,6 +24,8 @@ * These declarations should NOT be considered stable API. */ +#include <stdio.h> + void lttng_ust_init_fd_tracker(void); void lttng_ust_add_fd_to_tracker(int fd); void lttng_ust_delete_fd_from_tracker(int fd); @@ -31,6 +33,7 @@ void lttng_ust_unlock_fd_tracker(void); int lttng_ust_safe_close_fd(int fd, int (*close_cb)(int)); +int lttng_ust_safe_fclose_stream(FILE *stream, int (*fclose_cb)(FILE *stream)); int lttng_ust_safe_closefrom_fd(int lowfd, int (*close_cb)(int)); #endif /* _LTTNG_UST_FD_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.10.0/liblttng-ust/lttng-ust-elf.c new/lttng-ust-2.10.1/liblttng-ust/lttng-ust-elf.c --- old/lttng-ust-2.10.0/liblttng-ust/lttng-ust-elf.c 2017-07-28 22:58:49.000000000 +0200 +++ new/lttng-ust-2.10.1/liblttng-ust/lttng-ust-elf.c 2017-11-10 17:21:39.000000000 +0100 @@ -27,6 +27,7 @@ #include <fcntl.h> #include <unistd.h> #include <stdbool.h> +#include <ust-fd.h> #include "lttng-tracer-core.h" #define BUF_LEN 4096 @@ -248,15 +249,20 @@ goto error; } + elf->path = strdup(path); if (!elf->path) { goto error; } + lttng_ust_lock_fd_tracker(); elf->fd = open(elf->path, O_RDONLY | O_CLOEXEC); if (elf->fd < 0) { + lttng_ust_unlock_fd_tracker(); goto error; } + lttng_ust_add_fd_to_tracker(elf->fd); + lttng_ust_unlock_fd_tracker(); if (lttng_ust_read(elf->fd, e_ident, EI_NIDENT) < EI_NIDENT) { goto error; @@ -309,16 +315,7 @@ return elf; error: - if (elf) { - free(elf->ehdr); - if (elf->fd >= 0) { - if (close(elf->fd)) { - abort(); - } - } - free(elf->path); - free(elf); - } + lttng_ust_elf_destroy(elf); return NULL; } @@ -339,14 +336,25 @@ */ void lttng_ust_elf_destroy(struct lttng_ust_elf *elf) { + int ret; + if (!elf) { return; } - free(elf->ehdr); - if (close(elf->fd)) { - abort(); + if (elf->fd >= 0) { + lttng_ust_lock_fd_tracker(); + ret = close(elf->fd); + if (!ret) { + lttng_ust_delete_fd_from_tracker(elf->fd); + } else { + PERROR("close"); + abort(); + } + lttng_ust_unlock_fd_tracker(); } + + free(elf->ehdr); free(elf->path); free(elf); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.10.0/liblttng-ust-comm/lttng-ust-fd-tracker.c new/lttng-ust-2.10.1/liblttng-ust-comm/lttng-ust-fd-tracker.c --- old/lttng-ust-2.10.0/liblttng-ust-comm/lttng-ust-fd-tracker.c 2017-07-28 22:58:49.000000000 +0200 +++ new/lttng-ust-2.10.1/liblttng-ust-comm/lttng-ust-fd-tracker.c 2017-11-12 20:52:55.000000000 +0100 @@ -34,6 +34,7 @@ #include <pthread.h> #include <urcu/compiler.h> #include <urcu/tls-compat.h> +#include <urcu/system.h> #include <ust-fd.h> #include <helper.h> @@ -71,6 +72,7 @@ static fd_set *lttng_fd_set; static int lttng_ust_max_fd; static int num_fd_sets; +static int init_done; /* * Force a read (imply TLS fixup for dlopen) of TLS variables. @@ -90,6 +92,9 @@ struct rlimit rlim; int i; + if (CMM_LOAD_SHARED(init_done)) + return; + memset(&rlim, 0, sizeof(rlim)); /* Get the current possible max number of fd for this process. */ if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) @@ -113,6 +118,7 @@ abort(); for (i = 0; i < num_fd_sets; i++) FD_ZERO((<tng_fd_set[i])); + CMM_STORE_SHARED(init_done, 1); } void lttng_ust_lock_fd_tracker(void) @@ -143,6 +149,12 @@ */ void lttng_ust_add_fd_to_tracker(int fd) { + /* + * Ensure the tracker is initialized when called from + * constructors. + */ + lttng_ust_init_fd_tracker(); + assert(URCU_TLS(thread_fd_tracking)); /* Trying to add an fd which we can not accommodate. */ assert(IS_FD_VALID(fd)); @@ -158,6 +170,12 @@ */ void lttng_ust_delete_fd_from_tracker(int fd) { + /* + * Ensure the tracker is initialized when called from + * constructors. + */ + lttng_ust_init_fd_tracker(); + assert(URCU_TLS(thread_fd_tracking)); /* Not a valid fd. */ assert(IS_FD_VALID(fd)); @@ -179,6 +197,12 @@ lttng_ust_fixup_fd_tracker_tls(); /* + * Ensure the tracker is initialized when called from + * constructors. + */ + lttng_ust_init_fd_tracker(); + + /* * If called from lttng-ust, we directly call close without * validating whether the FD is part of the tracked set. */ @@ -197,6 +221,44 @@ return ret; } +/* + * Interface allowing applications to close arbitrary streams. + * We check if it is owned by lttng-ust, and return -1, errno=EBADF + * instead of closing it if it is the case. + */ +int lttng_ust_safe_fclose_stream(FILE *stream, int (*fclose_cb)(FILE *stream)) +{ + int ret = 0, fd; + + lttng_ust_fixup_fd_tracker_tls(); + + /* + * Ensure the tracker is initialized when called from + * constructors. + */ + lttng_ust_init_fd_tracker(); + + /* + * If called from lttng-ust, we directly call fclose without + * validating whether the FD is part of the tracked set. + */ + if (URCU_TLS(thread_fd_tracking)) + return fclose_cb(stream); + + fd = fileno(stream); + + lttng_ust_lock_fd_tracker(); + if (IS_FD_VALID(fd) && IS_FD_SET(fd, lttng_fd_set)) { + ret = -1; + errno = EBADF; + } else { + ret = fclose_cb(stream); + } + lttng_ust_unlock_fd_tracker(); + + return ret; +} + #ifdef __OpenBSD__ static void set_close_success(int *p) { @@ -225,6 +287,12 @@ lttng_ust_fixup_fd_tracker_tls(); + /* + * Ensure the tracker is initialized when called from + * constructors. + */ + lttng_ust_init_fd_tracker(); + if (lowfd < 0) { /* * NetBSD return EBADF if fd is invalid. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.10.0/liblttng-ust-fd/lttng-ust-fd.c new/lttng-ust-2.10.1/liblttng-ust-fd/lttng-ust-fd.c --- old/lttng-ust-2.10.0/liblttng-ust-fd/lttng-ust-fd.c 2017-07-28 22:58:49.000000000 +0200 +++ new/lttng-ust-2.10.1/liblttng-ust-fd/lttng-ust-fd.c 2017-11-08 00:04:26.000000000 +0100 @@ -31,6 +31,7 @@ volatile enum ust_loglevel ust_loglevel; static int (*__lttng_ust_fd_plibc_close)(int fd); +static int (*__lttng_ust_fd_plibc_fclose)(FILE *stream); static int _lttng_ust_fd_libc_close(int fd) @@ -45,11 +46,35 @@ return lttng_ust_safe_close_fd(fd, __lttng_ust_fd_plibc_close); } +static +int _lttng_ust_fd_libc_fclose(FILE *stream) +{ + if (!__lttng_ust_fd_plibc_fclose) { + __lttng_ust_fd_plibc_fclose = dlsym(RTLD_NEXT, "fclose"); + if (!__lttng_ust_fd_plibc_fclose) { + fprintf(stderr, "%s\n", dlerror()); + return -1; + } + } + return lttng_ust_safe_fclose_stream(stream, + __lttng_ust_fd_plibc_fclose); +} + int close(int fd) { return _lttng_ust_fd_libc_close(fd); } +/* + * Note: fcloseall() is not an issue because it fcloses only the + * streams it knows about, which differs from the problems caused by + * gnulib close_stdout(), which does an explicit fclose(stdout). + */ +int fclose(FILE *stream) +{ + return _lttng_ust_fd_libc_fclose(stream); +} + #if defined(__sun__) || defined(__FreeBSD__) /* Solaris and FreeBSD. */ void closefrom(int lowfd) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.10.0/libringbuffer/shm.c new/lttng-ust-2.10.1/libringbuffer/shm.c --- old/lttng-ust-2.10.0/libringbuffer/shm.c 2017-07-28 22:58:49.000000000 +0200 +++ new/lttng-ust-2.10.1/libringbuffer/shm.c 2017-11-28 09:47:42.000000000 +0100 @@ -134,6 +134,15 @@ PERROR("ftruncate"); goto error_ftruncate; } + /* + * Also ensure the file metadata is synced with the storage by using + * fsync(2). + */ + ret = fsync(shmfd); + if (ret) { + PERROR("fsync"); + goto error_fsync; + } obj->shm_fd_ownership = 0; obj->shm_fd = shmfd; @@ -153,6 +162,7 @@ return obj; error_mmap: +error_fsync: error_ftruncate: error_zero_file: error_fcntl: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.10.0/python-lttngust/lttngust/loghandler.py new/lttng-ust-2.10.1/python-lttngust/lttngust/loghandler.py --- old/lttng-ust-2.10.0/python-lttngust/lttngust/loghandler.py 2017-06-15 17:04:16.000000000 +0200 +++ new/lttng-ust-2.10.1/python-lttngust/lttngust/loghandler.py 2017-11-21 17:45:49.000000000 +0100 @@ -22,7 +22,7 @@ class _Handler(logging.Handler): - _LIB_NAME = 'liblttng-ust-python-agent.so' + _LIB_NAME = 'liblttng-ust-python-agent.so.0' def __init__(self): super(self.__class__, self).__init__(level=logging.NOTSET) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.10.0/tools/lttng-gen-tp new/lttng-ust-2.10.1/tools/lttng-gen-tp --- old/lttng-ust-2.10.0/tools/lttng-gen-tp 2017-06-15 17:04:16.000000000 +0200 +++ new/lttng-ust-2.10.1/tools/lttng-gen-tp 2017-11-28 09:47:42.000000000 +0100 @@ -79,7 +79,9 @@ def write(self): outputFile = open(self.outputFilename,"w") - headerFilename = self.outputFilename.replace(".c",".h") + headerFilename = self.outputFilename + if headerFilename.endswith(".c"): + headerFilename = headerFilename[:-2] + ".h" outputFile.write(CFile.FILE_TPL.format( headerFilename = headerFilename)) @@ -126,7 +128,10 @@ return cc def write(self): - cFilename = self.outputFilename.replace(".o",".c") + cFilename = self.outputFilename + if cFilename.endswith(".o"): + cFilename = cFilename[:-2] + ".c" + cc = self._detectCC() if cc == "": raise RuntimeError("No C Compiler detected")