Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1780260

Summary: v7 fails to build on Debian 9 [patch?]
Product: [Community] GlusterFS Reporter: Andrew Miloradovsky <andrew>
Component: rpcAssignee: Raghavendra G <rgowdapp>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs, jahernan
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-12-13 05:51:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andrew Miloradovsky 2019-12-05 15:32:47 UTC
Description of the problem:

‘xdr_sizeof’ is implicitly declared and warnings are treated as errors.

Version-Release number of selected component:

3199f8759ebfcc31ce158201c3c25d9a738479f8

How reproducible:

Building on Debian 9.

Steps to Reproduce:

1. ./autogen.sh
2. ./configure
3. make all -jN

Actual results:

  CC       autoscale-threads.lo
In file included from rpc-clnt.h:18:0,
                 from mgmt-pmap.c:13:
../../../rpc/xdr/src/glusterfs3.h: In function ‘dict_to_xdr’:
../../../rpc/xdr/src/glusterfs3.h:800:12: error: implicit declaration of functio
n ‘xdr_sizeof’ [-Werror=implicit-function-declaration]
     size = xdr_sizeof((xdrproc_t)xdr_gfx_dict, dict);
            ^~~~~~~~~~
In file included from rpc-clnt.h:18:0,
                 from rpc-clnt.c:13:
../../../rpc/xdr/src/glusterfs3.h: In function ‘dict_to_xdr’:
../../../rpc/xdr/src/glusterfs3.h:800:12: error: implicit declaration of functio
n ‘xdr_sizeof’ [-Werror=implicit-function-declaration]
     size = xdr_sizeof((xdrproc_t)xdr_gfx_dict, dict);
            ^~~~~~~~~~
rpc-clnt.c: In function ‘rpc_clnt_new’:
rpc-clnt.c:1103:5: warning: dereferencing type-punned pointer will break strict-
aliasing rules [-Wstrict-aliasing]  
     GF_ATOMIC_INIT(rpc->xid, 1);   
     ^~~~~~~~~~~~~~
rpc-clnt.c:1103:5: warning: dereferencing type-punned pointer will break strict-
aliasing rules [-Wstrict-aliasing]  
rpc-transport.c: In function ‘rpc_transport_load’:
rpc-transport.c:371:5: warning: dereferencing type-punned pointer will break str
ict-aliasing rules [-Wstrict-aliasing]
     GF_ATOMIC_INIT(trans->disconnect_progress, 0);
     ^~~~~~~~~~~~~~
rpc-transport.c:371:5: warning: dereferencing type-punned pointer will break str
ict-aliasing rules [-Wstrict-aliasing]
rpcsvc.c: In function ‘rpcsvc_callback_build_record’:
rpcsvc.c:1197:16: error: implicit declaration of function ‘xdr_sizeof’ [-Werror=
implicit-function-declaration]
     xdr_size = xdr_sizeof((xdrproc_t)xdr_callmsg, &request);
                ^~~~~~~~~~
In file included from rpc-clnt.h:18:0,
                 from rpc-clnt-ping.c:11:
../../../rpc/xdr/src/glusterfs3.h: In function ‘dict_to_xdr’:
../../../rpc/xdr/src/glusterfs3.h:800:12: error: implicit declaration of functio
n ‘xdr_sizeof’ [-Werror=implicit-function-declaration]
     size = xdr_sizeof((xdrproc_t)xdr_gfx_dict, dict);
            ^~~~~~~~~~
cc1: some warnings being treated as errors

Expected results:

  CC       autoscale-threads.lo
  CC       mgmt-pmap.lo

Additional info:

~./configure --with-ipv6-default~ solves the problem,
but there is another solution:

diff --git a/rpc/rpc-lib/src/xdr-common.h b/rpc/rpc-lib/src/xdr-common.h
index 7b0bc36ec..752736b3d 100644
--- a/rpc/rpc-lib/src/xdr-common.h
+++ b/rpc/rpc-lib/src/xdr-common.h
@@ -66,11 +66,9 @@ enum gf_dump_procnum {
 #ifdef GF_LINUX_HOST_OS
 #define xdr_u_int32_t xdr_uint32_t
 #define xdr_u_int64_t xdr_uint64_t
-#ifdef IPV6_DEFAULT
 unsigned long
 xdr_sizeof(xdrproc_t func, void *data);
 #endif
-#endif
 
 #ifdef GF_DARWIN_HOST_OS
 #define xdr_u_quad_t xdr_u_int64_t

Comment 1 Worker Ant 2019-12-05 15:38:50 UTC
REVIEW: https://review.gluster.org/23819 (rpc: define xdr_sizeof regardless of whether IPv6 is the default) posted (#1) for review on master by None

Comment 2 Xavi Hernandez 2019-12-09 15:07:09 UTC
@Raghavendra, can you check if this is the right thing to do to fix the compilation issue. This seems a duplicate of bug #1539142, where the solution there is to use '--with-libtirpc=no'. Which one if the correct approach ?

Comment 3 Worker Ant 2019-12-13 05:51:52 UTC
REVIEW: https://review.gluster.org/23819 (rpc: define xdr_sizeof regardless of whether IPv6 is the default) merged (#2) on master by MOHIT AGRAWAL