Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package capnproto for openSUSE:Factory checked in at 2022-06-30 13:18:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/capnproto (Old) and /work/SRC/openSUSE:Factory/.capnproto.new.1548 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "capnproto" Thu Jun 30 13:18:40 2022 rev:8 rq:986010 version:0.10.2 Changes: -------- --- /work/SRC/openSUSE:Factory/capnproto/capnproto.changes 2022-06-04 23:27:03.624757302 +0200 +++ /work/SRC/openSUSE:Factory/.capnproto.new.1548/capnproto.changes 2022-06-30 13:18:48.957553791 +0200 @@ -1,0 +2,17 @@ +Thu Jun 30 05:52:05 UTC 2022 - Luigi Baldoni <aloisio@gmx.com> + +- Update to version 0.10.2 + * cmake: adding src/ include path to build + * Allow unused parameter in KJ_STRINGIFY + * Add List::addFront(). + * Don't use deprecated std::iterator + * using absolute includes across library boundary + * Add kj::VectorOutputStream::clear() + * Mention map() and orDefault() in KJ tour + * Fix ASAN problems under Clang 15. + * Add header guards to all headers that were missing them. + * Support permessage-deflate WebSocket Extension + version 0.10.1: + * Add missing header to makefiles. + +------------------------------------------------------------------- Old: ---- capnproto-c++-0.10.0.tar.gz New: ---- capnproto-c++-0.10.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ capnproto.spec ++++++ --- /var/tmp/diff_new_pack.7NnC4J/_old 2022-06-30 13:18:49.337554076 +0200 +++ /var/tmp/diff_new_pack.7NnC4J/_new 2022-06-30 13:18:49.341554079 +0200 @@ -16,9 +16,9 @@ # -%define _libver 0_10_0 +%define _libver 0_10_2 Name: capnproto -Version: 0.10.0 +Version: 0.10.2 Release: 0 Summary: A Data Serialization Format License: MIT ++++++ capnproto-c++-0.10.0.tar.gz -> capnproto-c++-0.10.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/CMakeLists.txt new/capnproto-c++-0.10.2/CMakeLists.txt --- old/capnproto-c++-0.10.0/CMakeLists.txt 2022-06-03 16:38:27.000000000 +0200 +++ new/capnproto-c++-0.10.2/CMakeLists.txt 2022-06-30 00:42:46.000000000 +0200 @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.6) project("Cap'n Proto" CXX) -set(VERSION 0.10.0) +set(VERSION 0.10.2) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/Makefile.am new/capnproto-c++-0.10.2/Makefile.am --- old/capnproto-c++-0.10.0/Makefile.am 2022-05-25 14:55:57.000000000 +0200 +++ new/capnproto-c++-0.10.2/Makefile.am 2022-06-07 15:34:35.000000000 +0200 @@ -177,6 +177,7 @@ src/kj/async-queue.h \ src/kj/main.h \ src/kj/test.h \ + src/kj/win32-api-version.h \ src/kj/windows-sanity.h includekjparse_HEADERS = \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/Makefile.in new/capnproto-c++-0.10.2/Makefile.in --- old/capnproto-c++-0.10.0/Makefile.in 2022-06-03 16:38:33.000000000 +0200 +++ new/capnproto-c++-0.10.2/Makefile.in 2022-06-30 00:42:52.000000000 +0200 @@ -1153,6 +1153,7 @@ src/kj/async-queue.h \ src/kj/main.h \ src/kj/test.h \ + src/kj/win32-api-version.h \ src/kj/windows-sanity.h includekjparse_HEADERS = \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/configure new/capnproto-c++-0.10.2/configure --- old/capnproto-c++-0.10.0/configure 2022-06-03 16:38:32.000000000 +0200 +++ new/capnproto-c++-0.10.2/configure 2022-06-30 00:42:51.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Capn Proto 0.10.0. +# Generated by GNU Autoconf 2.69 for Capn Proto 0.10.2. # # Report bugs to <capnproto@googlegroups.com>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='Capn Proto' PACKAGE_TARNAME='capnproto-c++' -PACKAGE_VERSION='0.10.0' -PACKAGE_STRING='Capn Proto 0.10.0' +PACKAGE_VERSION='0.10.2' +PACKAGE_STRING='Capn Proto 0.10.2' PACKAGE_BUGREPORT='capnproto@googlegroups.com' PACKAGE_URL='' @@ -1367,7 +1367,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 Capn Proto 0.10.0 to adapt to many kinds of systems. +\`configure' configures Capn Proto 0.10.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1438,7 +1438,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Capn Proto 0.10.0:";; + short | recursive ) echo "Configuration of Capn Proto 0.10.2:";; esac cat <<\_ACEOF @@ -1569,7 +1569,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Capn Proto configure 0.10.0 +Capn Proto configure 0.10.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2284,7 +2284,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Capn Proto $as_me 0.10.0, which was +It was created by Capn Proto $as_me 0.10.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3157,7 +3157,7 @@ # Define the identity of the package. PACKAGE='capnproto-c++' - VERSION='0.10.0' + VERSION='0.10.2' cat >>confdefs.h <<_ACEOF @@ -18386,7 +18386,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Capn Proto $as_me 0.10.0, which was +This file was extended by Capn Proto $as_me 0.10.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18452,7 +18452,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Capn Proto config.status 0.10.0 +Capn Proto config.status 0.10.2 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/capnproto-c++-0.10.0/configure.ac new/capnproto-c++-0.10.2/configure.ac --- old/capnproto-c++-0.10.0/configure.ac 2022-06-03 16:38:27.000000000 +0200 +++ new/capnproto-c++-0.10.2/configure.ac 2022-06-30 00:42:46.000000000 +0200 @@ -1,6 +1,6 @@ ## Process this file with autoconf to produce configure. -AC_INIT([Capn Proto],[0.10.0],[capnproto@googlegroups.com],[capnproto-c++]) +AC_INIT([Capn Proto],[0.10.2],[capnproto@googlegroups.com],[capnproto-c++]) AC_CONFIG_SRCDIR([src/capnp/layout.c++]) AC_CONFIG_AUX_DIR([build-aux]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/capnp/c++.capnp.h new/capnproto-c++-0.10.2/src/capnp/c++.capnp.h --- old/capnproto-c++-0.10.0/src/capnp/c++.capnp.h 2022-06-03 16:38:27.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/capnp/c++.capnp.h 2022-06-30 00:42:46.000000000 +0200 @@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #include <kj/windows-sanity.h> -#if CAPNP_VERSION != 10000 +#if CAPNP_VERSION != 10002 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/capnp/common.h new/capnproto-c++-0.10.2/src/capnp/common.h --- old/capnproto-c++-0.10.0/src/capnp/common.h 2022-06-03 16:38:27.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/capnp/common.h 2022-06-30 00:42:46.000000000 +0200 @@ -48,7 +48,7 @@ #define CAPNP_VERSION_MAJOR 0 #define CAPNP_VERSION_MINOR 10 -#define CAPNP_VERSION_MICRO 0 +#define CAPNP_VERSION_MICRO 2 #define CAPNP_VERSION \ (CAPNP_VERSION_MAJOR * 1000000 + CAPNP_VERSION_MINOR * 1000 + CAPNP_VERSION_MICRO) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/capnp/compat/json.capnp.h new/capnproto-c++-0.10.2/src/capnp/compat/json.capnp.h --- old/capnproto-c++-0.10.0/src/capnp/compat/json.capnp.h 2022-06-03 16:38:27.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/capnp/compat/json.capnp.h 2022-06-30 00:42:46.000000000 +0200 @@ -9,7 +9,7 @@ #include <capnp/capability.h> #endif // !CAPNP_LITE -#if CAPNP_VERSION != 10000 +#if CAPNP_VERSION != 10002 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/capnp/compat/json.h new/capnproto-c++-0.10.2/src/capnp/compat/json.h --- old/capnproto-c++-0.10.0/src/capnp/compat/json.h 2021-03-20 19:47:34.000000000 +0100 +++ new/capnproto-c++-0.10.2/src/capnp/compat/json.h 2022-06-29 18:37:00.000000000 +0200 @@ -25,6 +25,8 @@ #include <capnp/dynamic.h> #include <capnp/compat/json.capnp.h> +CAPNP_BEGIN_HEADER + namespace capnp { typedef json::Value JsonValue; @@ -523,3 +525,5 @@ } } // namespace capnp + +CAPNP_END_HEADER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/capnp/compat/std-iterator.h new/capnproto-c++-0.10.2/src/capnp/compat/std-iterator.h --- old/capnproto-c++-0.10.0/src/capnp/compat/std-iterator.h 2020-04-22 19:50:38.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/capnp/compat/std-iterator.h 2022-06-29 18:37:00.000000000 +0200 @@ -29,6 +29,8 @@ #include "../list.h" #include <iterator> +CAPNP_BEGIN_HEADER + namespace std { template <typename Container, typename Element> @@ -37,3 +39,4 @@ } // namespace std +CAPNP_END_HEADER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/capnp/compat/websocket-rpc.h new/capnproto-c++-0.10.2/src/capnp/compat/websocket-rpc.h --- old/capnproto-c++-0.10.0/src/capnp/compat/websocket-rpc.h 2021-08-08 19:08:05.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/capnp/compat/websocket-rpc.h 2022-06-29 18:37:00.000000000 +0200 @@ -24,6 +24,8 @@ #include <kj/compat/http.h> #include <capnp/serialize-async.h> +CAPNP_BEGIN_HEADER + namespace capnp { class WebSocketMessageStream final : public MessageStream { @@ -51,3 +53,5 @@ }; } // namespace capnp + +CAPNP_END_HEADER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/capnp/compiler/grammar.capnp.h new/capnproto-c++-0.10.2/src/capnp/compiler/grammar.capnp.h --- old/capnproto-c++-0.10.0/src/capnp/compiler/grammar.capnp.h 2022-06-03 16:38:27.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/capnp/compiler/grammar.capnp.h 2022-06-30 00:42:46.000000000 +0200 @@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #include <kj/windows-sanity.h> -#if CAPNP_VERSION != 10000 +#if CAPNP_VERSION != 10002 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/capnp/compiler/lexer.capnp.h new/capnproto-c++-0.10.2/src/capnp/compiler/lexer.capnp.h --- old/capnproto-c++-0.10.0/src/capnp/compiler/lexer.capnp.h 2022-06-03 16:38:27.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/capnp/compiler/lexer.capnp.h 2022-06-30 00:42:46.000000000 +0200 @@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #include <kj/windows-sanity.h> -#if CAPNP_VERSION != 10000 +#if CAPNP_VERSION != 10002 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/capnp/compiler/type-id.h new/capnproto-c++-0.10.2/src/capnp/compiler/type-id.h --- old/capnproto-c++-0.10.0/src/capnp/compiler/type-id.h 2018-08-26 03:41:52.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/capnp/compiler/type-id.h 2022-06-29 18:37:00.000000000 +0200 @@ -25,6 +25,8 @@ #include <kj/array.h> #include <capnp/common.h> +CAPNP_BEGIN_HEADER + namespace capnp { namespace compiler { @@ -40,3 +42,5 @@ } // namespace compiler } // namespace capnp + +CAPNP_END_HEADER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/capnp/membrane.h new/capnproto-c++-0.10.2/src/capnp/membrane.h --- old/capnproto-c++-0.10.0/src/capnp/membrane.h 2021-03-20 19:47:34.000000000 +0100 +++ new/capnproto-c++-0.10.2/src/capnp/membrane.h 2022-06-29 18:37:00.000000000 +0200 @@ -49,6 +49,8 @@ #include "capability.h" +CAPNP_BEGIN_HEADER + namespace capnp { class MembranePolicy { @@ -275,3 +277,5 @@ } } // namespace capnp + +CAPNP_END_HEADER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/capnp/persistent.capnp.h new/capnproto-c++-0.10.2/src/capnp/persistent.capnp.h --- old/capnproto-c++-0.10.0/src/capnp/persistent.capnp.h 2022-06-03 16:38:27.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/capnp/persistent.capnp.h 2022-06-30 00:42:46.000000000 +0200 @@ -9,7 +9,7 @@ #include <capnp/capability.h> #endif // !CAPNP_LITE -#if CAPNP_VERSION != 10000 +#if CAPNP_VERSION != 10002 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/capnp/rpc-twoparty.capnp.h new/capnproto-c++-0.10.2/src/capnp/rpc-twoparty.capnp.h --- old/capnproto-c++-0.10.0/src/capnp/rpc-twoparty.capnp.h 2022-06-03 16:38:27.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/capnp/rpc-twoparty.capnp.h 2022-06-30 00:42:46.000000000 +0200 @@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #include <kj/windows-sanity.h> -#if CAPNP_VERSION != 10000 +#if CAPNP_VERSION != 10002 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/capnp/rpc.capnp.h new/capnproto-c++-0.10.2/src/capnp/rpc.capnp.h --- old/capnproto-c++-0.10.0/src/capnp/rpc.capnp.h 2022-06-03 16:38:27.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/capnp/rpc.capnp.h 2022-06-30 00:42:46.000000000 +0200 @@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #include <kj/windows-sanity.h> -#if CAPNP_VERSION != 10000 +#if CAPNP_VERSION != 10002 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/capnp/schema.capnp.h new/capnproto-c++-0.10.2/src/capnp/schema.capnp.h --- old/capnproto-c++-0.10.0/src/capnp/schema.capnp.h 2022-06-03 16:38:27.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/capnp/schema.capnp.h 2022-06-30 00:42:46.000000000 +0200 @@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #include <kj/windows-sanity.h> -#if CAPNP_VERSION != 10000 +#if CAPNP_VERSION != 10002 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/capnp/stream.capnp.h new/capnproto-c++-0.10.2/src/capnp/stream.capnp.h --- old/capnproto-c++-0.10.0/src/capnp/stream.capnp.h 2022-06-03 16:38:27.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/capnp/stream.capnp.h 2022-06-30 00:42:46.000000000 +0200 @@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #include <kj/windows-sanity.h> -#if CAPNP_VERSION != 10000 +#if CAPNP_VERSION != 10002 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/kj/CMakeLists.txt new/capnproto-c++-0.10.2/src/kj/CMakeLists.txt --- old/capnproto-c++-0.10.0/src/kj/CMakeLists.txt 2022-05-25 14:55:57.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/kj/CMakeLists.txt 2022-06-07 15:34:35.000000000 +0200 @@ -64,6 +64,7 @@ filesystem.h time.h main.h + win32-api-version.h windows-sanity.h ) set(kj-parse_headers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/kj/async-io-internal.h new/capnproto-c++-0.10.2/src/kj/async-io-internal.h --- old/capnproto-c++-0.10.0/src/kj/async-io-internal.h 2018-08-26 03:41:52.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/kj/async-io-internal.h 2022-06-29 18:37:00.000000000 +0200 @@ -26,6 +26,8 @@ #include "async-io.h" #include <stdint.h> +KJ_BEGIN_HEADER + struct sockaddr; struct sockaddr_un; @@ -86,3 +88,5 @@ } // namespace _ (private) } // namespace kj + +KJ_END_HEADER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/kj/async-test.c++ new/capnproto-c++-0.10.2/src/kj/async-test.c++ --- old/capnproto-c++-0.10.0/src/kj/async-test.c++ 2022-05-25 14:55:57.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/kj/async-test.c++ 2022-06-29 18:37:00.000000000 +0200 @@ -1162,7 +1162,12 @@ if (i1_local == nullptr) { i1_local = &i; } else { +#if !KJ_HAS_COMPILER_FEATURE(address_sanitizer) + // Verify that the stack variable is in the exact same spot as before. + // May not work under ASAN as the instrumentation to detect stack-use-after-return can + // change the address. KJ_ASSERT(i1_local == &i); +#endif } return i; }); @@ -1173,7 +1178,9 @@ if (i2_local == nullptr) { i2_local = &i; } else { +#if !KJ_HAS_COMPILER_FEATURE(address_sanitizer) KJ_ASSERT(i2_local == &i); +#endif } return i; }); @@ -1210,9 +1217,24 @@ bool onOurStack(char* p) { // If p points less than 64k away from a random stack variable, then it must be on the same // stack, since we never allocate stacks smaller than 64k. +#if KJ_HAS_COMPILER_FEATURE(address_sanitizer) + // The stack-use-after-return detection mechanism breaks our ability to check this, so don't. + return true; +#else char c; ptrdiff_t diff = p - &c; return diff < 65536 && diff > -65536; +#endif +} + +bool notOnOurStack(char* p) { + // Opposite of onOurStack(), except returns true if the check can't be performed. +#if KJ_HAS_COMPILER_FEATURE(address_sanitizer) + // The stack-use-after-return detection mechanism breaks our ability to check this, so don't. + return true; +#else + return !onOurStack(p); +#endif } KJ_TEST("fiber pool runSynchronously()") { @@ -1240,11 +1262,14 @@ }); KJ_ASSERT(ptr2 != nullptr); +#if !KJ_HAS_COMPILER_FEATURE(address_sanitizer) // Should have used the same stack both times, so local var would be in the same place. + // Under ASAN, the stack-use-after-return detection correctly fires on this, so we skip the check. KJ_EXPECT(ptr1 == ptr2); +#endif // Should have been on a different stack from the main stack. - KJ_EXPECT(!onOurStack(ptr1)); + KJ_EXPECT(notOnOurStack(ptr1)); KJ_EXPECT_THROW_MESSAGE("test exception", pool.runSynchronously([&]() { KJ_FAIL_ASSERT("test exception"); })); @@ -1298,7 +1323,7 @@ // is the one from the thread. pool.runSynchronously([&]() { KJ_EXPECT(onOurStack(ptr2)); - KJ_EXPECT(!onOurStack(ptr1)); + KJ_EXPECT(notOnOurStack(ptr1)); KJ_EXPECT(pool.getFreelistSize() == 0); }); @@ -1369,15 +1394,15 @@ // The event callbacks should have run on a different stack, but the wait should have been on // the main stack. - KJ_EXPECT(!onOurStack(ptr1)); - KJ_EXPECT(!onOurStack(ptr2)); + KJ_EXPECT(notOnOurStack(ptr1)); + KJ_EXPECT(notOnOurStack(ptr2)); KJ_EXPECT(onOurStack(port.waitStack)); pool.runSynchronously([&]() { // This should run on the same stack where the event callbacks ran. KJ_EXPECT(onOurStack(ptr1)); KJ_EXPECT(onOurStack(ptr2)); - KJ_EXPECT(!onOurStack(port.waitStack)); + KJ_EXPECT(notOnOurStack(port.waitStack)); }); } @@ -1410,8 +1435,8 @@ // The event callback should have run on a different stack, and poll() should have run on // a separate stack too. - KJ_EXPECT(!onOurStack(ptr1)); - KJ_EXPECT(!onOurStack(port.pollStack)); + KJ_EXPECT(notOnOurStack(ptr1)); + KJ_EXPECT(notOnOurStack(port.pollStack)); pool.runSynchronously([&]() { // This should run on the same stack where the event callbacks ran. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/kj/async-win32.h new/capnproto-c++-0.10.2/src/kj/async-win32.h --- old/capnproto-c++-0.10.0/src/kj/async-win32.h 2022-05-25 14:55:57.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/kj/async-win32.h 2022-06-29 18:37:00.000000000 +0200 @@ -38,6 +38,8 @@ #include <windows.h> #include "windows-sanity.h" +KJ_BEGIN_HEADER + namespace kj { class Win32EventPort: public EventPort { @@ -227,3 +229,5 @@ }; } // namespace kj + +KJ_END_HEADER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/kj/async.c++ new/capnproto-c++-0.10.2/src/kj/async.c++ --- old/capnproto-c++-0.10.0/src/kj/async.c++ 2022-05-25 14:55:57.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/kj/async.c++ 2022-06-29 18:37:00.000000000 +0200 @@ -78,6 +78,19 @@ #include <stdlib.h> +#if KJ_HAS_COMPILER_FEATURE(address_sanitizer) +// Clang's address sanitizer requires special hints when switching fibers, especially in order for +// stack-use-after-return handling to work right. +// +// TODO(someday): Does GCC's sanitizer, flagged by __SANITIZE_ADDRESS__, have these hints too? I +// don't know and am not in a position to test, so I'm assuming not for now. +#include <sanitizer/common_interface_defs.h> +#else +// Nop the hints so that we don't have to put #ifdefs around every use. +#define __sanitizer_start_switch_fiber(...) +#define __sanitizer_finish_switch_fiber(...) +#endif + #if _MSC_VER && !__clang__ // MSVC's atomic intrinsics are weird and different, whereas the C++ standard atomics match the GCC // builtins -- except for requiring the obnoxious std::atomic<T> wrapper. So, on MSVC let's just @@ -1330,6 +1343,23 @@ jmp_buf fiberJmpBuf; jmp_buf originalJmpBuf; +#if KJ_HAS_COMPILER_FEATURE(address_sanitizer) + // Stuff that we need to pass to __sanitizer_start_switch_fiber() / + // __sanitizer_finish_switch_fiber() when using ASAN. + + void* originalFakeStack = nullptr; + void* fiberFakeStack = nullptr; + // Pointer to ASAN "fake stack" associated with the fiber and its calling stack. Filled in by + // __sanitizer_start_switch_fiber() before switching away, consumed by + // __sanitizer_finish_switch_fiber() upon switching back. + + void const* originalBottom; + size_t originalSize; + // Size and location of the original stack before switching fibers. These are filled in by + // __sanitizer_finish_switch_fiber() after the switch, and must be passed to + // __sanitizer_start_switch_fiber() when switching back later. +#endif + static Impl* alloc(size_t stackSize, ucontext_t* context) { #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON @@ -1423,6 +1453,9 @@ auto& stack = *reinterpret_cast<FiberStack*>(ptr); + __sanitizer_finish_switch_fiber(nullptr, + &stack.impl->originalBottom, &stack.impl->originalSize); + // We first switch to the fiber inside of the FiberStack constructor. This is just for // initialization purposes, and we're expected to switch back immediately. stack.switchToMain(); @@ -1478,9 +1511,11 @@ makecontext(&context, reinterpret_cast<void(*)()>(&StartRoutine::run), 2, arg1, arg2); + __sanitizer_start_switch_fiber(&impl->originalFakeStack, impl, stackSize - sizeof(Impl)); if (_setjmp(impl->originalJmpBuf) == 0) { setcontext(&context); } + __sanitizer_finish_switch_fiber(impl->originalFakeStack, nullptr, nullptr); #endif #else #if KJ_NO_EXCEPTIONS @@ -1577,9 +1612,11 @@ #if _WIN32 || __CYGWIN__ SwitchToFiber(osFiber); #else + __sanitizer_start_switch_fiber(&impl->originalFakeStack, impl, stackSize - sizeof(Impl)); if (_setjmp(impl->originalJmpBuf) == 0) { _longjmp(impl->fiberJmpBuf, 1); } + __sanitizer_finish_switch_fiber(impl->originalFakeStack, nullptr, nullptr); #endif #endif } @@ -1590,9 +1627,21 @@ #if _WIN32 || __CYGWIN__ SwitchToFiber(getMainWin32Fiber()); #else + // TODO(someady): In theory, the last time we switch away from the fiber, we should pass `nullptr` + // for the first argument here, so that ASAN destroys the fake stack. However, as currently + // designed, we don't actually know if we're switching away for the last time. It's understood + // that when we call switchToMain() in FiberStack::run(), then the main stack is allowed to + // destroy the fiber, or reuse it. I don't want to develop a mechanism to switch back to the + // fiber on final destruction just to get the hints right, so instead we leak the fake stack. + // This doesn't seem to cause any problems -- it's not even detected by ASAN as a memory leak. + // But if we wanted to run ASAN builds in production or something, it might be an issue. + __sanitizer_start_switch_fiber(&impl->fiberFakeStack, + impl->originalBottom, impl->originalSize); if (_setjmp(impl->fiberJmpBuf) == 0) { _longjmp(impl->originalJmpBuf, 1); } + __sanitizer_finish_switch_fiber(impl->fiberFakeStack, + &impl->originalBottom, &impl->originalSize); #endif #endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/kj/compat/gtest.h new/capnproto-c++-0.10.2/src/kj/compat/gtest.h --- old/capnproto-c++-0.10.0/src/kj/compat/gtest.h 2018-08-26 03:41:52.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/kj/compat/gtest.h 2022-06-29 18:37:00.000000000 +0200 @@ -32,6 +32,8 @@ #include "../test.h" #include <kj/windows-sanity.h> // work-around macro conflict with `ERROR` +KJ_BEGIN_HEADER + namespace kj { namespace _ { // private @@ -118,3 +120,5 @@ #define TEST(x, y) KJ_TEST("legacy test: " #x "/" #y) } // namespace kj + +KJ_END_HEADER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/kj/compat/gzip.h new/capnproto-c++-0.10.2/src/kj/compat/gzip.h --- old/capnproto-c++-0.10.0/src/kj/compat/gzip.h 2021-08-08 19:08:05.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/kj/compat/gzip.h 2022-06-29 18:37:00.000000000 +0200 @@ -25,6 +25,8 @@ #include <kj/async-io.h> #include <zlib.h> +KJ_BEGIN_HEADER + namespace kj { namespace _ { // private @@ -140,3 +142,5 @@ }; } // namespace kj + +KJ_END_HEADER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/kj/compat/http.h new/capnproto-c++-0.10.2/src/kj/compat/http.h --- old/capnproto-c++-0.10.0/src/kj/compat/http.h 2022-05-25 14:55:57.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/kj/compat/http.h 2022-06-29 18:37:00.000000000 +0200 @@ -40,6 +40,8 @@ #include <kj/one-of.h> #include <kj/async-io.h> +KJ_BEGIN_HEADER + namespace kj { #define KJ_HTTP_FOR_EACH_METHOD(MACRO) \ @@ -1154,3 +1156,5 @@ } } // namespace kj + +KJ_END_HEADER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/kj/compat/readiness-io.h new/capnproto-c++-0.10.2/src/kj/compat/readiness-io.h --- old/capnproto-c++-0.10.0/src/kj/compat/readiness-io.h 2022-05-25 14:55:55.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/kj/compat/readiness-io.h 2022-06-29 18:37:00.000000000 +0200 @@ -23,6 +23,8 @@ #include <kj/async-io.h> +KJ_BEGIN_HEADER + namespace kj { class ReadyInputStreamWrapper { @@ -122,3 +124,5 @@ }; } // namespace kj + +KJ_END_HEADER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/kj/compat/tls.h new/capnproto-c++-0.10.2/src/kj/compat/tls.h --- old/capnproto-c++-0.10.0/src/kj/compat/tls.h 2022-05-25 14:55:57.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/kj/compat/tls.h 2022-06-29 18:37:00.000000000 +0200 @@ -30,6 +30,8 @@ #include <kj/async-io.h> +KJ_BEGIN_HEADER + namespace kj { class TlsPrivateKey; @@ -296,3 +298,5 @@ }; } // namespace kj + +KJ_END_HEADER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/kj/compat/url.h new/capnproto-c++-0.10.2/src/kj/compat/url.h --- old/capnproto-c++-0.10.0/src/kj/compat/url.h 2021-03-20 19:47:34.000000000 +0100 +++ new/capnproto-c++-0.10.2/src/kj/compat/url.h 2022-06-29 18:37:00.000000000 +0200 @@ -25,6 +25,8 @@ #include <kj/vector.h> #include <inttypes.h> +KJ_BEGIN_HEADER + namespace kj { struct UrlOptions { @@ -145,3 +147,5 @@ }; } // namespace kj + +KJ_END_HEADER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/kj/exception-test.c++ new/capnproto-c++-0.10.2/src/kj/exception-test.c++ --- old/capnproto-c++-0.10.0/src/kj/exception-test.c++ 2022-05-25 14:55:57.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/kj/exception-test.c++ 2022-06-29 18:37:00.000000000 +0200 @@ -132,10 +132,16 @@ } #endif +#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) || \ + KJ_HAS_COMPILER_FEATURE(address_sanitizer) || \ + defined(__SANITIZE_ADDRESS__) +// The implementation skips this check in these cases. +#else #if !__MINGW32__ // Inexplicably crashes when exception is thrown from constructor. TEST(Exception, ExceptionCallbackMustBeOnStack) { KJ_EXPECT_THROW_MESSAGE("must be allocated on the stack", new ExceptionCallback); } +#endif #endif // !__MINGW32__ #if !KJ_NO_EXCEPTIONS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/kj/exception.c++ new/capnproto-c++-0.10.2/src/kj/exception.c++ --- old/capnproto-c++-0.10.0/src/kj/exception.c++ 2022-05-25 14:55:57.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/kj/exception.c++ 2022-06-29 18:37:53.000000000 +0200 @@ -971,7 +971,11 @@ ExceptionCallback::ExceptionCallback(): next(getExceptionCallback()) { char stackVar; -#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION +#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) || \ + KJ_HAS_COMPILER_FEATURE(address_sanitizer) || \ + defined(__SANITIZE_ADDRESS__) + // When using libfuzzer or ASAN, this sanity check may spurriously fail, so skip it. +#else ptrdiff_t offset = reinterpret_cast<char*>(this) - &stackVar; KJ_ASSERT(offset < 65536 && offset > -65536, "ExceptionCallback must be allocated on the stack."); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/kj/filesystem.h new/capnproto-c++-0.10.2/src/kj/filesystem.h --- old/capnproto-c++-0.10.0/src/kj/filesystem.h 2022-05-25 14:55:57.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/kj/filesystem.h 2022-06-29 18:37:00.000000000 +0200 @@ -28,6 +28,8 @@ #include "function.h" #include "hash.h" +KJ_BEGIN_HEADER + namespace kj { template <typename T> @@ -1110,3 +1112,5 @@ } } // namespace kj + +KJ_END_HEADER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/kj/source-location.h new/capnproto-c++-0.10.2/src/kj/source-location.h --- old/capnproto-c++-0.10.0/src/kj/source-location.h 2022-05-25 14:55:57.000000000 +0200 +++ new/capnproto-c++-0.10.2/src/kj/source-location.h 2022-06-29 18:37:00.000000000 +0200 @@ -23,6 +23,8 @@ #include "string.h" +KJ_BEGIN_HEADER + // GCC does not implement __builtin_COLUMN() as that's non-standard but MSVC & clang do. // MSVC does as of version https://github.com/microsoft/STL/issues/54) but there's currently not any // pressing need for this for MSVC & writing the write compiler version check is annoying. @@ -105,3 +107,5 @@ return kj::String(); } } // namespace kj + +KJ_END_HEADER diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/capnproto-c++-0.10.0/src/kj/win32-api-version.h new/capnproto-c++-0.10.2/src/kj/win32-api-version.h --- old/capnproto-c++-0.10.0/src/kj/win32-api-version.h 1970-01-01 01:00:00.000000000 +0100 +++ new/capnproto-c++-0.10.2/src/kj/win32-api-version.h 2021-03-20 19:47:34.000000000 +0100 @@ -0,0 +1,44 @@ +// Copyright (c) 2013-2017 Sandstorm Development Group, Inc. and contributors +// Licensed under the MIT License: +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#pragma once + +// Request Vista-level APIs. +#ifndef WINVER +#define WINVER 0x0600 +#elif WINVER < 0x0600 +#error "WINVER defined but older than Vista" +#endif + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0600 +#elif _WIN32_WINNT < 0x0600 +#error "_WIN32_WINNT defined but older than Vista" +#endif + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN // ::eyeroll:: +#endif + +#define NOSERVICE 1 +#define NOMCX 1 +#define NOIME 1 +#define NOMINMAX 1