Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package lttng-ust for openSUSE:Factory checked in at 2022-10-04 20:36:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lttng-ust (Old) and /work/SRC/openSUSE:Factory/.lttng-ust.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lttng-ust" Tue Oct 4 20:36:49 2022 rev:13 rq:1007593 version:2.13.5 Changes: -------- --- /work/SRC/openSUSE:Factory/lttng-ust/lttng-ust.changes 2022-08-30 14:48:51.168024399 +0200 +++ /work/SRC/openSUSE:Factory/.lttng-ust.new.2275/lttng-ust.changes 2022-10-04 20:36:51.640842517 +0200 @@ -1,0 +2,12 @@ +Sun Oct 2 18:13:47 UTC 2022 - Alexei Sorokin <sor.ale...@meowr.ru> + +- Update to version 2.13.5: + * Fix: bytecode validator: reject specialised load field/context + ref instructions. + * Fix: bytecode validator: reject specialised load instructions. + * Fix: event notification capture: validate buffer length. + * Fix: event notification capture error handling. + * Fix: lttng-ust-comm: wait on wrong child process. + * fix: 'make dist' without javah. + +------------------------------------------------------------------- Old: ---- lttng-ust-2.13.4.tar.bz2 lttng-ust-2.13.4.tar.bz2.asc New: ---- lttng-ust-2.13.5.tar.bz2 lttng-ust-2.13.5.tar.bz2.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lttng-ust.spec ++++++ --- /var/tmp/diff_new_pack.xyPxs3/_old 2022-10-04 20:36:52.548843808 +0200 +++ /var/tmp/diff_new_pack.xyPxs3/_new 2022-10-04 20:36:52.560843825 +0200 @@ -19,7 +19,7 @@ %define sover 1 %define sover_ctl 5 Name: lttng-ust -Version: 2.13.4 +Version: 2.13.5 Release: 0 Summary: Linux Trace Toolkit Userspace Tracer library License: GPL-2.0-only ++++++ lttng-ust-2.13.4.tar.bz2 -> lttng-ust-2.13.5.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/ChangeLog new/lttng-ust-2.13.5/ChangeLog --- old/lttng-ust-2.13.4/ChangeLog 2022-08-19 22:23:41.000000000 +0200 +++ new/lttng-ust-2.13.5/ChangeLog 2022-09-30 20:26:16.000000000 +0200 @@ -1,4 +1,12 @@ -2022-08-19 (National Popato Day) lttng-ust 2.13.4 +2022-09-30 (National Day for Truth and Reconciliation) lttng-ust 2.13.5 + * Fix: bytecode validator: reject specialized load field/context ref instructions + * Fix: bytecode validator: reject specialized load instructions + * Fix: event notification capture: validate buffer length + * Fix: event notification capture error handling + * Fix: lttng-ust-comm: wait on wrong child process + * fix: 'make dist' without javah + +2022-08-19 (National Potato Day) lttng-ust 2.13.4 * cleanup: remove stale comment * Fix: disable array/sequence compile-time type check in C * fix: add missing closedir in _get_max_cpuid_from_sysfs() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/configure new/lttng-ust-2.13.5/configure --- old/lttng-ust-2.13.4/configure 2022-08-19 22:24:31.000000000 +0200 +++ new/lttng-ust-2.13.5/configure 2022-09-30 20:26:50.000000000 +0200 @@ -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.13.4. +# Generated by GNU Autoconf 2.69 for lttng-ust 2.13.5. # # 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.13.4' -PACKAGE_STRING='lttng-ust 2.13.4' +PACKAGE_VERSION='2.13.5' +PACKAGE_STRING='lttng-ust 2.13.5' PACKAGE_BUGREPORT='mathieu dot desnoyers at efficios dot com' PACKAGE_URL='https://lttng.org' @@ -1442,7 +1442,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.13.4 to adapt to many kinds of systems. +\`configure' configures lttng-ust 2.13.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1514,7 +1514,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of lttng-ust 2.13.4:";; + short | recursive ) echo "Configuration of lttng-ust 2.13.5:";; esac cat <<\_ACEOF @@ -1667,7 +1667,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -lttng-ust configure 2.13.4 +lttng-ust configure 2.13.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2387,7 +2387,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.13.4, which was +It was created by lttng-ust $as_me 2.13.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3370,7 +3370,7 @@ # Define the identity of the package. PACKAGE='lttng-ust' - VERSION='2.13.4' + VERSION='2.13.5' cat >>confdefs.h <<_ACEOF @@ -22920,10 +22920,10 @@ $as_echo "#define LTTNG_UST_MINOR_VERSION 13" >>confdefs.h -$as_echo "#define LTTNG_UST_PATCHLEVEL_VERSION 4" >>confdefs.h +$as_echo "#define LTTNG_UST_PATCHLEVEL_VERSION 5" >>confdefs.h -$as_echo "#define LTTNG_UST_VERSION \"2.13.4\"" >>confdefs.h +$as_echo "#define LTTNG_UST_VERSION \"2.13.5\"" >>confdefs.h $as_echo "#define LTTNG_UST_LIB_SONAME_MAJOR 1" >>confdefs.h @@ -23718,7 +23718,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.13.4, which was +This file was extended by lttng-ust $as_me 2.13.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -23785,7 +23785,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.13.4 +lttng-ust config.status 2.13.5 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.13.4/configure.ac new/lttng-ust-2.13.5/configure.ac --- old/lttng-ust-2.13.4/configure.ac 2022-08-19 22:23:47.000000000 +0200 +++ new/lttng-ust-2.13.5/configure.ac 2022-09-30 20:26:30.000000000 +0200 @@ -8,7 +8,7 @@ # Project version information m4_define([ust_version_major], [2]) m4_define([ust_version_minor], [13]) -m4_define([ust_version_patch], [4]) +m4_define([ust_version_patch], [5]) m4_define([ust_version_dev_stage], []) m4_define([ust_version], ust_version_major[.]ust_version_minor[.]ust_version_patch[]ust_version_dev_stage) m4_define([ust_version_name], [[Nordicit??]]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/doc/man/lttng-gen-tp.1 new/lttng-ust-2.13.5/doc/man/lttng-gen-tp.1 --- old/lttng-ust-2.13.4/doc/man/lttng-gen-tp.1 2022-08-19 22:24:57.000000000 +0200 +++ new/lttng-ust-2.13.5/doc/man/lttng-gen-tp.1 2022-09-30 20:27:21.000000000 +0200 @@ -2,12 +2,12 @@ .\" Title: lttng-gen-tp .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> -.\" Date: 08/19/2022 +.\" Date: 09/30/2022 .\" Manual: LTTng Manual -.\" Source: LTTng 2.13.4 +.\" Source: LTTng 2.13.5 .\" Language: English .\" -.TH "LTTNG\-GEN\-TP" "1" "08/19/2022" "LTTng 2\&.13\&.4" "LTTng Manual" +.TH "LTTNG\-GEN\-TP" "1" "09/30/2022" "LTTng 2\&.13\&.5" "LTTng Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/doc/man/lttng-ust-cyg-profile.3 new/lttng-ust-2.13.5/doc/man/lttng-ust-cyg-profile.3 --- old/lttng-ust-2.13.4/doc/man/lttng-ust-cyg-profile.3 2022-08-19 22:25:01.000000000 +0200 +++ new/lttng-ust-2.13.5/doc/man/lttng-ust-cyg-profile.3 2022-09-30 20:27:22.000000000 +0200 @@ -2,12 +2,12 @@ .\" Title: lttng-ust-cyg-profile .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> -.\" Date: 08/19/2022 +.\" Date: 09/30/2022 .\" Manual: LTTng Manual -.\" Source: LTTng 2.13.4 +.\" Source: LTTng 2.13.5 .\" Language: English .\" -.TH "LTTNG\-UST\-CYG\-PRO" "3" "08/19/2022" "LTTng 2\&.13\&.4" "LTTng Manual" +.TH "LTTNG\-UST\-CYG\-PRO" "3" "09/30/2022" "LTTng 2\&.13\&.5" "LTTng Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/doc/man/lttng-ust-dl.3 new/lttng-ust-2.13.5/doc/man/lttng-ust-dl.3 --- old/lttng-ust-2.13.4/doc/man/lttng-ust-dl.3 2022-08-19 22:25:00.000000000 +0200 +++ new/lttng-ust-2.13.5/doc/man/lttng-ust-dl.3 2022-09-30 20:27:21.000000000 +0200 @@ -2,12 +2,12 @@ .\" Title: lttng-ust-dl .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> -.\" Date: 08/19/2022 +.\" Date: 09/30/2022 .\" Manual: LTTng Manual -.\" Source: LTTng 2.13.4 +.\" Source: LTTng 2.13.5 .\" Language: English .\" -.TH "LTTNG\-UST\-DL" "3" "08/19/2022" "LTTng 2\&.13\&.4" "LTTng Manual" +.TH "LTTNG\-UST\-DL" "3" "09/30/2022" "LTTng 2\&.13\&.5" "LTTng Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/doc/man/lttng-ust.3 new/lttng-ust-2.13.5/doc/man/lttng-ust.3 --- old/lttng-ust-2.13.4/doc/man/lttng-ust.3 2022-08-19 22:24:59.000000000 +0200 +++ new/lttng-ust-2.13.5/doc/man/lttng-ust.3 2022-09-30 20:27:22.000000000 +0200 @@ -2,12 +2,12 @@ .\" Title: lttng-ust .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> -.\" Date: 08/19/2022 +.\" Date: 09/30/2022 .\" Manual: LTTng Manual -.\" Source: LTTng 2.13.4 +.\" Source: LTTng 2.13.5 .\" Language: English .\" -.TH "LTTNG\-UST" "3" "08/19/2022" "LTTng 2\&.13\&.4" "LTTng Manual" +.TH "LTTNG\-UST" "3" "09/30/2022" "LTTng 2\&.13\&.5" "LTTng Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -211,7 +211,7 @@ API version\ \&\fIN\fR, and all the following existing APIs, are available\&. Previous APIs are not available (not compiled)\&. .RE .sp -The following table shows the mapping from LTTng\-UST versions (up to LTTng\-UST\ \&2\&.13\&.4) to available API versions: +The following table shows the mapping from LTTng\-UST versions (up to LTTng\-UST\ \&2\&.13\&.5) to available API versions: .TS allbox tab(:); ltB ltB. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/doc/man/lttng_ust_tracef.3 new/lttng-ust-2.13.5/doc/man/lttng_ust_tracef.3 --- old/lttng-ust-2.13.4/doc/man/lttng_ust_tracef.3 2022-08-19 22:25:02.000000000 +0200 +++ new/lttng-ust-2.13.5/doc/man/lttng_ust_tracef.3 2022-09-30 20:27:21.000000000 +0200 @@ -2,12 +2,12 @@ .\" Title: lttng_ust_tracef .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> -.\" Date: 08/19/2022 +.\" Date: 09/30/2022 .\" Manual: LTTng Manual -.\" Source: LTTng 2.13.4 +.\" Source: LTTng 2.13.5 .\" Language: English .\" -.TH "LTTNG_UST_TRACEF" "3" "08/19/2022" "LTTng 2\&.13\&.4" "LTTng Manual" +.TH "LTTNG_UST_TRACEF" "3" "09/30/2022" "LTTng 2\&.13\&.5" "LTTng Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/doc/man/lttng_ust_tracelog.3 new/lttng-ust-2.13.5/doc/man/lttng_ust_tracelog.3 --- old/lttng-ust-2.13.4/doc/man/lttng_ust_tracelog.3 2022-08-19 22:25:02.000000000 +0200 +++ new/lttng-ust-2.13.5/doc/man/lttng_ust_tracelog.3 2022-09-30 20:27:22.000000000 +0200 @@ -2,12 +2,12 @@ .\" Title: lttng_ust_tracelog .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> -.\" Date: 08/19/2022 +.\" Date: 09/30/2022 .\" Manual: LTTng Manual -.\" Source: LTTng 2.13.4 +.\" Source: LTTng 2.13.5 .\" Language: English .\" -.TH "LTTNG_UST_TRACELOG" "3" "08/19/2022" "LTTng 2\&.13\&.4" "LTTng Manual" +.TH "LTTNG_UST_TRACELOG" "3" "09/30/2022" "LTTng 2\&.13\&.5" "LTTng Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/doc/man/tracef.3 new/lttng-ust-2.13.5/doc/man/tracef.3 --- old/lttng-ust-2.13.4/doc/man/tracef.3 2022-08-19 22:25:03.000000000 +0200 +++ new/lttng-ust-2.13.5/doc/man/tracef.3 2022-09-30 20:27:22.000000000 +0200 @@ -2,12 +2,12 @@ .\" Title: tracef .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> -.\" Date: 08/19/2022 +.\" Date: 09/30/2022 .\" Manual: LTTng Manual -.\" Source: LTTng 2.13.4 +.\" Source: LTTng 2.13.5 .\" Language: English .\" -.TH "TRACEF" "3" "08/19/2022" "LTTng 2\&.13\&.4" "LTTng Manual" +.TH "TRACEF" "3" "09/30/2022" "LTTng 2\&.13\&.5" "LTTng Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/doc/man/tracelog.3 new/lttng-ust-2.13.5/doc/man/tracelog.3 --- old/lttng-ust-2.13.4/doc/man/tracelog.3 2022-08-19 22:25:03.000000000 +0200 +++ new/lttng-ust-2.13.5/doc/man/tracelog.3 2022-09-30 20:27:22.000000000 +0200 @@ -2,12 +2,12 @@ .\" Title: tracelog .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> -.\" Date: 08/19/2022 +.\" Date: 09/30/2022 .\" Manual: LTTng Manual -.\" Source: LTTng 2.13.4 +.\" Source: LTTng 2.13.5 .\" Language: English .\" -.TH "TRACELOG" "3" "08/19/2022" "LTTng 2\&.13\&.4" "LTTng Manual" +.TH "TRACELOG" "3" "09/30/2022" "LTTng 2\&.13\&.5" "LTTng Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/src/common/msgpack/msgpack.c new/lttng-ust-2.13.5/src/common/msgpack/msgpack.c --- old/lttng-ust-2.13.4/src/common/msgpack/msgpack.c 2022-08-19 22:22:55.000000000 +0200 +++ new/lttng-ust-2.13.5/src/common/msgpack/msgpack.c 2022-09-30 20:24:51.000000000 +0200 @@ -483,6 +483,18 @@ return lttng_msgpack_encode_f64(writer, value); } +int lttng_msgpack_save_writer_pos(struct lttng_msgpack_writer *writer, uint8_t **pos) +{ + *pos = writer->write_pos; + return 0; +} + +int lttng_msgpack_restore_writer_pos(struct lttng_msgpack_writer *writer, uint8_t *pos) +{ + writer->write_pos = pos; + return 0; +} + void lttng_msgpack_writer_init(struct lttng_msgpack_writer *writer, uint8_t *buffer, size_t size) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/src/common/msgpack/msgpack.h new/lttng-ust-2.13.5/src/common/msgpack/msgpack.h --- old/lttng-ust-2.13.4/src/common/msgpack/msgpack.h 2022-08-19 22:22:55.000000000 +0200 +++ new/lttng-ust-2.13.5/src/common/msgpack/msgpack.h 2022-09-30 20:24:51.000000000 +0200 @@ -67,4 +67,10 @@ int lttng_msgpack_end_array(struct lttng_msgpack_writer *writer) __attribute__((visibility("hidden"))); +int lttng_msgpack_save_writer_pos(struct lttng_msgpack_writer *writer, uint8_t **pos) + __attribute__((visibility("hidden"))); + +int lttng_msgpack_restore_writer_pos(struct lttng_msgpack_writer *writer, uint8_t *pos) + __attribute__((visibility("hidden"))); + #endif /* _LTTNG_UST_MSGPACK_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/src/lib/lttng-ust/event-notifier-notification.c new/lttng-ust-2.13.5/src/lib/lttng-ust/event-notifier-notification.c --- old/lttng-ust-2.13.4/src/lib/lttng-ust/event-notifier-notification.c 2022-08-19 22:22:55.000000000 +0200 +++ new/lttng-ust-2.13.5/src/lib/lttng-ust/event-notifier-notification.c 2022-09-30 20:24:51.000000000 +0200 @@ -30,6 +30,8 @@ #define CAPTURE_BUFFER_SIZE \ (PIPE_BUF - sizeof(struct lttng_ust_abi_event_notifier_notification) - 1) +#define MSG_WRITE_NIL_LEN 1 + struct lttng_event_notifier_notification { int notification_fd; uint64_t event_notifier_token; @@ -39,27 +41,50 @@ }; static -void capture_enum(struct lttng_msgpack_writer *writer, +int capture_enum(struct lttng_msgpack_writer *writer, struct lttng_interpreter_output *output) { - lttng_msgpack_begin_map(writer, 2); - lttng_msgpack_write_str(writer, "type"); - lttng_msgpack_write_str(writer, "enum"); + int ret; - lttng_msgpack_write_str(writer, "value"); + ret = lttng_msgpack_begin_map(writer, 2); + if (ret) { + goto end; + } + ret = lttng_msgpack_write_str(writer, "type"); + if (ret) { + goto end; + } + ret = lttng_msgpack_write_str(writer, "enum"); + if (ret) { + goto end; + } + ret = lttng_msgpack_write_str(writer, "value"); + if (ret) { + goto end; + } switch (output->type) { case LTTNG_INTERPRETER_TYPE_SIGNED_ENUM: - lttng_msgpack_write_signed_integer(writer, output->u.s); + ret = lttng_msgpack_write_signed_integer(writer, output->u.s); + if (ret) { + goto end; + } break; case LTTNG_INTERPRETER_TYPE_UNSIGNED_ENUM: - lttng_msgpack_write_signed_integer(writer, output->u.u); + ret = lttng_msgpack_write_signed_integer(writer, output->u.u); + if (ret) { + goto end; + } break; default: - abort(); + CRIT("Unknown enum output type\n"); + ret = -1; + goto end; } - lttng_msgpack_end_map(writer); + ret = lttng_msgpack_end_map(writer); +end: + return ret; } static @@ -105,7 +130,8 @@ break; } default: - abort(); + CRIT("Unknown sequence element size\n"); + value = 0; } return value; @@ -154,24 +180,27 @@ break; } default: - abort(); + CRIT("Unknown sequence element size\n"); + value = 0; } return value; } static -void capture_sequence(struct lttng_msgpack_writer *writer, +int capture_sequence(struct lttng_msgpack_writer *writer, struct lttng_interpreter_output *output) { const struct lttng_ust_type_integer *integer_type; const struct lttng_ust_type_common *nested_type; uint8_t *ptr; bool signedness; - int i; - - lttng_msgpack_begin_array(writer, output->u.sequence.nr_elem); + int i, ret; + ret = lttng_msgpack_begin_array(writer, output->u.sequence.nr_elem); + if (ret) { + goto end; + } ptr = (uint8_t *) output->u.sequence.ptr; nested_type = output->u.sequence.nested_type; switch (nested_type->type) { @@ -183,18 +212,22 @@ integer_type = lttng_ust_get_type_integer(lttng_ust_get_type_enum(nested_type)->container_type); break; default: - /* Capture of array of non-integer are not supported. */ - abort(); + CRIT("Capture of array of non-integer are not supported\n"); + ret = -1; + goto end; } signedness = integer_type->signedness; for (i = 0; i < output->u.sequence.nr_elem; i++) { if (signedness) { - lttng_msgpack_write_signed_integer(writer, + ret = lttng_msgpack_write_signed_integer(writer, capture_sequence_element_signed(ptr, integer_type)); } else { - lttng_msgpack_write_unsigned_integer(writer, + ret = lttng_msgpack_write_unsigned_integer(writer, capture_sequence_element_unsigned(ptr, integer_type)); } + if (ret) { + goto end; + } /* * We assume that alignment is smaller or equal to the size. @@ -209,14 +242,17 @@ ptr += (integer_type->size / CHAR_BIT) ; } - lttng_msgpack_end_array(writer); + ret = lttng_msgpack_end_array(writer); +end: + return ret; } static -void notification_init(struct lttng_event_notifier_notification *notif, +int notification_init(struct lttng_event_notifier_notification *notif, const struct lttng_ust_event_notifier *event_notifier) { struct lttng_msgpack_writer *writer = ¬if->writer; + int ret = 0; notif->event_notifier_token = event_notifier->priv->parent.user_token; notif->notification_fd = event_notifier->priv->group->notification_fd; @@ -226,48 +262,56 @@ lttng_msgpack_writer_init(writer, notif->capture_buf, CAPTURE_BUFFER_SIZE); - lttng_msgpack_begin_array(writer, event_notifier->priv->num_captures); + ret = lttng_msgpack_begin_array(writer, event_notifier->priv->num_captures); + if (ret) { + goto end; + } notif->has_captures = true; } +end: + return ret; } static -void notification_append_capture( +int notification_append_capture( struct lttng_event_notifier_notification *notif, struct lttng_interpreter_output *output) { struct lttng_msgpack_writer *writer = ¬if->writer; + int ret; switch (output->type) { case LTTNG_INTERPRETER_TYPE_S64: - lttng_msgpack_write_signed_integer(writer, output->u.s); + ret = lttng_msgpack_write_signed_integer(writer, output->u.s); break; case LTTNG_INTERPRETER_TYPE_U64: - lttng_msgpack_write_unsigned_integer(writer, output->u.u); + ret = lttng_msgpack_write_unsigned_integer(writer, output->u.u); break; case LTTNG_INTERPRETER_TYPE_DOUBLE: - lttng_msgpack_write_double(writer, output->u.d); + ret = lttng_msgpack_write_double(writer, output->u.d); break; case LTTNG_INTERPRETER_TYPE_STRING: - lttng_msgpack_write_str(writer, output->u.str.str); + ret = lttng_msgpack_write_str(writer, output->u.str.str); break; case LTTNG_INTERPRETER_TYPE_SEQUENCE: - capture_sequence(writer, output); + ret = capture_sequence(writer, output); break; case LTTNG_INTERPRETER_TYPE_SIGNED_ENUM: case LTTNG_INTERPRETER_TYPE_UNSIGNED_ENUM: - capture_enum(writer, output); + ret = capture_enum(writer, output); break; default: - abort(); + CRIT("Unknown capture output type\n"); + ret = -1; } + return ret; } static -void notification_append_empty_capture( +int notification_append_empty_capture( struct lttng_event_notifier_notification *notif) { - lttng_msgpack_write_nil(¬if->writer); + return lttng_msgpack_write_nil(¬if->writer); } static void record_error(const struct lttng_ust_event_notifier *event_notifier) @@ -359,6 +403,17 @@ } } +/* + * Validate that the buffer has enough room to hold empty capture fields. + */ +static +bool validate_buffer_len(struct lttng_event_notifier_notification *notif, size_t captures_left) +{ + if (notif->writer.end_write_pos - notif->writer.write_pos < MSG_WRITE_NIL_LEN * captures_left) + return false; + return true; +} + void lttng_event_notifier_notification_send( const struct lttng_ust_event_notifier *event_notifier, const char *stack_data, @@ -370,8 +425,14 @@ * allocation in this context. */ struct lttng_event_notifier_notification notif = {0}; + size_t captures_left; + + if (notification_init(¬if, event_notifier)) + goto error; - notification_init(¬if, event_notifier); + captures_left = event_notifier->priv->num_captures; + if (!validate_buffer_len(¬if, captures_left)) + goto error; if (caa_unlikely(notif_ctx->eval_capture)) { struct lttng_ust_bytecode_runtime *capture_bc_runtime; @@ -385,18 +446,41 @@ cds_list_for_each_entry_rcu(capture_bc_runtime, &event_notifier->priv->capture_bytecode_runtime_head, node) { struct lttng_interpreter_output output; + uint8_t *save_pos; + int ret = -1; + lttng_msgpack_save_writer_pos(¬if.writer, &save_pos); if (capture_bc_runtime->interpreter_func(capture_bc_runtime, stack_data, probe_ctx, &output) == LTTNG_UST_BYTECODE_INTERPRETER_OK) - notification_append_capture(¬if, &output); - else - notification_append_empty_capture(¬if); + ret = notification_append_capture(¬if, &output); + if (ret || !validate_buffer_len(¬if, captures_left)) { + /* + * On append capture error or if the generated + * buffer data would not leave enough room to + * write empty capture fields for the remaining + * fields, skip the field capture by restoring + * the msgpack writer position and writing an + * empty capture field. + */ + lttng_msgpack_restore_writer_pos(¬if.writer, save_pos); + ret = notification_append_empty_capture(¬if); + if (ret) + CRIT("Not enough space for empty capture field\n"); + } } } + if (notif.has_captures && lttng_msgpack_end_array(¬if.writer)) + goto error; + /* * Send the notification (including the capture buffer) to the * sessiond. */ notification_send(¬if, event_notifier); + return; + +error: + record_error(event_notifier); + return; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/src/lib/lttng-ust/lttng-bytecode-validator.c new/lttng-ust-2.13.5/src/lib/lttng-ust/lttng-bytecode-validator.c --- old/lttng-ust-2.13.4/src/lib/lttng-ust/lttng-bytecode-validator.c 2022-08-19 22:22:55.000000000 +0200 +++ new/lttng-ust-2.13.5/src/lib/lttng-ust/lttng-bytecode-validator.c 2022-09-30 20:24:51.000000000 +0200 @@ -392,15 +392,8 @@ break; } - /* load field ref */ + /* load field and get context ref */ case BYTECODE_OP_LOAD_FIELD_REF: - { - ERR("Unknown field ref type\n"); - ret = -EINVAL; - break; - } - - /* get context ref */ case BYTECODE_OP_GET_CONTEXT_REF: case BYTECODE_OP_LOAD_FIELD_REF_STRING: case BYTECODE_OP_LOAD_FIELD_REF_SEQUENCE: @@ -1104,60 +1097,28 @@ dbg_printf("Validate load field\n"); break; } + + /* + * Disallow already specialized bytecode op load field instructions to + * ensure that the received bytecode does not read a memory area larger + * than the memory targeted by the instrumentation. + */ case BYTECODE_OP_LOAD_FIELD_S8: - { - dbg_printf("Validate load field s8\n"); - break; - } case BYTECODE_OP_LOAD_FIELD_S16: - { - dbg_printf("Validate load field s16\n"); - break; - } case BYTECODE_OP_LOAD_FIELD_S32: - { - dbg_printf("Validate load field s32\n"); - break; - } case BYTECODE_OP_LOAD_FIELD_S64: - { - dbg_printf("Validate load field s64\n"); - break; - } case BYTECODE_OP_LOAD_FIELD_U8: - { - dbg_printf("Validate load field u8\n"); - break; - } case BYTECODE_OP_LOAD_FIELD_U16: - { - dbg_printf("Validate load field u16\n"); - break; - } case BYTECODE_OP_LOAD_FIELD_U32: - { - dbg_printf("Validate load field u32\n"); - break; - } case BYTECODE_OP_LOAD_FIELD_U64: - { - dbg_printf("Validate load field u64\n"); - break; - } case BYTECODE_OP_LOAD_FIELD_STRING: - { - dbg_printf("Validate load field string\n"); - break; - } case BYTECODE_OP_LOAD_FIELD_SEQUENCE: - { - dbg_printf("Validate load field sequence\n"); - break; - } case BYTECODE_OP_LOAD_FIELD_DOUBLE: { - dbg_printf("Validate load field double\n"); - break; + dbg_printf("Validate load field, reject specialized load instruction (%d)\n", + (int) opcode); + ret = -EINVAL; + goto end; } case BYTECODE_OP_GET_SYMBOL: @@ -1250,6 +1211,236 @@ } /* + * Validate load instructions: specialized instructions not accepted as input. + * + * Return value: + * >0: going to next insn. + * 0: success, stop iteration. + * <0: error + */ +static +int validate_load(char **_next_pc, + char *pc) +{ + int ret = 0; + char *next_pc = *_next_pc; + + switch (*(bytecode_opcode_t *) pc) { + case BYTECODE_OP_UNKNOWN: + default: + { + ERR("Unknown bytecode op %u\n", + (unsigned int) *(bytecode_opcode_t *) pc); + ret = -EINVAL; + goto end; + } + + case BYTECODE_OP_RETURN: + { + next_pc += sizeof(struct return_op); + break; + } + + case BYTECODE_OP_RETURN_S64: + { + next_pc += sizeof(struct return_op); + break; + } + + /* binary */ + case BYTECODE_OP_MUL: + case BYTECODE_OP_DIV: + case BYTECODE_OP_MOD: + case BYTECODE_OP_PLUS: + case BYTECODE_OP_MINUS: + { + ERR("Unsupported bytecode op %u\n", + (unsigned int) *(bytecode_opcode_t *) pc); + ret = -EINVAL; + goto end; + } + + case BYTECODE_OP_EQ: + case BYTECODE_OP_NE: + case BYTECODE_OP_GT: + case BYTECODE_OP_LT: + case BYTECODE_OP_GE: + case BYTECODE_OP_LE: + case BYTECODE_OP_EQ_STRING: + case BYTECODE_OP_NE_STRING: + case BYTECODE_OP_GT_STRING: + case BYTECODE_OP_LT_STRING: + case BYTECODE_OP_GE_STRING: + case BYTECODE_OP_LE_STRING: + case BYTECODE_OP_EQ_STAR_GLOB_STRING: + case BYTECODE_OP_NE_STAR_GLOB_STRING: + case BYTECODE_OP_EQ_S64: + case BYTECODE_OP_NE_S64: + case BYTECODE_OP_GT_S64: + case BYTECODE_OP_LT_S64: + case BYTECODE_OP_GE_S64: + case BYTECODE_OP_LE_S64: + case BYTECODE_OP_EQ_DOUBLE: + case BYTECODE_OP_NE_DOUBLE: + case BYTECODE_OP_GT_DOUBLE: + case BYTECODE_OP_LT_DOUBLE: + case BYTECODE_OP_GE_DOUBLE: + case BYTECODE_OP_LE_DOUBLE: + case BYTECODE_OP_EQ_DOUBLE_S64: + case BYTECODE_OP_NE_DOUBLE_S64: + case BYTECODE_OP_GT_DOUBLE_S64: + case BYTECODE_OP_LT_DOUBLE_S64: + case BYTECODE_OP_GE_DOUBLE_S64: + case BYTECODE_OP_LE_DOUBLE_S64: + case BYTECODE_OP_EQ_S64_DOUBLE: + case BYTECODE_OP_NE_S64_DOUBLE: + case BYTECODE_OP_GT_S64_DOUBLE: + case BYTECODE_OP_LT_S64_DOUBLE: + case BYTECODE_OP_GE_S64_DOUBLE: + case BYTECODE_OP_LE_S64_DOUBLE: + case BYTECODE_OP_BIT_RSHIFT: + case BYTECODE_OP_BIT_LSHIFT: + case BYTECODE_OP_BIT_AND: + case BYTECODE_OP_BIT_OR: + case BYTECODE_OP_BIT_XOR: + { + next_pc += sizeof(struct binary_op); + break; + } + + /* unary */ + case BYTECODE_OP_UNARY_PLUS: + case BYTECODE_OP_UNARY_MINUS: + case BYTECODE_OP_UNARY_PLUS_S64: + case BYTECODE_OP_UNARY_MINUS_S64: + case BYTECODE_OP_UNARY_NOT_S64: + case BYTECODE_OP_UNARY_NOT: + case BYTECODE_OP_UNARY_BIT_NOT: + case BYTECODE_OP_UNARY_PLUS_DOUBLE: + case BYTECODE_OP_UNARY_MINUS_DOUBLE: + case BYTECODE_OP_UNARY_NOT_DOUBLE: + { + next_pc += sizeof(struct unary_op); + break; + } + + /* logical */ + case BYTECODE_OP_AND: + case BYTECODE_OP_OR: + { + next_pc += sizeof(struct logical_op); + break; + } + + /* load field ref */ + case BYTECODE_OP_LOAD_FIELD_REF: + /* get context ref */ + case BYTECODE_OP_GET_CONTEXT_REF: + { + next_pc += sizeof(struct load_op) + sizeof(struct field_ref); + break; + } + case BYTECODE_OP_LOAD_FIELD_REF_STRING: + case BYTECODE_OP_LOAD_FIELD_REF_SEQUENCE: + case BYTECODE_OP_GET_CONTEXT_REF_STRING: + case BYTECODE_OP_LOAD_FIELD_REF_S64: + case BYTECODE_OP_GET_CONTEXT_REF_S64: + case BYTECODE_OP_LOAD_FIELD_REF_DOUBLE: + case BYTECODE_OP_GET_CONTEXT_REF_DOUBLE: + { + /* + * Reject specialized load field ref instructions. + */ + ret = -EINVAL; + goto end; + } + + /* load from immediate operand */ + case BYTECODE_OP_LOAD_STRING: + case BYTECODE_OP_LOAD_STAR_GLOB_STRING: + { + struct load_op *insn = (struct load_op *) pc; + + next_pc += sizeof(struct load_op) + strlen(insn->data) + 1; + break; + } + + case BYTECODE_OP_LOAD_S64: + { + next_pc += sizeof(struct load_op) + sizeof(struct literal_numeric); + break; + } + case BYTECODE_OP_LOAD_DOUBLE: + { + next_pc += sizeof(struct load_op) + sizeof(struct literal_double); + break; + } + + case BYTECODE_OP_CAST_DOUBLE_TO_S64: + case BYTECODE_OP_CAST_TO_S64: + case BYTECODE_OP_CAST_NOP: + { + next_pc += sizeof(struct cast_op); + break; + } + + /* + * Instructions for recursive traversal through composed types. + */ + case BYTECODE_OP_GET_CONTEXT_ROOT: + case BYTECODE_OP_GET_APP_CONTEXT_ROOT: + case BYTECODE_OP_GET_PAYLOAD_ROOT: + case BYTECODE_OP_LOAD_FIELD: + { + next_pc += sizeof(struct load_op); + break; + } + + case BYTECODE_OP_LOAD_FIELD_S8: + case BYTECODE_OP_LOAD_FIELD_S16: + case BYTECODE_OP_LOAD_FIELD_S32: + case BYTECODE_OP_LOAD_FIELD_S64: + case BYTECODE_OP_LOAD_FIELD_U8: + case BYTECODE_OP_LOAD_FIELD_U16: + case BYTECODE_OP_LOAD_FIELD_U32: + case BYTECODE_OP_LOAD_FIELD_U64: + case BYTECODE_OP_LOAD_FIELD_STRING: + case BYTECODE_OP_LOAD_FIELD_SEQUENCE: + case BYTECODE_OP_LOAD_FIELD_DOUBLE: + { + /* + * Reject specialized load field instructions. + */ + ret = -EINVAL; + goto end; + } + + case BYTECODE_OP_GET_SYMBOL: + case BYTECODE_OP_GET_SYMBOL_FIELD: + { + next_pc += sizeof(struct load_op) + sizeof(struct get_symbol); + break; + } + + case BYTECODE_OP_GET_INDEX_U16: + { + next_pc += sizeof(struct load_op) + sizeof(struct get_index_u16); + break; + } + + case BYTECODE_OP_GET_INDEX_U64: + { + next_pc += sizeof(struct load_op) + sizeof(struct get_index_u64); + break; + } + + } +end: + *_next_pc = next_pc; + return ret; +} + +/* * Return value: * >0: going to next insn. * 0: success, stop iteration. @@ -1939,6 +2130,32 @@ return ret; } +int lttng_bytecode_validate_load(struct bytecode_runtime *bytecode) +{ + char *pc, *next_pc, *start_pc; + int ret = -EINVAL; + + start_pc = &bytecode->code[0]; + for (pc = next_pc = start_pc; pc - start_pc < bytecode->len; + pc = next_pc) { + ret = bytecode_validate_overflow(bytecode, start_pc, pc); + if (ret != 0) { + if (ret == -ERANGE) + ERR("Bytecode overflow\n"); + goto end; + } + dbg_printf("Validating loads: op %s (%u)\n", + lttng_bytecode_print_op((unsigned int) *(bytecode_opcode_t *) pc), + (unsigned int) *(bytecode_opcode_t *) pc); + + ret = validate_load(&next_pc, pc); + if (ret) + goto end; + } +end: + return ret; +} + /* * Never called concurrently (hash seed is shared). */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/src/lib/lttng-ust/lttng-bytecode.c new/lttng-ust-2.13.5/src/lib/lttng-ust/lttng-bytecode.c --- old/lttng-ust-2.13.4/src/lib/lttng-ust/lttng-bytecode.c 2022-08-19 22:22:55.000000000 +0200 +++ new/lttng-ust-2.13.5/src/lib/lttng-ust/lttng-bytecode.c 2022-09-30 20:24:51.000000000 +0200 @@ -458,6 +458,11 @@ runtime->len = bytecode->bc.reloc_offset; /* copy original bytecode */ memcpy(runtime->code, bytecode->bc.data, runtime->len); + /* Validate bytecode load instructions before relocs. */ + ret = lttng_bytecode_validate_load(runtime); + if (ret) { + goto link_error; + } /* * apply relocs. Those are a uint16_t (offset in bytecode) * followed by a string (field name). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/src/lib/lttng-ust/lttng-bytecode.h new/lttng-ust-2.13.5/src/lib/lttng-ust/lttng-bytecode.h --- old/lttng-ust-2.13.4/src/lib/lttng-ust/lttng-bytecode.h 2022-08-19 22:22:55.000000000 +0200 +++ new/lttng-ust-2.13.5/src/lib/lttng-ust/lttng-bytecode.h 2022-09-30 20:24:51.000000000 +0200 @@ -324,6 +324,9 @@ int lttng_bytecode_validate(struct bytecode_runtime *bytecode) __attribute__((visibility("hidden"))); +int lttng_bytecode_validate_load(struct bytecode_runtime *bytecode) + __attribute__((visibility("hidden"))); + int lttng_bytecode_specialize(const struct lttng_ust_event_desc *event_desc, struct bytecode_runtime *bytecode) __attribute__((visibility("hidden"))); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/src/lib/lttng-ust/lttng-ust-comm.c new/lttng-ust-2.13.5/src/lib/lttng-ust/lttng-ust-comm.c --- old/lttng-ust-2.13.4/src/lib/lttng-ust/lttng-ust-comm.c 2022-08-19 22:22:55.000000000 +0200 +++ new/lttng-ust-2.13.5/src/lib/lttng-ust/lttng-ust-comm.c 2022-09-30 20:24:51.000000000 +0200 @@ -1582,14 +1582,14 @@ pid = fork(); URCU_TLS(lttng_ust_nest_count)--; if (pid > 0) { - int status; + int status, wait_ret; /* * Parent: wait for child to return, in which case the * shared memory map will have been created. */ - pid = wait(&status); - if (pid < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) { + wait_ret = waitpid(pid, &status, 0); + if (wait_ret < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) { wait_shm_fd = -1; goto end; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/src/lib/lttng-ust-java/Makefile.am new/lttng-ust-2.13.5/src/lib/lttng-ust-java/Makefile.am --- old/lttng-ust-2.13.4/src/lib/lttng-ust-java/Makefile.am 2022-08-19 22:22:55.000000000 +0200 +++ new/lttng-ust-2.13.5/src/lib/lttng-ust-java/Makefile.am 2022-09-30 20:24:51.000000000 +0200 @@ -1,41 +1,52 @@ # SPDX-License-Identifier: LGPL-2.1-only -JAVAROOT = . +JAVAROOT = .build jarfile = liblttng-ust-java.jar jardir = $(datadir)/java pkgpath = org/lttng/ust dist_noinst_JAVA = $(pkgpath)/LTTngUst.java jar_DATA = $(jarfile) -BUILT_SOURCES = org_lttng_ust_LTTngUst.h AM_CPPFLAGS += -I$(builddir) -I$(srcdir) $(JNI_CPPFLAGS) + lib_LTLIBRARIES = liblttng-ust-java.la liblttng_ust_java_la_SOURCES = LTTngUst.c lttng_ust_java.h + +# Generated by javac / javah nodist_liblttng_ust_java_la_SOURCES = org_lttng_ust_LTTngUst.h +# Explicit dependency to ensure the header is generated before the +# C file is built. +LTTngUst.lo: org_lttng_ust_LTTngUst.h + liblttng_ust_java_la_LIBADD = -lc \ $(top_builddir)/src/lib/lttng-ust/liblttng-ust.la $(jarfile): classnoinst.stamp - $(JAR) cf $(JARFLAGS) $@ $(pkgpath)/*.class + $(JAR) cf $(JARFLAGS) $@ -C $(JAVAROOT) $(pkgpath)/LTTngUst.class + +# Ensure the javaroot directory is created before the Java class files are built. +$(pkgpath)/LTTngUst.java: $(JAVAROOT) +$(JAVAROOT): + -test -d $(JAVAROOT) || mkdir $(JAVAROOT) if !HAVE_JAVAH # If we don't have javah, assume we are running openjdk >= 10 and use javac # to generate the jni header file. AM_JAVACFLAGS = -h . -org_lttng_ust_LTTngUst.h: $(jarfile) +# The header file will be generated by javac when building the Java class +# files, add a dependency on the stamp file to ensure proper ordering. +org_lttng_ust_LTTngUst.h: classnoinst.stamp else -org_lttng_ust_LTTngUst.h: jni-header.stamp - -jni-header.stamp: $(dist_noinst_JAVA) - $(JAVAH) -classpath $(srcdir) $(JAVAHFLAGS) org.lttng.ust.LTTngUst && \ - echo "JNI header generated" > jni-header.stamp +org_lttng_ust_LTTngUst.h: + $(JAVAH) -classpath $(srcdir) $(JAVAHFLAGS) org.lttng.ust.LTTngUst endif -all-local: org_lttng_ust_LTTngUst.h - EXTRA_DIST = README -CLEANFILES = $(jarfile) $(pkgpath)/*.class jni-header.stamp org_lttng_ust_LTTngUst.h +CLEANFILES = $(jarfile) org_lttng_ust_LTTngUst.h + +clean-local: + -rm -rf $(JAVAROOT) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lttng-ust-2.13.4/src/lib/lttng-ust-java/Makefile.in new/lttng-ust-2.13.5/src/lib/lttng-ust-java/Makefile.in --- old/lttng-ust-2.13.4/src/lib/lttng-ust-java/Makefile.in 2022-08-19 22:24:32.000000000 +0200 +++ new/lttng-ust-2.13.5/src/lib/lttng-ust-java/Makefile.in 2022-09-30 20:26:51.000000000 +0200 @@ -406,15 +406,16 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -JAVAROOT = . +JAVAROOT = .build jarfile = liblttng-ust-java.jar jardir = $(datadir)/java pkgpath = org/lttng/ust dist_noinst_JAVA = $(pkgpath)/LTTngUst.java jar_DATA = $(jarfile) -BUILT_SOURCES = org_lttng_ust_LTTngUst.h lib_LTLIBRARIES = liblttng-ust-java.la liblttng_ust_java_la_SOURCES = LTTngUst.c lttng_ust_java.h + +# Generated by javac / javah nodist_liblttng_ust_java_la_SOURCES = org_lttng_ust_LTTngUst.h liblttng_ust_java_la_LIBADD = -lc \ $(top_builddir)/src/lib/lttng-ust/liblttng-ust.la @@ -424,9 +425,8 @@ # to generate the jni header file. @HAVE_JAVAH_FALSE@AM_JAVACFLAGS = -h . EXTRA_DIST = README -CLEANFILES = $(jarfile) $(pkgpath)/*.class jni-header.stamp org_lttng_ust_LTTngUst.h -all: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) all-am +CLEANFILES = $(jarfile) org_lttng_ust_LTTngUst.h +all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj @@ -660,17 +660,14 @@ fi; \ done check-am: all-am -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(LTLIBRARIES) classnoinst.stamp $(DATA) all-local +check: check-am +all-am: Makefile $(LTLIBRARIES) classnoinst.stamp $(DATA) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(jardir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-exec-am +install: install-am +install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -700,10 +697,9 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ clean-noinstJAVA mostlyclean-am distclean: distclean-am @@ -772,38 +768,47 @@ uninstall-am: uninstall-jarDATA uninstall-libLTLIBRARIES -.MAKE: all check install install-am install-exec install-strip +.MAKE: install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am all-local am--depfiles check \ - check-am clean clean-generic clean-libLTLIBRARIES \ - clean-libtool clean-noinstJAVA cscopelist-am ctags ctags-am \ - distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-jarDATA install-libLTLIBRARIES \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-jarDATA uninstall-libLTLIBRARIES +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ + clean-noinstJAVA cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-jarDATA \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-jarDATA \ + uninstall-libLTLIBRARIES .PRECIOUS: Makefile -$(jarfile): classnoinst.stamp - $(JAR) cf $(JARFLAGS) $@ $(pkgpath)/*.class +# Explicit dependency to ensure the header is generated before the +# C file is built. +LTTngUst.lo: org_lttng_ust_LTTngUst.h -@HAVE_JAVAH_FALSE@org_lttng_ust_LTTngUst.h: $(jarfile) -@HAVE_JAVAH_TRUE@org_lttng_ust_LTTngUst.h: jni-header.stamp +$(jarfile): classnoinst.stamp + $(JAR) cf $(JARFLAGS) $@ -C $(JAVAROOT) $(pkgpath)/LTTngUst.class -@HAVE_JAVAH_TRUE@jni-header.stamp: $(dist_noinst_JAVA) -@HAVE_JAVAH_TRUE@ $(JAVAH) -classpath $(srcdir) $(JAVAHFLAGS) org.lttng.ust.LTTngUst && \ -@HAVE_JAVAH_TRUE@ echo "JNI header generated" > jni-header.stamp +# Ensure the javaroot directory is created before the Java class files are built. +$(pkgpath)/LTTngUst.java: $(JAVAROOT) +$(JAVAROOT): + -test -d $(JAVAROOT) || mkdir $(JAVAROOT) + +# The header file will be generated by javac when building the Java class +# files, add a dependency on the stamp file to ensure proper ordering. +@HAVE_JAVAH_FALSE@org_lttng_ust_LTTngUst.h: classnoinst.stamp +@HAVE_JAVAH_TRUE@org_lttng_ust_LTTngUst.h: +@HAVE_JAVAH_TRUE@ $(JAVAH) -classpath $(srcdir) $(JAVAHFLAGS) org.lttng.ust.LTTngUst -all-local: org_lttng_ust_LTTngUst.h +clean-local: + -rm -rf $(JAVAROOT) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded.