Changeset: 2a5ae0652f2f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2a5ae0652f2f
Modified Files:
gdk/gdk_logger.c
testing/Mtest.py.in
Branch: multifarm
Log Message:
Merge with default branch.
diffs (110 lines):
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -262,10 +262,11 @@ la_bat_clear(logger *lg, logaction *la)
static int
log_read_seq(logger *lg, logformat *l)
{
- lng seq = l->nr;
+ int seq = (int) l->nr;
lng val;
BUN p;
+ assert(l->nr <= (lng) INT_MAX);
if (mnstr_readLng(lg->log, &val) != 1) {
fprintf(stderr, "!ERROR: log_read_seq: read failed\n");
return LOG_ERR;
@@ -1457,9 +1458,18 @@ logger_new(int debug, char *fn, char *lo
fclose(fp1);
/* first create a versioned file using
* the current log id */
- fp1 = fopen(cvfile, "w");
- fprintf(fp1, "%d\n", curid);
- fclose(fp1);
+ if ((fp1 = fopen(cvfile, "w")) == NULL ||
+ fprintf(fp1, "%d\n", curid) < 2 ||
+ fflush(fp1) != 0 || /* make sure it's save
on disk */
+#if defined(_MSC_VER)
+ _commit(_fileno(fp1)) < 0 ||
+#elif defined(HAVE_FDATASYNC)
+ fdatasync(fileno(fp1)) < 0 ||
+#elif defined(HAVE_FSYNC)
+ fsync(fileno(fp1)) < 0 ||
+#endif
+ fclose(fp1) != 0)
+ logger_fatal("Logger_new: failed to
write %s\n", cvfile, 0, 0);
/* then remove the unversioned file
* that gdk_bbp created (in this
* order!) */
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -2089,6 +2089,8 @@ def RunTest(env, TST, BusyPorts, COND, o
errcode = F_SEGV
elif tres == 'abort':
errcode = F_ABRT
+ elif tres == 'socket':
+ errcode = F_SOCK
elif tres == 'error':
errcode = F_WARN
elif tres is not None:
@@ -2111,6 +2113,12 @@ def RunTest(env, TST, BusyPorts, COND, o
##rm -f .new.left-over.tmp.bats.
$TSTTRGBASE/Tests/.old.left-over.tmp.bats.
##if [ -f .all.left-over.tmp.bats. ] ; then mv -f
.all.left-over.tmp.bats. $TSTTRGBASE/Tests/.old.left-over.tmp.bats. ; fi
+ if tres == 'socket':
+ if quiet:
+ STDOUT.write("\n%s : Socket!\n" % TST)
+ elif verbose:
+ STDOUT.write("(Socket!) ")
+
if tres == 'timeout':
if quiet:
STDOUT.write("\n%s : Timeout!\n" % TST)
@@ -2349,7 +2357,9 @@ def RunTest(env, TST, BusyPorts, COND, o
FailedOut, FailedErr)
if not verbose and not quiet:
- if tres == 'timeout':
+ if tres == 'socket':
+ STDOUT.write("%sSOCKET%s" % (PURPLE, BLACK))
+ elif tres == 'timeout':
STDOUT.write("%sTIMEOUT%s" % (PURPLE, BLACK))
elif tres == 'recursion':
STDOUT.write("%sRECURSION%s" % (PURPLE, BLACK))
@@ -2982,22 +2992,20 @@ def DoIt(env, SERVER, CALL, TST, EXT, PR
return None
# Try to detect segfaults and the like
- TO = re.compile("(^(|[^#]*[\t ])((Memory|Segmentation) [Ff]ault|Bus
[Ee]rror|Aborted|Assertion (|.* )failed[:\.]|!FATAL: BATSIGabort:)([ \t]|$))",
re.MULTILINE)
- # FIXME: this begs for a much nicer solution (100% copy of below)
- for f in (TestErrFile, TestOutFile):
- if os.path.isfile(f):
- for l in open(f):
- if TO.search(l):
- return 'segfault'
-
# Try to detect aborts due to too deep recursion
- TO = re.compile("aborted too deep recursion", re.MULTILINE)
- # FIXME: this begs for a much nicer solution (100% copy of above)
- for f in (TestErrFile, TestOutFile):
- if os.path.isfile(f):
- for l in open(f):
- if TO.search(l):
- return 'recursion'
+ for (regexp, msg) in [("(^(|[^#]*[\t ])((Memory|Segmentation) [Ff]ault|Bus
[Ee]rror|Aborted|Assertion (|.* )failed[:\.]|!FATAL: BATSIGabort:)([ \t]|$))",
+ 'segfault'),
+ ("aborted too deep recursion",
+ 'recursion'),
+ ("mal_mapi\.listen:operation failed: bind to stream
socket port",
+ 'socket')]:
+ TO = re.compile(regexp, re.MULTILINE)
+ # FIXME: this begs for a much nicer solution (100% copy of below)
+ for f in (TestErrFile, TestOutFile):
+ if os.path.isfile(f):
+ for l in open(f):
+ if TO.search(l):
+ return msg
return None
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list