Bug 1281348

Summary: Upstream unit tests loads the installed shared libraries instead the ones from the build
Product: Red Hat Enterprise Linux 6 Reporter: Patrik Kis <pkis>
Component: krb5Assignee: Robbie Harwood <rharwood>
Status: CLOSED ERRATA QA Contact: Patrik Kis <pkis>
Severity: medium Docs Contact:
Priority: high    
Version: 6.8CC: dpal, jplans, nalin, pkis
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://github.com/krb5/krb5/pull/340
Whiteboard:
Fixed In Version: krb5-1.10.3-62.el6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1164304
: 1297591 (view as bug list) Environment:
Last Closed: 2017-03-21 10:03:13 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:
Bug Depends On:    
Bug Blocks: 1297591    

Description Patrik Kis 2015-11-12 11:03:21 UTC
This problem also exists in RHEL-6.7 version of krb5. It remained unattended due to an error in our test.
Please fix it so we can be sure the intended version of krb5 is tested.

Affected version: krb5-1.10.3-45.el6

The crash mentioned in the original report was not seen, but the installed libraries are loaded according the audit logs. And the fix from upstream patch is also not present on the src of the test.

+++ This bug was initially created as a clone of Bug #1164304 +++

Description of problem:
krb5-1.12.2/src/lib/kadm5/unit-test fails (segfaults) when krb5-pkinit is installed on the sysytem.
Monitoring via audit showed that unit tests from this directory loads pkinit.so from the installed package and not the one that was built.
On top of that, monitoring showed that libs from the installed krb5-libs (whatever version installed) are loaded too.
This questions the effectiveness of upstream testing.

Version-Release number of selected component (if applicable):
krb5-libs-1.12.2-8.el7

How reproducible:
always

Steps to Reproduce:

# rpm -qa krb5\*
krb5-devel-1.11.3-49.el7.ppc64
krb5-libs-1.11.3-49.el7.ppc64
krb5-pkinit-1.11.3-49.el7.ppc64
#
# rpm -ivh krb5-1.12.2-8.el7.src.rpm 
... snip ...
# rpmbuild -bc ~/rpmbuild/SPECS/krb5.spec 
... snip ...
#
# cd ~/rpmbuild/BUILD/krb5-1.12.2/src/
# make runenv.py
LD_LIBRARY_PATH=`echo -L./lib | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;  \
for i in LD_LIBRARY_PATH; do \
	eval echo 'env['\\\'$i\\\''] = '\\\'\$$i\\\'; \
done > pyrunenv.vals
echo "proxy_tls_impl = 'openssl'" >> pyrunenv.vals
echo 'env = {}' > runenv.py
cat pyrunenv.vals >> runenv.py
# cd lib/kadm5/unit-test/
# make check
.. snip ...
	KINIT=../../../clients/kinit/kinit \
	KDESTROY=../../../clients/kdestroy/kdestroy \
	KADMIN_LOCAL=../../../kadmin/cli/kadmin.local \
	PRIOCNTL_HACK=0 VALGRIND="" \
	
WARNING: Couldn't find the global config file.
WARNING: Couldn't find tool init file
Test Run By root on Fri Nov 14 10:30:35 2014
Native configuration is powerpc64-redhat-linux-gnu

		=== api tests ===

Schedule of variations:
    unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using ./config/unix.exp as tool-and-target-specific interface file.
Running ./api.2/crte-policy.exp ...
FAIL: create-policy 1: eof
ERROR: create-policy 1: unexpected failure in init
ERROR: create-policy 2: unexpected failure in init
ERROR: create-policy 3: unexpected failure in init
kadmin/testing/proto/krb5.conf.proto

Comment 1 Robbie Harwood 2015-11-13 18:16:16 UTC
I (but mostly Greg) have made some changes on this front upstream, though they were for 1.14 and I have no idea how well they'll backport.

Comment 3 Patrik Kis 2015-11-16 11:55:47 UTC
(In reply to Robbie Harwood from comment #1)
> I (but mostly Greg) have made some changes on this front upstream, though
> they were for 1.14 and I have no idea how well they'll backport.

These 2 lines help for krb5-1.10.3 too:
https://github.com/krb5/krb5/pull/340/files
but I can imagine there was more robust fix at the end.

Comment 4 Robbie Harwood 2015-11-16 17:54:35 UTC
Indeed, that was my original attempt to fix the issue, but it turns out to run deeper.  The final fix was https://github.com/krb5/krb5/pull/341

Comment 13 errata-xmlrpc 2017-03-21 10:03:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0643.html