Skip Menu |
 

Subject: make check breaks in AIX
To: krb5-bugs@mit.edu
From: "Lavanya M Sirreddy" <lsirredd@in.ibm.com>
Date: Tue, 16 Jan 2018 17:42:26 +0530
CC: Sandeep Umesh <sanumesh@in.ibm.com>
Download (untitled) / with headers
text/plain 2.6KiB

  >Originator: Lavanya M S
>Organization: IBM
>Confidential: no
>Synopsis: make check breaks in AIX 6.1
>Severity: non-critical
>Priority: high
>Category: krb5-doc
>Class: support
>Release: krb 1.16
>Environment: AIX 6.1
power pc
>Description:
make check breaks in AIX 6.1

Following is the error while doing make check in kerberos 1.16

gcc -maix32 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -L../../lib -Wl,-blibpath:/usr/local/lib::/usr/lib:/lib -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX53 -D_AIX61 -D_AIX71 -D_AIX72 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include -L/opt/freeware/lib -Wl,-bmaxdata:0x80000000 -Wl,-brtl -o test_et test_et.o test1.o test2.o -lcom_err -lkrb5support
LIBPATH=`echo -L../../lib | sed -e "s/-L//g" -e "s/ /:/g"`:/usr/local/lib:/usr/lib:/usr/local/lib KRB5_CONFIG=../../config-files/krb5.conf LC_ALL=C ./test_et
Before initiating error table:

Table name 'krb'
UNIX name ''
Msg TGT-expired is 'Unknown code krb 2'
Msg EPERM is 'Not owner'
Msg FOO_ERR is 'Unknown code quux 0'
Msg 1002 is 'Unknown code C 234'
Msg {sys_nerr-1} is 'Value too large to be stored in data type'
Msg {sys_nerr} is 'Error 128 occurred.'
Msg 0 is 'Unknown code 0'
With 0: tgt-expired -> Unknown code krb 2
KRB error table initialized: base 39525376 (Can't read ticket file), name krb
With krb: tgt-expired -> TGT expired
QUUX error table initialized: base -1359220224 (foo), name quux
Msg for TGT-expired is 'TGT expired'
Msg {sys_nerr-1} is 'Value too large to be stored in data type'
Msg FOO_ERR is 'foo'
Msg KRB_SKDC_CANT is 'Can't send request'
Msg 1e6 (8B 64) is 'Unknown code 8B 64'


COM_ERR tests:
whoami: foo
whoami: foo -- message goes here
whoami:
whoami: error number 0

k5_mutex_lock: Received error 22 (Invalid argument)
Assertion failed: __EX, file ../../include/k5-thread.h, line 376
make: 1254-059 The signal code from the last command is 6.


Stop.
make: 1254-004 The error code from the last command is 1.


Stop.
make: 1254-004 The error code from the last command is 1.


Stop.

>How-To-Repeat:

Apply following patches on kerberos 1.16
krb5-1.15.1-k5tls-lpthreads-v2.patch

krb5-1.15.1-aix67.patch
krb5-1.15.1-shopts-workaround.patch

./configure --enable-shared --enable-dns-for-realm --with-tcl --with-system-verto=no --with-ldap --enable-pkinit

make

make check

>Fix :
N/A


Regards,
Lavanya M S
************************************************
IBM India Software Lab,
EGL- D Block, 7th Floor.
Off Koramangala - Indranagar Ring Road,
Bangalore-71 , India
************************************************

I see two potential candidates for the failing k5_mutex_lock() call,
based on the k5_mutex_lock() calls which occur in test_et after the
last line of output is written:

1. com_err_terminate() -> krb5int_key_delete() ->
k5_mutex_lock(&key_lock)
2. com_err_terminate() -> k5_mutex_lock(&et_list_lock)

Candidate 2 seems unlikely as the destruction of et_list_lock clearly
happens after the k5_mutex_lock() call.

For candidate 1, If the libkrb5support finalizer runs before the
libcom_err finalizer, key_lock would be destroyed before we lock it
and we would get an EINVAL. Since AIX doesn't seem to do shared
library dependencies, I guess it's not surprising that it would also
not do library finalizer ordering. The best workaround is probably
to avoid running library finalizers on AIX.
I believe this is happening due to a library finalization ordering
issue. We assume that libraries are finalized in reverse dependency
order--in this case, since libcom_err uses libkrb5support, we assume
that the libcom_err finalizer can call libkrb5support functions and
have them work (because libkrb5support finalizers won't run until
afterwards).

If AIX cannot provide this guarantee, the simplest workaround is
probably to disable library finalizers on AIX, at the cost of leaking a
little bit of memory if the krb5 libraries are repeatedly loaded and
unloaded. To do this, try removing the line
"use_linker_fini_option=yes" from the *-*-aix5* branch of
src/config/shlib.conf.
Subject: Re: [krbdev.mit.edu #8632] make check breaks in AIX
To: rt-comment@krbdev.mit.edu
From: "Lavanya M Sirreddy" <lsirredd@in.ibm.com>
Date: Thu, 18 Jan 2018 18:05:39 +0530
RT-Send-Cc:

Hi,

I removed use_linker_fini_option=yes under *-*-aix5* in src/config/shlib.conf and compiled.
Then got following error.

/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/collect2 -bpT:0x10000000 -bpD:0x20000000 -btextro -bM:SRE -bnoentry -o libk5crypto.so.3.1 -L../../lib -L/opt/freeware/lib -L/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0 -L/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/../../.. builtin/enc_provider/des.o builtin/enc_provider/des3.o builtin/enc_provider/rc4.o builtin/enc_provider/aes.o builtin/enc_provider/camellia.o builtin/hash_provider/hash_crc32.o builtin/hash_provider/hash_md4.o builtin/hash_provider/hash_md5.o builtin/hash_provider/hash_sha1.o builtin/hash_provider/hash_sha2.o builtin/md4/md4.o builtin/md5/md5.o builtin/sha1/shs.o builtin/sha2/sha256.o builtin/sha2/sha512.o builtin/aes/aescrypt.o builtin/aes/aestab.o builtin/aes/aeskey.o builtin/des/d3_aead.o builtin/des/d3_kysched.o builtin/des/des_keys.o builtin/des/f_aead.o builtin/des/f_cksum.o builtin/des/f_parity.o builtin/des/f_sched.o builtin/des/f_tables.o builtin/des/key_sched.o builtin/des/weak_key.o builtin/camellia/camellia.o krb/aead.o krb/block_size.o krb/cf2.o krb/checksum_cbc.o krb/checksum_confounder.o krb/checksum_dk_cmac.o krb/checksum_dk_hmac.o krb/checksum_etm.o krb/checksum_hmac_md5.o krb/checksum_unkeyed.o krb/checksum_length.o krb/cksumtype_to_string.o krb/cksumtypes.o krb/cmac.o krb/coll_proof_cksum.o krb/combine_keys.o krb/crc32.o krb/crypto_length.o krb/crypto_libinit.o krb/default_state.o krb/decrypt.o krb/decrypt_iov.o krb/derive.o krb/encrypt.o krb/encrypt_iov.o krb/encrypt_length.o krb/enctype_util.o krb/enc_dk_cmac.o krb/enc_dk_hmac.o krb/enc_etm.o krb/enc_old.o krb/enc_raw.o krb/enc_rc4.o krb/etypes.o krb/key.o krb/keyblocks.o krb/keyed_cksum.o krb/keyed_checksum_types.o krb/keylengths.o krb/make_checksum.o krb/make_checksum_iov.o krb/make_random_key.o krb/mandatory_sumtype.o krb/nfold.o krb/old_api_glue.o krb/prf.o krb/prf_aes2.o krb/prf_cmac.o krb/prf_des.o krb/prf_dk.o krb/prf_rc4.o krb/prng.o krb/prng_fortuna.o krb/random_to_key.o krb/s2k_des.o krb/s2k_pbkdf2.o krb/s2k_rc4.o krb/state.o krb/string_to_cksumtype.o krb/string_to_key.o krb/valid_cksumtype.o krb/verify_checksum.o krb/verify_checksum_iov.o builtin/hmac.o builtin/init.o builtin/pbkdf2.o -bgcbypass:1 -bfilelist -bM:SRE -bE:./libk5crypto.exports -bernotok -brtl -lkrb5support -lpthreads -bmaxdata:0x80000000 -brtl -lc -binitfini::cryptoint_cleanup_library:2 -lgcc_s -lc -lgcc_s
ld: 0706-026 The -b filelist option is ignored.
ld: 0711-328 ERROR: Undefined initfini symbol: cryptoint_cleanup_library
collect2: error: ld returned 8 exit status
make: 1254-004 The error code from the last command is 1.

So I did following changes in src/config/shlib_conf

- MAKE_SHLIB_COMMAND="${INIT_FINI_PREP} && ${LDCOMBINE}"
+ MAKE_SHLIB_COMMAND=${LDCOMBINE}"

Is this change correct?

Regards,
Lavanya M S
************************************************
IBM India Software Lab,
EGL- D Block, 7th Floor.
Off Koramangala - Indranagar Ring Road,
Bangalore-71 , India
************************************************

I think removing the INIT_FINI_PREP assignment in the aix5 arm of the
case statement is better, but it will have the same effect. Sorry I
didn't catch that when making the suggestion.
Subject: Re: [krbdev.mit.edu #8632] make check breaks in AIX
To: rt-comment@krbdev.mit.edu
From: "Lavanya M Sirreddy" <lsirredd@in.ibm.com>
Date: Mon, 22 Jan 2018 17:14:20 +0530
RT-Send-Cc:
Download (untitled) / with headers
text/plain 2.7KiB

Hi,

I did changes by removing INIT_FINI_PREP and did make.
Later make check failed with following error.

PYTHONPATH=../../util VALGRIND="" python ./t_gss_sample.py
*** Failure: /opt/freeware/src/packages/SOURCES/src/krb5-1.16/src/appl/gss-sample/gss-client failed with code -4.
*** Last command (#10): /opt/freeware/src/packages/SOURCES/src/krb5-1.16/src/appl/gss-sample/gss-client -port 61005 -krb5 vayu07.in.ibm.com host testmsg
*** Failed in test pass: default

For details, see: /opt/freeware/src/packages/SOURCES/src/krb5-1.16/src/appl/gss-sample/testlog
Or re-run this test script with the -v flag:
cd /opt/freeware/src/packages/SOURCES/src/krb5-1.16/src/appl/gss-sample
PYTHONPATH=/opt/freeware/src/packages/SOURCES/src/krb5-1.16/src/util /usr/bin/python ./t_gss_sample.py -v

Use --debug=NUM to run a command under a debugger. Use
--stop-after=NUM to stop after a daemon is started in order to
attach to it with a debugger. Use --help to see other options.
make: 1254-004 The error code from the last command is 1.

After executing PYTHONPATH=/opt/freeware/src/packages/SOURCES/src/krb5-1.16/src/util /usr/bin/python ./t_gss_sample.py -v --debug

*** [10] Executing in debugger: gdb --args /opt/freeware/src/packages/SOURCES/src/krb5-1.16/src/appl/gss-sample/gss-client -port 61005 -krb5 xxx.in.ibm.com host testmsg
Traceback (most recent call last):
File "./t_gss_sample.py", line 98, in <module>
tgs_test(realm, ['-krb5'])
File "./t_gss_sample.py", line 64, in tgs_test
server_client_test(realm, options, server_options)
File "./t_gss_sample.py", line 47, in server_client_test
expected_msg='Signature verified.')
File "./t_gss_sample.py", line 40, in run_client_server
[hostname, 'host', 'testmsg'], **kwargs)
File "/opt/freeware/src/packages/SOURCES/src/krb5-1.16/src/util/k5test.py", line 933, in run
return _run_cmd(args, env, **keywords)
File "/opt/freeware/src/packages/SOURCES/src/krb5-1.16/src/util/k5test.py", line 679, in _run_cmd
return _debug_cmd(args, env, input)
File "/opt/freeware/src/packages/SOURCES/src/krb5-1.16/src/util/k5test.py", line 728, in _debug_cmd
code = subprocess.call(args, env=env)
File "/opt/freeware/lib/python2.7/subprocess.py", line 523, in call
return Popen(*popenargs, **kwargs).wait()
File "/opt/freeware/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/opt/freeware/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory



Regards,
Lavanya M S
************************************************
IBM India Software Lab,
EGL- D Block, 7th Floor.
Off Koramangala - Indranagar Ring Road,
Bangalore-71 , India
************************************************

I think that Python traceback is just a result of gdb not being
installed. You will need to use --debugger=... to specify the debugger
to use, and then use that to figure out why gss-client is failing.
Subject: Re: [krbdev.mit.edu #8632] make check breaks in AIX
To: rt-comment@krbdev.mit.edu
From: "Lavanya M Sirreddy" <lsirredd@in.ibm.com>
Date: Wed, 24 Jan 2018 17:05:55 +0530
RT-Send-Cc:
Download (untitled) / with headers
text/plain 1.5KiB

Hi,

After using --debugger and --debug=10 got following error :

PYTHONPATH=../../util VALGRIND="" python ./t_gss_sample.py
*** Failure: /opt/freeware/src/packages/SOURCES/src/krb5-1.16/src/appl/gss-sample/gss-client failed with code -4.
*** Last command (#10): /opt/freeware/src/packages/SOURCES/src/krb5-1.16/src/appl/gss-sample/gss-client -port 61005 -krb5 vayu07.in.ibm.com host testmsg
*** Failed in test pass: default

For details, see: /opt/freeware/src/packages/SOURCES/src/krb5-1.16/src/appl/gss-sample/testlog
Or re-run this test script with the -v flag:
cd /opt/freeware/src/packages/SOURCES/src/krb5-1.16/src/appl/gss-sample
PYTHONPATH=/opt/freeware/src/packages/SOURCES/src/krb5-1.16/src/util /usr/bin/python ./t_gss_sample.py -v

Use --debug=NUM to run a command under a debugger. Use
--stop-after=NUM to stop after a daemon is started in order to
attach to it with a debugger. Use --help to see other options.
make: 1254-004 The error code from the last command is 1.


PYTHONPATH=/opt/freeware/src/packages/SOURCES/src/krb5-1.16/src/util /usr/bin/python ./t_gss_sample.py -v --debug=10 --debugger=dbx

GSS-API error initializing context: Unspecified GSS failure. Minor code may provide more information
GSS-API error initializing context: No Kerberos credentials available (default cache: /tmp/ccache)

execution completed (exit code 1)

Regards,
Lavanya M S
************************************************
IBM India Software Lab,
EGL- D Block, 7th Floor.
Off Koramangala - Indranagar Ring Road,
Bangalore-71 , India
************************************************