Skip Menu |
 

From: Nehal J Wani <nehaljw.kkd1@gmail.com>
Date: Wed, 6 Jun 2018 10:38:42 +0530
Subject: krb5 1.16.1 Build Failures
To: krb5-bugs@mit.edu
Download (untitled) / with headers
text/plain 4.2KiB
Hi,

I was trying to build krb5 1.16.1 with gcc 7.2.0 on different
platforms (linux-32bit, linux-64bit and linux-ppc64le)

I came across the following build failure on linux-ppc64le and
linux-32 bit. When I removed -DNDEBUG from the CPPFLAGS, the build
passed. I am a bit surprised that I didn't see the same failure on
linux-64.

/tmp/build/80754af9/krb5_1528223574121/_build_env/bin/i686-conda_cos6-linux-gnu-cc
-DHAVE_CONFIG_H -I../../include -I../../include -DKRB5_DEPRECATED=1
-DKRB5_PRIVATE -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -[22/1907]
ld/80754af9/krb5_1528223574121/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla
cehold_placehold_placehold_placehold/include -march=prescott
-mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong
-fno-plt -O2 -pipe
-I/tmp/build/80754af9/krb5_1528223574121/_h_env_placehold_placehold_
placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/include
-fdebug-prefi
x-map=/tmp/build/80754af9/krb5_1528223574121/work=/usr/local/src/conda/krb5-1.16.1
-fdebug-prefix-map=/tmp/build/80754af9/krb5_1528223574121/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_pla
cehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold=/usr/local/src/conda-prefix
-Wall -Wcast-align -Wshadow -Wmissin
g-prototypes -Wno-format-zero-length -Woverflow -Wstrict-overflow
-Wmissing-format-attribute -Wmissing-prototypes -Wreturn-type
-Wmissing-braces -Wparentheses -Wswitch -Wunused-function
-Wunused-label -Wunused-v
ariable -Wunused-value -Wunknown-pragmas -Wsign-compare
-Werror=uninitialized -Wno-maybe-uninitialized -Werror=pointer-arith
-Werror=int-conversion -Werror=incompatible-pointer-types
-Werror=discarded-qualifiers
-Werror=implicit-int -Werror=declaration-after-statement
-Werror-implicit-function-declaration -pthread -c t_path.c
In file included from ../../include/k5-platform.h:233:0,
from t_path.c:27:
../../include/k5-thread.h: In function 'k5_mutex_lock':
../../include/k5-thread.h:369:9: warning: unused variable 'r'
[-Wunused-variable]
int r = k5_os_mutex_lock(m);
^
../../include/k5-thread.h: In function 'k5_mutex_unlock':
../../include/k5-thread.h:381:9: warning: unused variable 'r'
[-Wunused-variable]
int r = k5_os_mutex_unlock(m);
^
t_path.c: In function 'main':
t_path.c:126:66: warning: variable 'path2' set but not used
[-Wunused-but-set-variable]
const char *edirname, *ebasename, *ejoined, *ipath, *path1, *path2;
^~~~~
t_path.c:126:58: warning: variable 'path1' set but not used
[-Wunused-but-set-variable]
const char *edirname, *ebasename, *ejoined, *ipath, *path1, *path2;
^~~~~
t_path.c:126:50: warning: variable 'ipath' set but not used
[-Wunused-but-set-variable]
const char *edirname, *ebasename, *ejoined, *ipath, *path1, *path2;
^~~~~
t_path.c:141:9: error: 'dirname' is used uninitialized in this
function [-Werror=uninitialized]
free(dirname);
^~~~~~~~~~~~~
t_path.c:143:9: error: 'basename' is used uninitialized in this
function [-Werror=uninitialized]
free(basename);
^~~~~~~~~~~~~~
t_path.c:173:9: error: 'joined' is used uninitialized in this function
[-Werror=uninitialized]
free(joined);
^~~~~~~~~~~~
cc1: some warnings being treated as errors


Another failure which I saw was:
make[2]: Entering directory
'/root/worker/containers/00003vfm02t/tmp/build/80754af9/krb5_1528258840433/work/src/appl/user_user'
PYTHONPATH=../../util VALGRIND="" python ./t_user2user.py
*** Failure: ./uuserver failed to start with code 3.
*** Last command (#8): ./uuserver 9999
*** Output of last command:
uu-server: Address already in use binding socket
*** Failed in test pass: default

I got around it by stopping my service listening on port 9999. But why
hard code the port? Why not just find out the port which is unused and
then use it?


Cheers!

Nehal J Wani
I will fix the side-effecting asserts in t_path.c.

We unfortunately have hardcoded ports in a bunch of places in our test
suite, and just haven't done the work of fixing them. Fixing them
without a race condition would be somewhat difficult in the various
places where we stand up a KDC, but simply checking ahead of time for
an unused port might not be too hard. Another option we have
considered is wrapping all client/server tests with cwrap. This change
would come at some cost, in that we might not detect bugs which
manifest in a real network stack and not cwrap's implementation, but
would have the benefit that we wouldn't be listening on the potentially
open Internet during test runs.
From: ghudson@mit.edu
Subject: git commit

Fix assert hygiene in t_path.c

Correct all uses of side-effecting asserts in t_path.c so that it
works correctly when NDEBUG is defined. Reported by Nehal J Wani.

https://github.com/krb5/krb5/commit/46b7940cd8cabb29c62fc063854d7eaeb906b902
Author: Greg Hudson <ghudson@mit.edu>
Commit: 46b7940cd8cabb29c62fc063854d7eaeb906b902
Branch: master
src/util/support/t_path.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)