Changeset: b65903b20094 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b65903b20094 Modified Files: buildtools/ChangeLog.Jul2017 common/utils/mutils.c configure.ag debian/monetdb5-sql.install gdk/gdk_bbp.c gdk/gdk_posix.c gdk/gdk_storage.c monetdb5/mal/mal_linker.c monetdb5/mal/mal_profiler.c monetdb5/mal/mal_resolve.c monetdb5/modules/atoms/blob.c monetdb5/modules/mal/mal_mapi.c monetdb5/optimizer/opt_garbageCollector.c sql/backends/monet5/UDF/pyapi/pyheader.h tools/merovingian/daemon/controlrunner.c tools/merovingian/daemon/handlers.c tools/merovingian/daemon/merovingian.c tools/merovingian/utils/utils.c Branch: default Log Message:
Merge with Jul2017 branch. diffs (truncated from 666 to 300 lines): diff --git a/buildtools/ChangeLog.Jul2017 b/buildtools/ChangeLog.Jul2017 --- a/buildtools/ChangeLog.Jul2017 +++ b/buildtools/ChangeLog.Jul2017 @@ -1,6 +1,10 @@ # ChangeLog file for buildtools # This file is updated with Maddlog +* Mon Jul 24 2017 Sjoerd Mullender <sjo...@acm.org> +- The Debian and Ubuntu installers have been fixed: there was a file + missing in the Jul2017 release. + * Fri Jul 14 2017 Sjoerd Mullender <sjo...@acm.org> - Added a new RPM called MonetDB-selinux which provides the SELinux policy required to run MonetDB under systemd, especially on Fedora 26. diff --git a/common/utils/mutils.c b/common/utils/mutils.c --- a/common/utils/mutils.c +++ b/common/utils/mutils.c @@ -37,6 +37,10 @@ # include <sys/sysctl.h> /* KERN_PROC_PATHNAME on BSD */ #endif +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif + #ifdef NATIVE_WIN32 /* Some definitions that we need to compile on Windows. diff --git a/configure.ag b/configure.ag --- a/configure.ag +++ b/configure.ag @@ -443,7 +443,7 @@ AS_CASE([$host], # it disables, however, the availability of madvise, which is # in use use by GDK, so we cannot just AC_DEFINE this, but # rather have to enable it where it is necessary - MSGCONTROL_FLAGS="-D_XOPEN_SOURCE=500" + MSGCONTROL_FLAGS="-D_XPG4_2" AC_SUBST([MSGCONTROL_FLAGS])]) # (try to) determine compiler type (gcc, icc, clang) (and version) @@ -1950,13 +1950,13 @@ AS_VAR_IF([enable_pyintegration], [no], ], []) ], [PY2CONFIG="$have_py2config"]) PYTHON_CMD=$PYTHON2 - NUMPYVER=`$PYTHON_CMD -c "import numpy; print(int(numpy.__version__.split('.').__getitem__(1)) >= 7)"` + NUMPYVER=`$PYTHON_CMD -c "import numpy; print(int(numpy.__version__.split('.').__getitem__(1)) >= 7)" 2> /dev/null` # check numpyconfig.h because autoconf tests includes by # compiling a small C program, and other numpy headers do # not compile without Python.h AC_CHECK_HEADER([numpy/numpyconfig.h], [NUMPYHEADERS=True], - [NUMPYHEADERS=`$PYTHON_CMD -c "import numpy, os; print(os.path.isfile(os.path.join(numpy.get_include(), 'numpy/arrayobject.h')))"`]) + [NUMPYHEADERS=`$PYTHON_CMD -c "import numpy, os; print(os.path.isfile(os.path.join(numpy.get_include(), 'numpy/arrayobject.h')))" 2> /dev/null`]) AS_IF([test "x$NUMPYVER" = x || test "x$NUMPYVER" = xFalse], [AS_VAR_IF([enable_pyintegration], [yes], [AC_MSG_ERROR([numpy version >= 1.7.0 required for Python integration support])], @@ -1971,9 +1971,9 @@ AS_VAR_IF([enable_pyintegration], [no], why_have_libpy="(numpy/arrayobject.h not found)" enable_pyintegration="no" disable_pyintegration="(numpy/arrayobject.h not found)"])], - [libpy_CFLAGS=`$PYTHON_CMD -c "from distutils.sysconfig import get_python_inc; import numpy; print(' -I' + get_python_inc() + ' -I' + numpy.get_include());"` + [libpy_CFLAGS=`$PYTHON_CMD -c "from distutils.sysconfig import get_python_inc; import numpy; print(' -I' + get_python_inc() + ' -I' + numpy.get_include());" 2> /dev/null` libpy_LIBS=`$PY2CONFIG --ldflags` - HAVEPYTHONHEADER=`$PYTHON_CMD -c "import distutils.sysconfig, os; print(os.path.isfile(os.path.join(distutils.sysconfig.get_python_inc(), 'Python.h')))"` + HAVEPYTHONHEADER=`$PYTHON_CMD -c "import distutils.sysconfig, os; print(os.path.isfile(os.path.join(distutils.sysconfig.get_python_inc(), 'Python.h')))" 2> /dev/null` AS_VAR_IF([HAVEPYTHONHEADER], [True], [have_libpy=yes AC_DEFINE([HAVE_LIBPY], 1, [Define if we can link to python]) @@ -2022,12 +2022,12 @@ if test "x$enable_py3integration" != xno PYTHON_CMD=$PYTHON3 - NUMPYVER=`$PYTHON_CMD -c "import numpy; print(int(numpy.__version__.split('.').__getitem__(1)) >= 7)"` + NUMPYVER=`$PYTHON_CMD -c "import numpy; print(int(numpy.__version__.split('.').__getitem__(1)) >= 7)" 2> /dev/null` # check numpyconfig.h because autoconf tests includes by compiling a small C program, and other numpy headers do not compile without Python.h AC_CHECK_HEADER( [numpy/numpyconfig.h], [NUMPYHEADERS=True], - [NUMPYHEADERS=`$PYTHON_CMD -c "import numpy, os; print(os.path.isfile(os.path.join(numpy.get_include(), 'numpy/arrayobject.h')))"`] + [NUMPYHEADERS=`$PYTHON_CMD -c "import numpy, os; print(os.path.isfile(os.path.join(numpy.get_include(), 'numpy/arrayobject.h')))" 2> /dev/null`] ) if [test "x$NUMPYVER" = x] || [test "x$NUMPYVER" = xFalse]; then if test "x$enable_py3integration" = xyes; then @@ -2048,9 +2048,9 @@ if test "x$enable_py3integration" != xno disable_py3integration="(numpy/arrayobject.h not found)" fi else - libpy3_CFLAGS=`$PYTHON_CMD -c "from distutils.sysconfig import get_python_inc; import numpy; print(' -I' + get_python_inc() + ' -I' + numpy.get_include());"` + libpy3_CFLAGS=`$PYTHON_CMD -c "from distutils.sysconfig import get_python_inc; import numpy; print(' -I' + get_python_inc() + ' -I' + numpy.get_include());" 2> /dev/null` libpy3_LIBS=`$PY3CONFIG --ldflags` - HAVEPYTHONHEADER=`$PYTHON_CMD -c "import distutils.sysconfig, os; print(os.path.isfile(os.path.join(distutils.sysconfig.get_python_inc(), 'Python.h')))"` + HAVEPYTHONHEADER=`$PYTHON_CMD -c "import distutils.sysconfig, os; print(os.path.isfile(os.path.join(distutils.sysconfig.get_python_inc(), 'Python.h')))" 2> /dev/null` if [test "x$HAVEPYTHONHEADER" = xTrue]; then have_libpy3=yes AC_DEFINE(HAVE_LIBPY3, 1, [Define if we can link to python]) diff --git a/debian/monetdb5-sql.install b/debian/monetdb5-sql.install --- a/debian/monetdb5-sql.install +++ b/debian/monetdb5-sql.install @@ -6,6 +6,7 @@ debian/tmp/usr/lib/systemd/system/monetd debian/tmp/etc/tmpfiles.d/monetdbd.conf etc/tmpfiles.d # usr/lib/monetdb5/sql*.mal EXCEPT: sql*_hge.mal debian/tmp/usr/lib/monetdb5/sql.mal usr/lib/monetdb5 +debian/tmp/usr/lib/monetdb5/sql[!_]*.mal usr/lib/monetdb5 debian/tmp/usr/lib/monetdb5/sql_aggr_[!h]*.mal usr/lib/monetdb5 debian/tmp/usr/lib/monetdb5/sql_decimal.mal usr/lib/monetdb5 debian/tmp/usr/lib/monetdb5/sql_[!adh]*.mal usr/lib/monetdb5 diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -402,7 +402,7 @@ recover_dir(int farmid, int direxists) static gdk_return BBPrecover(int farmid); static gdk_return BBPrecover_subdir(void); -static int BBPdiskscan(const char *); +static int BBPdiskscan(const char *, size_t); #ifdef GDKLIBRARY_SORTEDPOS static void @@ -1141,7 +1141,7 @@ BBPreadEntries(FILE *fp, int bbpversion) &properties, &count, &capacity, &base, &nread) < 8) - GDKfatal("BBPinit: invalid format for BBP.dir%s", buf); + GDKfatal("BBPinit: invalid format for BBP.dir\n%s", buf); /* convert both / and \ path separators to our own DIR_SEP */ #if DIR_SEP != '/' @@ -1316,6 +1316,31 @@ BBPaddfarm(const char *dirname, int role if (BBPfarms[i].dirname == NULL) { BBPfarms[i].dirname = GDKstrdup(dirname); BBPfarms[i].roles = rolemask; + if ((rolemask & 1) == 0) { + char *bbpdir; + int j; + + for (j = 0; j < i; j++) + if (strcmp(BBPfarms[i].dirname, + BBPfarms[j].dirname) == 0) + return; + /* if an extra farm, make sure we + * don't find a BBP.dir there that + * might belong to an existing + * database */ + bbpdir = GDKfilepath(i, BATDIR, "BBP", "dir"); + if (bbpdir == NULL) + GDKfatal("BBPaddfarm: malloc failed\n"); + if (stat(bbpdir, &st) != -1 || errno != ENOENT) + GDKfatal("BBPaddfarm: %s is a database\n", dirname); + GDKfree(bbpdir); + bbpdir = GDKfilepath(i, BAKDIR, "BBP", "dir"); + if (bbpdir == NULL) + GDKfatal("BBPaddfarm: malloc failed\n"); + if (stat(bbpdir, &st) != -1 || errno != ENOENT) + GDKfatal("BBPaddfarm: %s is a database\n", dirname); + GDKfree(bbpdir); + } return; } } @@ -1344,6 +1369,7 @@ BBPinit(void) int bbpversion; str bbpdirstr = GDKfilepath(0, BATDIR, "BBP", "dir"); str backupbbpdirstr = GDKfilepath(0, BAKDIR, "BBP", "dir"); + int i; #ifdef NEED_MT_LOCK_INIT MT_lock_init(&GDKunloadLock, "GDKunloadLock"); @@ -1408,10 +1434,22 @@ BBPinit(void) GDKfatal("BBPinit: cannot properly prepare process %s. Please check whether your disk is full or write-protected", BAKDIR); /* cleanup any leftovers (must be done after BBPrecover) */ - { - char *d = GDKfilepath(0, NULL, BATDIR, NULL); - BBPdiskscan(d); - GDKfree(d); + for (i = 0; i < MAXFARMS && BBPfarms[i].dirname != NULL; i++) { + int j; + for (j = 0; j < i; j++) { + /* don't clean a directory twice */ + if (BBPfarms[j].dirname && + strcmp(BBPfarms[i].dirname, + BBPfarms[j].dirname) == 0) + break; + } + if (j == i) { + char *d = GDKfilepath(i, NULL, BATDIR, NULL); + if (d == NULL) + GDKfatal("BBPinit: malloc failed\n"); + BBPdiskscan(d, strlen(d) - strlen(BATDIR)); + GDKfree(d); + } } #ifdef GDKLIBRARY_SORTEDPOS @@ -3612,7 +3650,7 @@ getdesc(bat bid) } static int -BBPdiskscan(const char *parent) +BBPdiskscan(const char *parent, size_t baseoff) { DIR *dirp = opendir(parent); struct dirent *dent; @@ -3642,9 +3680,9 @@ BBPdiskscan(const char *parent) continue; /* ignore .dot files and directories (. ..) */ if (strncmp(dent->d_name, "BBP.", 4) == 0 && - (strcmp(parent, BATDIR) == 0 || - strncmp(parent, BAKDIR, strlen(BAKDIR)) == 0 || - strncmp(parent, SUBDIR, strlen(SUBDIR)) == 0)) + (strcmp(parent + baseoff, BATDIR) == 0 || + strncmp(parent + baseoff, BAKDIR, strlen(BAKDIR)) == 0 || + strncmp(parent + baseoff, SUBDIR, strlen(SUBDIR)) == 0)) continue; p = strchr(dent->d_name, '.'); @@ -3656,13 +3694,13 @@ BBPdiskscan(const char *parent) /* found a file with too long a name (i.e. unknown); stop pruning in this subdir */ - IODEBUG fprintf(stderr, "BBPdiskscan: unexpected file %s, leaving %s.\n", dent->d_name, parent); + fprintf(stderr, "BBPdiskscan: unexpected file %s, leaving %s.\n", dent->d_name, parent); break; } strncpy(dst, dent->d_name, dstlen); fullname[sizeof(fullname) - 1] = 0; - if (p == NULL && BBPdiskscan(fullname) == 0) { + if (p == NULL && BBPdiskscan(fullname, baseoff) == 0) { /* it was a directory */ continue; } @@ -3718,7 +3756,7 @@ BBPdiskscan(const char *parent) if (!ok) { /* found an unknown file; stop pruning in this * subdir */ - IODEBUG fprintf(stderr, "BBPdiskscan: unexpected file %s, leaving %s.\n", dent->d_name, parent); + fprintf(stderr, "BBPdiskscan: unexpected file %s, leaving %s.\n", dent->d_name, parent); break; } if (delete) { diff --git a/gdk/gdk_posix.c b/gdk/gdk_posix.c --- a/gdk/gdk_posix.c +++ b/gdk/gdk_posix.c @@ -66,6 +66,10 @@ #define MMAP_ADVISE 7 #define MMAP_WRITABLE (MMAP_WRITE|MMAP_COPY) +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif + /* DDALERT: AIX4.X 64bits needs HAVE_SETENV==0 due to a AIX bug, but * it probably isn't detected so by configure */ diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c --- a/gdk/gdk_storage.c +++ b/gdk/gdk_storage.c @@ -33,6 +33,10 @@ #include <fcntl.h> #endif +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif + /* GDKfilepath returns a newly allocated string containing the path * name of a database farm. * The arguments are the farmID or -1, the name of a subdirectory diff --git a/monetdb5/mal/mal_linker.c b/monetdb5/mal/mal_linker.c --- a/monetdb5/mal/mal_linker.c +++ b/monetdb5/mal/mal_linker.c @@ -44,6 +44,10 @@ static FileRecord filesLoaded[MAXMODULES static int maxfiles = MAXMODULES; static int lastfile = 0; +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif + /* * returns 1 if the file exists */ diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c --- a/monetdb5/mal/mal_profiler.c +++ b/monetdb5/mal/mal_profiler.c @@ -26,6 +26,8 @@ #include <sys/time.h> #endif +#include <string.h> + static void cachedProfilerEvent(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); stream *eventstream = 0; @@ -62,16 +64,23 @@ static struct{ #define LOGLEN 8192 #define lognew() loglen = 0; logbase = logbuffer; *logbase = 0; -#define logadd(...) { \ _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list