Bug 765574 (GLUSTER-3842) - Fails to build from hardened source
Summary: Fails to build from hardened source
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: GLUSTER-3842
Product: GlusterFS
Classification: Community
Component: build
Version: 3.2.4
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: ---
Assignee: Amar Tumballi
QA Contact: Sachidananda Urs
URL:
Whiteboard:
Depends On:
Blocks: 817967
TreeView+ depends on / blocked
 
Reported: 2011-12-02 19:57 UTC by Patrick Matthäi
Modified: 2013-12-19 00:07 UTC (History)
3 users (show)

Fixed In Version: glusterfs-3.4.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-24 17:26:44 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Patrick Matthäi 2011-12-02 19:57:39 UTC
Hey guys,

I selected version 3.2.4, since 3.2.5 is not available @ bugzilla. This bug was NOT present in 3.2.4, but now in 3.2.5.
It just can not build with hardened flags enabled:

 gcc -DHAVE_CONFIG_H -I. -I. -I../../../.. -I../../../../libglusterfs/src -I../../../../contrib/uuid -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -DGF_LINUX_HOST_OS -I../../../../libglusterfs/src -shared -nostartfiles -O0 -I../../../../xlators/nfs/lib/src -L/usr/lib/glusterfs/3.2.5/xlator/nfs/ -I../../../../contrib/rbtree -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -c ../../../../xlators/nfs/lib/src/rpcsvc.c  -fPIC -DPIC -o .libs/rpcsvc.o
 gcc -DHAVE_CONFIG_H -I. -I. -I../../../.. -I../../../../libglusterfs/src -I../../../../contrib/uuid -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -DGF_LINUX_HOST_OS -I../../../../libglusterfs/src -shared -nostartfiles -O0 -I../../../../xlators/nfs/lib/src -L/usr/lib/glusterfs/3.2.5/xlator/nfs/ -I../../../../contrib/rbtree -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -c ../../../../xlators/nfs/lib/src/rpcsvc.c -o rpcsvc.o >/dev/null 2>&1
 gcc -DHAVE_CONFIG_H -I. -I. -I../../../.. -I../../../../libglusterfs/src -I../../../../contrib/uuid -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -DGF_LINUX_HOST_OS -I../../../../libglusterfs/src -shared -nostartfiles -O0 -I../../../../xlators/nfs/lib/src -L/usr/lib/glusterfs/3.2.5/xlator/nfs/ -I../../../../contrib/rbtree -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -c ../../../../xlators/nfs/lib/src/xdr-nfs3.c  -fPIC -DPIC -o .libs/xdr-nfs3.o
 gcc -DHAVE_CONFIG_H -I. -I. -I../../../.. -I../../../../libglusterfs/src -I../../../../contrib/uuid -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -DGF_LINUX_HOST_OS -I../../../../libglusterfs/src -shared -nostartfiles -O0 -I../../../../xlators/nfs/lib/src -L/usr/lib/glusterfs/3.2.5/xlator/nfs/ -I../../../../contrib/rbtree -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -c ../../../../xlators/nfs/lib/src/xdr-nfs3.c -o xdr-nfs3.o >/dev/null 2>&1
 gcc -DHAVE_CONFIG_H -I. -I. -I../../../.. -I../../../../libglusterfs/src -I../../../../contrib/uuid -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -DGF_LINUX_HOST_OS -I../../../../libglusterfs/src -shared -nostartfiles -O0 -I../../../../xlators/nfs/lib/src -L/usr/lib/glusterfs/3.2.5/xlator/nfs/ -I../../../../contrib/rbtree -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -c ../../../../xlators/nfs/lib/src/xdr-rpc.c  -fPIC -DPIC -o .libs/xdr-rpc.o
 gcc -DHAVE_CONFIG_H -I. -I. -I../../../.. -I../../../../libglusterfs/src -I../../../../contrib/uuid -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -DGF_LINUX_HOST_OS -I../../../../libglusterfs/src -shared -nostartfiles -O0 -I../../../../xlators/nfs/lib/src -L/usr/lib/glusterfs/3.2.5/xlator/nfs/ -I../../../../contrib/rbtree -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -c ../../../../xlators/nfs/lib/src/xdr-rpc.c -o xdr-rpc.o >/dev/null 2>&1
gcc -shared  .libs/nfs.o .libs/nfs-common.o .libs/nfs-fops.o .libs/nfs-inodes.o .libs/nfs-generics.o .libs/mount3.o .libs/nfs3-fh.o .libs/nfs3.o .libs/nfs3-helpers.o .libs/auth-null.o .libs/auth-unix.o .libs/msg-nfs3.o .libs/rpc-socket.o .libs/rpcsvc-auth.o .libs/rpcsvc.o .libs/xdr-nfs3.o .libs/xdr-rpc.o  -Wl,--rpath -Wl,/tmp/buildd/glusterfs-3.2.5/libglusterfs/src/.libs -Wl,--rpath -Wl,/usr/lib -L/usr/lib/glusterfs/3.2.5/xlator/nfs/ ../../../../libglusterfs/src/.libs/libglusterfs.so -ldl -lpthread  -Wl,-soname -Wl,server.so.0 -o .libs/server.so.0.0.0
(cd .libs && rm -f server.so.0 && ln -s server.so.0.0.0 server.so.0)
(cd .libs && rm -f server.so && ln -s server.so.0.0.0 server.so)
ar cru .libs/server.a  nfs.o nfs-common.o nfs-fops.o nfs-inodes.o nfs-generics.o mount3.o nfs3-fh.o nfs3.o nfs3-helpers.o auth-null.o auth-unix.o msg-nfs3.o rpc-socket.o rpcsvc-auth.o rpcsvc.o xdr-nfs3.o xdr-rpc.o
ranlib .libs/server.a
creating server.la
(cd .libs && rm -f server.la && ln -s ../server.la server.la)
Making all in mgmt
Making all in glusterd
Making all in src
mkdir .libs
 gcc -DHAVE_CONFIG_H -I. -I. -I../../../.. -I../../../../libglusterfs/src -I../../../../contrib/uuid -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -DGF_LINUX_HOST_OS -I../../../../libglusterfs/src -shared -nostartfiles -O0 -I -L/usr/lib/glusterfs/3.2.5/xlator/mgmt/ -I../../../../contrib/rbtree -I../../../../rpc/xdr/src -I../../../../rpc/rpc-lib/src -I../../../../contrib/uuid -I../../../../contrib/md5 -DGFS_PREFIX=\"/usr\" -DDATADIR=\"/var\" -DGSYNCD_PREFIX=\"/usr/lib/glusterfs/glusterfs\" -DSYNCDAEMON_COMPILE=1 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -c glusterd.c  -fPIC -DPIC -o .libs/glusterd.o
 gcc -DHAVE_CONFIG_H -I. -I. -I../../../.. -I../../../../libglusterfs/src -I../../../../contrib/uuid -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -DGF_LINUX_HOST_OS -I../../../../libglusterfs/src -shared -nostartfiles -O0 -I -L/usr/lib/glusterfs/3.2.5/xlator/mgmt/ -I../../../../contrib/rbtree -I../../../../rpc/xdr/src -I../../../../rpc/rpc-lib/src -I../../../../contrib/uuid -I../../../../contrib/md5 -DGFS_PREFIX=\"/usr\" -DDATADIR=\"/var\" -DGSYNCD_PREFIX=\"/usr/lib/glusterfs/glusterfs\" -DSYNCDAEMON_COMPILE=1 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -c glusterd.c -o glusterd.o >/dev/null 2>&1
 gcc -DHAVE_CONFIG_H -I. -I. -I../../../.. -I../../../../libglusterfs/src -I../../../../contrib/uuid -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -DGF_LINUX_HOST_OS -I../../../../libglusterfs/src -shared -nostartfiles -O0 -I -L/usr/lib/glusterfs/3.2.5/xlator/mgmt/ -I../../../../contrib/rbtree -I../../../../rpc/xdr/src -I../../../../rpc/rpc-lib/src -I../../../../contrib/uuid -I../../../../contrib/md5 -DGFS_PREFIX=\"/usr\" -DDATADIR=\"/var\" -DGSYNCD_PREFIX=\"/usr/lib/glusterfs/glusterfs\" -DSYNCDAEMON_COMPILE=1 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -c glusterd-handler.c  -fPIC -DPIC -o .libs/glusterd-handler.o
 gcc -DHAVE_CONFIG_H -I. -I. -I../../../.. -I../../../../libglusterfs/src -I../../../../contrib/uuid -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -DGF_LINUX_HOST_OS -I../../../../libglusterfs/src -shared -nostartfiles -O0 -I -L/usr/lib/glusterfs/3.2.5/xlator/mgmt/ -I../../../../contrib/rbtree -I../../../../rpc/xdr/src -I../../../../rpc/rpc-lib/src -I../../../../contrib/uuid -I../../../../contrib/md5 -DGFS_PREFIX=\"/usr\" -DDATADIR=\"/var\" -DGSYNCD_PREFIX=\"/usr/lib/glusterfs/glusterfs\" -DSYNCDAEMON_COMPILE=1 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -c glusterd-handler.c -o glusterd-handler.o >/dev/null 2>&1
 gcc -DHAVE_CONFIG_H -I. -I. -I../../../.. -I../../../../libglusterfs/src -I../../../../contrib/uuid -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -DGF_LINUX_HOST_OS -I../../../../libglusterfs/src -shared -nostartfiles -O0 -I -L/usr/lib/glusterfs/3.2.5/xlator/mgmt/ -I../../../../contrib/rbtree -I../../../../rpc/xdr/src -I../../../../rpc/rpc-lib/src -I../../../../contrib/uuid -I../../../../contrib/md5 -DGFS_PREFIX=\"/usr\" -DDATADIR=\"/var\" -DGSYNCD_PREFIX=\"/usr/lib/glusterfs/glusterfs\" -DSYNCDAEMON_COMPILE=1 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -c glusterd-sm.c  -fPIC -DPIC -o .libs/glusterd-sm.o
 gcc -DHAVE_CONFIG_H -I. -I. -I../../../.. -I../../../../libglusterfs/src -I../../../../contrib/uuid -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -DGF_LINUX_HOST_OS -I../../../../libglusterfs/src -shared -nostartfiles -O0 -I -L/usr/lib/glusterfs/3.2.5/xlator/mgmt/ -I../../../../contrib/rbtree -I../../../../rpc/xdr/src -I../../../../rpc/rpc-lib/src -I../../../../contrib/uuid -I../../../../contrib/md5 -DGFS_PREFIX=\"/usr\" -DDATADIR=\"/var\" -DGSYNCD_PREFIX=\"/usr/lib/glusterfs/glusterfs\" -DSYNCDAEMON_COMPILE=1 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -c glusterd-sm.c -o glusterd-sm.o >/dev/null 2>&1
 gcc -DHAVE_CONFIG_H -I. -I. -I../../../.. -I../../../../libglusterfs/src -I../../../../contrib/uuid -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -DGF_LINUX_HOST_OS -I../../../../libglusterfs/src -shared -nostartfiles -O0 -I -L/usr/lib/glusterfs/3.2.5/xlator/mgmt/ -I../../../../contrib/rbtree -I../../../../rpc/xdr/src -I../../../../rpc/rpc-lib/src -I../../../../contrib/uuid -I../../../../contrib/md5 -DGFS_PREFIX=\"/usr\" -DDATADIR=\"/var\" -DGSYNCD_PREFIX=\"/usr/lib/glusterfs/glusterfs\" -DSYNCDAEMON_COMPILE=1 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -c glusterd-op-sm.c  -fPIC -DPIC -o .libs/glusterd-op-sm.o
glusterd-op-sm.c: In function 'glusterd_do_gsync_log_rotation_mst_slv':
glusterd-op-sm.c:4625:17: error: format not a string literal and no format arguments [-Werror=format-security]
glusterd-op-sm.c: In function 'glusterd_rotate_gsync_logs':
glusterd-op-sm.c:4716:17: error: format not a string literal and no format arguments [-Werror=format-security]
glusterd-op-sm.c: In function 'glusterd_quota_child_waitpid':
glusterd-op-sm.c:4987:16: warning: ignoring return value of 'system', declared with attribute warn_unused_result [-Wunused-result]
cc1: some warnings being treated as errors

make[6]: *** [glusterd-op-sm.lo] Error 1
make[5]: *** [all-recursive] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make[1]: Leaving directory `/tmp/buildd/glusterfs-3.2.5'
make: *** [debian/stamp-makefile-build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
E: Failed autobuilding of package
I: unmounting /var/cache/pbuilder/ccache filesystem
I: unmounting dev/pts filesystem
I: unmounting proc filesystem
I: cleaning the build env 
I: removing directory /var/cache/pbuilder/build//7268 and its subdirectories

Comment 1 Louis Zuckerman 2012-01-06 16:26:55 UTC
I've committed a fix for this.  See http://review.gluster.com/#change,2598

In summary, there are two calls to gf_log which provide a string pointer where a format string or string literal are expected.  To solve this, I just added an argument of "%s" before the string pointer to satisfy the need for a format string parameter.

Comment 2 Amar Tumballi 2012-01-31 12:19:21 UTC
On master branch, kaleb sent a patch which fixes these issues. http://review.gluster.com/2693, hence marking the bug for QA.


Note You need to log in before you can comment on or make changes to this bug.