[PATCH] autoconf tweaks for C99 compilers

2019-09-09 Thread Florian Weimer via rsync
Strict C99 compilers do not support implicit function declarations or
implicit ints, so something like the patch below is needed.

Thanks,
Florian

diff --git a/configure.ac b/configure.ac
index 4f68e98a..b5c7a582 100644
--- a/configure.ac
+++ b/configure.ac
@@ -173,6 +173,9 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include 
 #include 
 #include 
+#if HAVE_UNISTD_H
+# include 
+#endif
 
 int main(void)
 {
@@ -197,7 +200,7 @@ int main(void)
}
wait();
unlink(tpl);
-   exit(WEXITSTATUS(status));
+   return WEXITSTATUS(status);
 }
 
]])],[rsync_cv_HAVE_BROKEN_LARGEFILE=yes],[rsync_cv_HAVE_BROKEN_LARGEFILE=no],[rsync_cv_HAVE_BROKEN_LARGEFILE=cross])])
 if test x"$rsync_cv_HAVE_BROKEN_LARGEFILE" != x"yes"; then
@@ -366,7 +369,7 @@ int main(void)
 {
dev_t dev = makedev(0, 5, 7);
if (major(dev) != 5 || minor(dev) != 7)
-   exit(1);
+   return 1;
return 0;
 }
 
]])],[rsync_cv_MAKEDEV_TAKES_3_ARGS=yes],[rsync_cv_MAKEDEV_TAKES_3_ARGS=no],[rsync_cv_MAKEDEV_TAKES_3_ARGS=no])])
@@ -647,6 +650,7 @@ AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
 
 AC_CACHE_CHECK([for SYS_fallocate],rsync_cv_have_sys_fallocate,[
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include 
+#include 
 #include ]], [[syscall(SYS_fallocate, 0, 0, (loff_t)0, 
(loff_t)0);]])],[rsync_cv_have_sys_fallocate=yes],[rsync_cv_have_sys_fallocate=no])])
 if test x"$rsync_cv_have_sys_fallocate" = x"yes"; then
 AC_DEFINE(HAVE_SYS_FALLOCATE, 1, [Define to 1 if you have the 
SYS_fallocate syscall number])
@@ -703,7 +707,7 @@ AC_CACHE_CHECK([whether chown() modifies 
symlinks],rsync_cv_chown_modifies_symli
 #endif
 #include 
 #include 
-main() {
+int main() {
char const *dangling_symlink = "conftest.dangle";
unlink(dangling_symlink);
if (symlink("conftest.no-such", dangling_symlink) < 0) abort();
@@ -722,7 +726,7 @@ AC_CACHE_CHECK([whether link() can hard-link 
symlinks],rsync_cv_can_hardlink_sym
 #include 
 #include 
 #define FILENAME "conftest.dangle"
-main() {
+int main() {
unlink(FILENAME);
if (symlink("conftest.no-such", FILENAME) < 0) abort();
unlink(FILENAME "2");
@@ -738,10 +742,13 @@ AC_CACHE_CHECK([whether link() can hard-link special 
files],rsync_cv_can_hardlin
 #if HAVE_UNISTD_H
 # include 
 #endif
+#ifdef HAVE_SYS_STAT_H
+# include 
+#endif
 #include 
 #include 
 #define FILENAME "conftest.fifi"
-main() {
+int main() {
unlink(FILENAME);
if (mkfifo(FILENAME, 0777) < 0) abort();
unlink(FILENAME "2");
@@ -757,9 +764,9 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include 
 #include 
 
-main() {
+int main() {
int fd[2];
-   exit((socketpair(AF_UNIX, SOCK_STREAM, 0, fd) != -1) ? 0 : 1);
+   return (socketpair(AF_UNIX, SOCK_STREAM, 0, fd) != -1) ? 0 : 1;
 
}]])],[rsync_cv_HAVE_SOCKETPAIR=yes],[rsync_cv_HAVE_SOCKETPAIR=no],[rsync_cv_HAVE_SOCKETPAIR=cross])])
 if test x"$rsync_cv_HAVE_SOCKETPAIR" = x"yes"; then
 AC_DEFINE(HAVE_SOCKETPAIR, 1, [Define to 1 if you have the "socketpair" 
function])
@@ -824,7 +831,7 @@ fi
 AC_CACHE_CHECK([for broken readdir],rsync_cv_HAVE_BROKEN_READDIR,[
 AC_RUN_IFELSE([AC_LANG_SOURCE([[#include 
 #include 
-main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
+int main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
 di->d_name[0] == 0) exit(0); exit(1);} 
]])],[rsync_cv_HAVE_BROKEN_READDIR=yes],[rsync_cv_HAVE_BROKEN_READDIR=no],[rsync_cv_HAVE_BROKEN_READDIR=cross])])
 if test x"$rsync_cv_HAVE_BROKEN_READDIR" = x"yes"; then
@@ -833,14 +840,14 @@ fi
 
 AC_CACHE_CHECK([for utimbuf],rsync_cv_HAVE_STRUCT_UTIMBUF,[
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include 
-#include ]], [[struct utimbuf tbuf;  tbuf.actime = 0; tbuf.modtime = 
1; 
exit(utime("foo.c",));]])],[rsync_cv_HAVE_STRUCT_UTIMBUF=yes],[rsync_cv_HAVE_STRUCT_UTIMBUF=no])])
+#include ]], [[struct utimbuf tbuf;  tbuf.actime = 0; tbuf.modtime = 
1; 
utime("foo.c",);]])],[rsync_cv_HAVE_STRUCT_UTIMBUF=yes],[rsync_cv_HAVE_STRUCT_UTIMBUF=no])])
 if test x"$rsync_cv_HAVE_STRUCT_UTIMBUF" = x"yes"; then
 AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, [Define to 1 if you have the "struct 
utimbuf" type])
 fi
 
 AC_CACHE_CHECK([if gettimeofday takes tz 
argument],rsync_cv_HAVE_GETTIMEOFDAY_TZ,[
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include 
-#include ]], [[struct timeval tv; exit(gettimeofday(, 
NULL));]])],[rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes],[rsync_cv_HAVE_GETTIMEOFDAY_TZ=no])])
+#include ]], [[struct timeval tv; return gettimeofday(, 
NULL);]])],[rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes],[rsync_cv_HAVE_GETTIMEOFDAY_TZ=no])])
 if test x"$rsync_cv_HAVE_GETTIMEOFDAY_TZ" != x"no"; then
 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ, 1, [Define to 1 if gettimeofday() takes a 
time-zone arg])
 fi
@@ -849,6 +856,9 @@ AC_CACHE_CHECK([for C99 
vsnprintf],rsync_cv_HAVE_C99_VSNPRINTF,[
 AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include 
 #include 
+#include 
+#include 

[Bug 12769] error allocating core memory buffers (code 22) depending on source file system

2019-09-09 Thread just subscribed for rsync-qa from bugzilla via rsync
https://bugzilla.samba.org/show_bug.cgi?id=12769

--- Comment #4 from Ovidiu Stanila  ---
We hit the same issue on a CentOS 6 server (kernel 2.6.32-754.18.2.el6.x86_64),
the sync would break with the following error:

# /usr/bin/rsync --debug=HASH --stats --no-inc-recursive -aHn --delete /app/
:/app/
[sender] created hashtable 2013770 (size: 16, keys: 64-bit)
[sender] created hashtable 2015370 (size: 512, keys: 64-bit)
[sender] growing hashtable 2015370 (size: 1024, keys: 64-bit)
[sender] growing hashtable 2015370 (size: 2048, keys: 64-bit)
[sender] growing hashtable 2015370 (size: 4096, keys: 64-bit)
[sender] growing hashtable 2015370 (size: 8192, keys: 64-bit)
[sender] growing hashtable 2015370 (size: 16384, keys: 64-bit)
[sender] growing hashtable 2015370 (size: 32768, keys: 64-bit)
[sender] growing hashtable 2015370 (size: 65536, keys: 64-bit)
[sender] growing hashtable 2015370 (size: 131072, keys: 64-bit)
[sender] growing hashtable 2015370 (size: 262144, keys: 64-bit)
[sender] growing hashtable 2015370 (size: 524288, keys: 64-bit)
[sender] growing hashtable 2015370 (size: 1048576, keys: 64-bit)
[sender] growing hashtable 2015370 (size: 2097152, keys: 64-bit)
[sender] growing hashtable 2015370 (size: 4194304, keys: 64-bit)
[sender] growing hashtable 2015370 (size: 8388608, keys: 64-bit)
[sender] growing hashtable 2015370 (size: 16777216, keys: 64-bit)
[sender] growing hashtable 2015370 (size: 33554432, keys: 64-bit)
ERROR: out of memory in hashtable_node [sender]
rsync error: error allocating core memory buffers (code 22) at util2.c(106)
[sender=3.1.2]

Both the sender and receiver part have the same rsync and OS versions.

The source we try to transfer is over 3.4Tb (65 million files) with a big
number of hard links between various directories(for avoiding duplicate files).

We initially increased the memory from 16Gb to 32Gb but even with that rsync
would die with the same error. On above example, there were over 22Gb free RAM
at the point rsync stopped working.

We also tried "--inplace" instead of "--no-inc-recursive" with the same result.

Did we hit some kind of limitation inside of rsync ? Is there anything else we
should check ?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html