From fd04338327dd7b2f397f31ef609a97900e06d028 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Thu, 29 Sep 2016 10:39:47 +0200 Subject: [PATCH 1/7] Do not overflow buffer in strncat --- sysbench/scripting/script_lua.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysbench/scripting/script_lua.c b/sysbench/scripting/script_lua.c index 108dd3b..0a53de6 100644 --- a/sysbench/scripting/script_lua.c +++ b/sysbench/scripting/script_lua.c @@ -498,11 +498,11 @@ lua_State *sb_lua_new_state(const char *scriptname, int thread_id) /* first location failed - look in DATA_PATH */ char p[PATH_MAX + 1]; strncpy(p, DATA_PATH LUA_DIRSEP, sizeof(p)); - strncat(p, scriptname, sizeof(p)); + strncat(p, scriptname, sizeof(p)-strlen(p)-1); if (!strrchr(scriptname, '.')) { /* add .lua extension if there isn't one */ - strncat(p, ".lua", sizeof(p)); + strncat(p, ".lua", sizeof(p)-strlen(p)-1); } if (luaL_loadfile(state, p)) From 8a11204c87c5325eb28df4af8b3f04021407eeeb Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Mon, 10 Oct 2016 21:53:39 +0300 Subject: [PATCH 2/7] Add README-Oracle.md to EXTRA_DIST. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 3a9898b..cf70274 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,7 +19,7 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = doc sysbench tests -EXTRA_DIST = autogen.sh README.md README-WIN.txt ChangeLog +EXTRA_DIST = autogen.sh README.md README-WIN.txt README-Oracle.md ChangeLog test: cd tests && $(MAKE) test From f2bfdc7f2d7493acd67b3df31752a18d81034608 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Tue, 11 Oct 2016 09:21:58 +0300 Subject: [PATCH 3/7] Don't use caches, as they may cause issues on PostgreSQL updates. --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4543239..b891b94 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,4 @@ language: c -cache: - directories: - - $HOME/.cache/pip - - /usr/local os: - linux From 81c3ea47a69679222aa395e90d7970c0c8c2e685 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Wed, 12 Oct 2016 11:38:03 +0300 Subject: [PATCH 4/7] Fix PostgreSQL upgrade issues in Travis CI. --- .travis.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4543239..53f8c8e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,10 +31,16 @@ before_install: brew uninstall libtool brew update --quiet brew install libtool mysql + # OS X requires servers to be started explicitly brew services start mysql + + # Avoid PostgreSQL upgrade woes, just recreate the database + rm -rf /usr/local/var/postgres + brew postinstall postgresql + pg_ctl -wD /usr/local/var/postgres start - createuser -s postgres; + createuser -s postgres ;; esac @@ -49,8 +55,8 @@ install: esac before_script: - - mysql -u root -e 'CREATE DATABASE sbtest;' - - psql -U postgres -c 'CREATE DATABASE sbtest;' + - mysql -u root -e 'CREATE DATABASE sbtest' + - psql -U postgres -c 'CREATE DATABASE sbtest' script: - ./autogen.sh && ./configure --enable-coverage --with-mysql --with-pgsql From 25c10a01991a69073daded39d0be764f4cc99b77 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Wed, 12 Oct 2016 11:49:03 +0300 Subject: [PATCH 5/7] Adjust test_threads.t to not fail on slow hosts in Travis CI. --- tests/t/test_threads.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/t/test_threads.t b/tests/t/test_threads.t index 12b02db..1c64404 100644 --- a/tests/t/test_threads.t +++ b/tests/t/test_threads.t @@ -33,10 +33,10 @@ threads benchmark tests total number of events: 100 total time taken by event execution: *s (glob) response time: - min: *ms (glob) - avg: *ms (glob) - max: *ms (glob) - approx. 95 percentile: *ms (glob) + min: *ms (glob) + avg: *ms (glob) + max: *ms (glob) + approx. 95 percentile: *ms (glob) Threads fairness: events (avg/stddev): */* (glob) From 21029a6b42dd94faad3a56e256985027fe635db4 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Wed, 12 Oct 2016 12:57:22 +0300 Subject: [PATCH 6/7] Add Emacs and Vi modelines in .travis.yml. --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5ffc822..a136d54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,7 @@ +# vim ft=yaml +# +# Travis CI configuration + language: c os: @@ -62,3 +66,7 @@ script: after_success: - coveralls --gcov-options '\-lp' + +# Local variables: +# mode: yaml +# End: From bd237c73bf51de29a50b46a05fb093f26cef4103 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Fri, 14 Oct 2016 08:05:34 +0300 Subject: [PATCH 7/7] Fix Sun Studio + Solaris/Sparc builds. --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 618dfef..6ae7ec7 100644 --- a/configure.ac +++ b/configure.ac @@ -55,7 +55,7 @@ AC_ARG_WITH([extra-ldflags], ) AC_SUBST(EXTRA_LDFLAGS) -CPPFLAGS="-D_XOPEN_SOURCE=500 -D_GNU_SOURCE ${CPPFLAGS}" +CPPFLAGS="-D_GNU_SOURCE ${CPPFLAGS}" # Mac OS X requires _DARWIN_C_SOURCE for valloc(3) to be visible case "${host_cpu}-${host_os}" in @@ -440,7 +440,7 @@ then fi if test "$SUNCC" = "yes" then - CC_WARNINGS="-v -errtags=yes -errwarn=%all -erroff=E_INTEGER_OVERFLOW_DETECTED" + CC_WARNINGS="-v -errtags=yes -errwarn=%all -erroff=E_INTEGER_OVERFLOW_DETECTED -erroff=E_STATEMENT_NOT_REACHED" fi AM_CFLAGS="${CC_WARNINGS} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${AM_CFLAGS} ${PTHREAD_CFLAGS}"