Eckert, Robert D
2002-Mar-22 07:15 UTC
Bug in compile of rsync 2.5.4 on Tru64 UNIX V5.1a using cc
Greetings, here is the output of the 'configure' step and the compile step (using the Compaq cc compiler that comes with Tru64 V5.1A. The configure reported success and most of the compile steps cam through error/warning free except for the one that stumbled. Can someone help me out here? I am willing to provide a binary for Tru64 V5.1A if we can swat this bug. We depend greatly on Rsync to keep a fresh backup of our 70gb storage system that is the backend of http://www.indiana.edu/, Indiana University's main web site to the Internet. We're also big fans and soon to be BIG adopters of Samba 2.2.3a. Anyway here is the sequence that was encountered: [root@hyperion: rsync-2.5.4]#CC=cc ; export CC ; ./configure configure: Configuring rsync 2.5.4 checking build system type... alphaev5-dec-osf5.1 checking host system type... alphaev5-dec-osf5.1 checking target system type... alphaev5-dec-osf5.1 checking for gcc... cc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for executable suffix... checking for object suffix... o checking whether we are using the GNU C compiler... no checking whether cc accepts -g... yes checking how to run the C preprocessor... cc -E checking for a BSD compatible install... ./install-sh -c checking for cc option to accept ANSI C... none needed checking whether to include debugging symbols... yes checking for remsh... 0 checking for broken largefile support... no checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... no checking for _LARGE_FILES value needed for large files... no checking ipv6 stack type... unknown checking for library containing getaddrinfo... no checking whether byte ordering is bigendian... no checking for dirent.h that defines DIR... yes checking for opendir in -ldir... no checking whether time.h and sys/time.h may both be included... yes checking for sys/wait.h that is POSIX.1 compatible... yes checking for sys/fcntl.h... yes checking for sys/select.h... yes checking for fcntl.h... yes checking for sys/time.h... yes checking for sys/unistd.h... no checking for unistd.h... yes checking for utime.h... yes checking for grp.h... yes checking for compat.h... no checking for sys/param.h... yes checking for ctype.h... yes checking for sys/wait.h... (cached) yes checking for sys/ioctl.h... yes checking for sys/filio.h... no checking for string.h... yes checking for stdlib.h... yes checking for sys/socket.h... yes checking for sys/mode.h... yes checking for glob.h... yes checking for alloca.h... yes checking for mcheck.h... no checking for sys/sysctl.h... no checking for arpa/inet.h... yes checking for arpa/nameser.h... yes checking for netdb.h... yes checking for malloc.h... yes checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... no checking for unistd.h... (cached) yes checking for int... yes checking size of int... 4 checking for long... yes checking size of long... 8 checking for short... yes checking size of short... 2 checking for inline... inline checking return type of signal handlers... void checking for uid_t in sys/types.h... yes checking for mode_t... yes checking for off_t... yes checking for size_t... yes checking for pid_t... yes checking type of array argument to getgroups... gid_t checking for struct stat.st_rdev... yes checking for ino_t... yes checking for socklen_t... no checking for socklen_t equivalent... int checking for errno in errno.h... yes checking for connect... yes checking for inet_ntop in -lresolv... yes checking for inet_ntop... yes checking for inet_pton... yes checking for getaddrinfo... no checking for getnameinfo... yes checking for struct sockaddr.sa_len... no checking struct sockaddr_storage... yes checking for strcasecmp... yes checking whether utime accepts a null argument... yes checking for waitpid... yes checking for wait4... yes checking for getcwd... yes checking for strdup... yes checking for strerror... yes checking for chown... yes checking for chmod... yes checking for mknod... yes checking for fchmod... yes checking for fstat... yes checking for strchr... yes checking for readlink... yes checking for link... yes checking for utime... yes checking for utimes... yes checking for strftime... yes checking for memmove... yes checking for lchown... yes checking for vsnprintf... yes checking for snprintf... yes checking for asprintf... no checking for setsid... yes checking for glob... yes checking for strpbrk... yes checking for strlcat... no checking for strlcpy... no checking for mtrace... no checking for mallinfo... yes checking for setgroups... yes checking for working socketpair... yes checking for working fnmatch... yes checking for poptGetContext in -lpopt... no checking whether to use included libpopt... ./popt checking for long long... yes checking for off64_t... no checking for short ino_t... no checking for unsigned char... no checking for broken readdir... no checking for utimbuf... yes checking if gettimeofday takes tz argument... yes checking for C99 vsnprintf... no checking for secure mkstemp... yes checking for broken inet_ntoa... no checking for broken inet_aton... no checking whether -c -o works... yes configure: creating ./config.status config.status: creating Makefile config.status: creating lib/dummy config.status: creating zlib/dummy config.status: creating popt/dummy config.status: creating shconfig config.status: creating config.h rsync 2.5.4 configuration successful [root@hyperion: rsync-2.5.4]#make cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c rsync.c -o rsync.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c generator.c -o generator.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c receiver.c -o receiver.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c cleanup.c -o cleanup.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c sender.c -o sender.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c exclude.c -o exclude.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c util.c -o util.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c main.c -o main.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c checksum.c -o checksum.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c match.c -o match.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c syscall.c -o syscall.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c log.c -o log.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c backup.c -o backup.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c options.c -o options.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c flist.c -o flist.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c io.c -o io.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c compat.c -o compat.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c hlink.c -o hlink.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c token.c -o token.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c uidlist.c -o uidlist.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c socket.c -o socket.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c fileio.c -o fileio.o cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c batch.c -o batch.o cc: Error: batch.c, line 408: In this statement, a common type could not be determined for the 2nd and 3rd operands ("&s->count" and "&int_zero") of a conditional operator. (badcondit) write_batch_csums_file(s ? &s->count : &int_zero, sizeof(int)); -------------------------------^ *** Exit 1 Stop. [root@hyperion: rsync-2.5.4]# Thank you, Bob Eckert - Principal Analyst eckert@indiana.edu (812) 855-7209 - (812) 855-8299 Fax Indiana University University Information Technology Services University Information Services 2711 East 10th Street - Room 101.5 Bloomington, IN 47408
Paul Haas
2002-Mar-22 08:45 UTC
Bug in compile of rsync 2.5.4 on Tru64 UNIX V5.1a using cc
On Thu, 21 Mar 2002, Eckert, Robert D wrote:> Greetings, here is the output of the 'configure' step and > the compile step (using the Compaq cc compiler that comes > with Tru64 V5.1A. The configure reported success and most of > the compile steps cam through error/warning free except for > the one that stumbled. Can someone help me out here? I am willing > to provide a binary for Tru64 V5.1A if we can swat this bug. > We depend greatly on Rsync to keep a fresh backup of our > 70gb storage system that is the backend of http://www.indiana.edu/, > Indiana University's main web site to the Internet. We're also big > fans and soon to be BIG adopters of Samba 2.2.3a.> Anyway here is the sequence that was encountered: > cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c batch.c -o batch.o > cc: Error: batch.c, line 408: In this statement, a common type could not be > determined for the 2nd and 3rd operands ("&s->count" and "&int_zero") of a > conditional operator. (badcondit) > write_batch_csums_file(s ? &s->count : &int_zero, sizeof(int)); > -------------------------------^ > *** Exit 1Line 406 says: /* FIXME: This will break if s->count is ever not exactly an int. */ s->count is a size_t, which is 64 bits on your compiler. Here's how I would fix it: ==================================================================RCS file: RCS/batch.c,v retrieving revision 1.1 diff -u -r1.1 batch.c --- batch.c 2002/03/21 21:31:52 1.1 +++ batch.c 2002/03/21 21:44:11 @@ -396,16 +396,17 @@ struct sum_struct *s) { size_t i; - unsigned int int_zero = 0; + unsigned int int_count; extern int csum_length; fdb_open = 1; /* Write csum info to batch file */ - /* FIXME: This will break if s->count is ever not exactly an int. */ + /* FIXME: This will break if s->count is ever greater than 2^32 -1 */ write_batch_csums_file(flist_entry, sizeof(int)); - write_batch_csums_file(s ? &s->count : &int_zero, sizeof(int)); + int_count = s ? (unsigned int) s->count : 0; + write_batch_csums_file(&int_count, sizeof(int_count)); if (s) { for (i = 0; i < s->count; i++) {
Zoong Pham
2002-Mar-22 09:40 UTC
Bug in compile of rsync 2.5.4 on Tru64 UNIX V5.1a using cc
Hi Eckert, On Thu, Mar 21, 2002 at 03:15:39PM -0500, Eckert, Robert D wrote:> Greetings, here is the output of the 'configure' step and > the compile step (using the Compaq cc compiler that comes > with Tru64 V5.1A. The configure reported success and most of > the compile steps cam through error/warning free except for > the one that stumbled. Can someone help me out here? I am willing > to provide a binary for Tru64 V5.1A if we can swat this bug.I had the same problem. I managed to have rsync compiled OK on my Tru64 5.1 box with helps from couple of people from this list. Try with the patch I attach here. I am not a C programmer so you'd better check to make sure it is correct.> We depend greatly on Rsync to keep a fresh backup of our > 70gb storage system that is the backend of http://www.indiana.edu/, > Indiana University's main web site to the Internet.I plan to do the same here instead of Tru64 vdump and vrestore once I am sure backups by rsync is as reliable as vdump/vrestore. Do you use rsync for root, usr partitions and and database files? Have you had any problem with rsync so far? Cheers, -- Zoong Pham zpham@mercy.com.au UNIX Systems Administrator Mercy Health and Aged Care Inc. To get my PGP public key, email me with the subject: Request for Zoong Pham's PGP public key diff -u -r rsync-2.5.4/batch.c rsync-2.5.4.new/batch.c --- rsync-2.5.4/batch.c Thu Feb 7 08:20:48 2002 +++ rsync-2.5.4.new/batch.c Fri Mar 22 09:24:01 2002 @@ -405,7 +405,15 @@ /* FIXME: This will break if s->count is ever not exactly an int. */ write_batch_csums_file(flist_entry, sizeof(int)); + if (s) { + write_batch_csums_file(&s->count, sizeof(int)); + } + else if (!s) { + write_batch_csums_file(&int_zero, sizeof(int)); + } + /* write_batch_csums_file(s ? &s->count : &int_zero, sizeof(int)); + */ if (s) { for (i = 0; i < s->count; i++) { diff -u -r rsync-2.5.4/config.h.in rsync-2.5.4.new/config.h.in --- rsync-2.5.4/config.h.in Thu Feb 28 10:15:55 2002 +++ rsync-2.5.4.new/config.h.in Fri Mar 22 09:24:01 2002 @@ -140,6 +140,9 @@ /* Define if you have the `mknod' function. */ #undef HAVE_MKNOD +/* Define if you have the `mkfifo' function. */ +#undef HAVE_MKFIFO + /* Define if you have the `mtrace' function. */ #undef HAVE_MTRACE @@ -244,6 +247,9 @@ /* Define if you have the <sys/socket.h> header file. */ #undef HAVE_SYS_SOCKET_H + +/* Define if you have the <sys/un.h> header file. */ +#undef HAVE_SYS_UN_H /* Define if you have the <sys/stat.h> header file. */ #undef HAVE_SYS_STAT_H diff -u -r rsync-2.5.4/configure rsync-2.5.4.new/configure --- rsync-2.5.4/configure Wed Mar 13 11:03:50 2002 +++ rsync-2.5.4.new/configure Fri Mar 22 09:24:01 2002 @@ -3414,7 +3414,7 @@ fi done -for ac_header in sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h +for ac_header in sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h sys/un.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:3420: checking for $ac_header" >&5 @@ -6165,7 +6165,7 @@ fi rm -f conftest.data -for ac_func in waitpid wait4 getcwd strdup strerror chown chmod mknod +for ac_func in waitpid wait4 getcwd strdup strerror chown chmod mknod mkfifo do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:6171: checking for $ac_func" >&5 diff -u -r rsync-2.5.4/configure.in rsync-2.5.4.new/configure.in --- rsync-2.5.4/configure.in Wed Mar 13 11:03:34 2002 +++ rsync-2.5.4.new/configure.in Fri Mar 22 09:24:01 2002 @@ -242,7 +242,7 @@ AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h unistd.h utime.h grp.h) AC_CHECK_HEADERS(compat.h sys/param.h ctype.h sys/wait.h sys/ioctl.h) -AC_CHECK_HEADERS(sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h) +AC_CHECK_HEADERS(sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h sys/un.h) AC_CHECK_HEADERS(glob.h alloca.h mcheck.h sys/sysctl.h arpa/inet.h arpa/nameser.h) AC_CHECK_HEADERS(netdb.h) AC_CHECK_HEADERS(malloc.h) @@ -315,7 +315,19 @@ AC_CHECK_FUNCS(inet_ntop, , AC_LIBOBJ(lib/inet_ntop)) AC_CHECK_FUNCS(inet_pton, , AC_LIBOBJ(lib/inet_pton)) -AC_CHECK_FUNCS(getaddrinfo, , AC_LIBOBJ(lib/getaddrinfo)) +# Tru64 UNIX has getaddrinfo() but has it renamed in libc as +# something else so we must include <netdb.h> to get the +# redefinition. +AC_MSG_CHECKING([for getaddrinfo]) +AC_TRY_LINK([#include <sys/types.h> +#include <sys/socket.h> +#include <netdb.h>],[getaddrinfo(NULL, NULL, NULL, NULL);], + [AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_GETADDRINFO, 1, + [Define if you have the `getaddrinfo' function.])], + [AC_MSG_RESULT([no]) + AC_LIBOBJ(lib/getaddrinfo)]) + AC_CHECK_FUNCS(getnameinfo, , AC_LIBOBJ(lib/getnameinfo)) AC_CHECK_MEMBER([struct sockaddr.sa_len], @@ -348,7 +360,7 @@ dnl AC_FUNC_MEMCMP AC_FUNC_UTIME_NULL -AC_CHECK_FUNCS(waitpid wait4 getcwd strdup strerror chown chmod mknod) +AC_CHECK_FUNCS(waitpid wait4 getcwd strdup strerror chown chmod mknod mkfifo) AC_CHECK_FUNCS(fchmod fstat strchr readlink link utime utimes strftime) AC_CHECK_FUNCS(memmove lchown vsnprintf snprintf asprintf setsid glob strpbrk) AC_CHECK_FUNCS(strlcat strlcpy mtrace mallinfo setgroups) diff -u -r rsync-2.5.4/lib/getaddrinfo.c rsync-2.5.4.new/lib/getaddrinfo.c --- rsync-2.5.4/lib/getaddrinfo.c Fri Dec 14 16:33:12 2001 +++ rsync-2.5.4.new/lib/getaddrinfo.c Fri Mar 22 09:24:10 2002 @@ -41,6 +41,20 @@ #include <rsync.h> +/****** Start Zoong added here */ + +#define EAI_BADHINTS 12 +#define EAI_PROTOCOL 13 +#define EAI_MAX 14 + +#define AI_PASSIVE 0x00000001 /* get address to use bind() */ +#define AI_CANONNAME 0x00000002 /* fill ai_canonname */ +#define AI_NUMERICHOST 0x00000004 /* prevent name resolution */ +#define AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST) + +/****** End Zoong added here */ + + #if defined(__KAME__) && defined(INET6) # define FAITH #endif diff -u -r rsync-2.5.4/rsync.h rsync-2.5.4.new/rsync.h --- rsync-2.5.4/rsync.h Sat Feb 23 11:17:50 2002 +++ rsync-2.5.4.new/rsync.h Fri Mar 22 09:24:01 2002 @@ -109,6 +109,11 @@ #include <sys/socket.h> #endif +#ifdef HAVE_SYS_UN_H +#define _SOCKADDR_LEN +#include <sys/un.h> +#endif + #ifdef HAVE_STRING_H #include <string.h> #endif diff -u -r rsync-2.5.4/syscall.c rsync-2.5.4.new/syscall.c --- rsync-2.5.4/syscall.c Tue Feb 19 09:44:23 2002 +++ rsync-2.5.4.new/syscall.c Fri Mar 22 09:24:01 2002 @@ -67,6 +67,36 @@ { if (dry_run) return 0; CHECK_RO + +#if HAVE_MKFIFO + if (S_ISFIFO(mode)) { + return mkfifo(pathname, mode); + } +#endif + +#if HAVE_SYS_UN_H + if (S_ISSOCK(mode)) { + int sock; + struct sockaddr_un saddr; + int len = strlen(pathname) + 1; /* include null */ + + saddr.sun_family = AF_UNIX; + strncpy(saddr.sun_path, pathname, sizeof(saddr.sun_path)); + saddr.sun_len = len > sizeof(saddr.sun_path) ? sizeof(saddr.sun_path): len; + + if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) { + return -1; + } + unlink(pathname); + if ((bind(sock, (struct sockaddr*)&saddr, sizeof(saddr))) < 0) { + return -1; + } + close(sock); + return do_chmod(pathname, mode); + } +#endif + + return mknod(pathname, mode, dev); } #endif -------------- next part -------------- ------------------------------------------------------------ If you are not the intended recipient of this communication please delete and destroy all copies immediately. If you are the intended recipient of this communication, you should not copy, disclose or distribute this communication without the authority of the sender. Any views expressed in this communication are those of the individual sender, except where the sender specifically states them to be the views of the Company. If you have received this email in error or have other concerns regarding this transmission, please contact the Mercy Health & Aged Care Mail Administrator. Mercy Health & Aged Care support@mercy.com.au or +613 9270 2600 ------------------------------------------------------------