From hartmans@MIT.EDU Thu Feb 27 21:58:21 1997 Received: from MIT.EDU (SOUTH-STATION-ANNEX.MIT.EDU [18.72.1.2]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id VAA14216 for ; Thu, 27 Feb 1997 21:58:20 -0500 Received: from LUMINOUS.MIT.EDU by MIT.EDU with SMTP id AA29057; Thu, 27 Feb 97 21:58:19 EST Received: (from hartmans@localhost) by luminous.MIT.EDU (8.8.5/8.6.12) id VAA29387; Thu, 27 Feb 1997 21:58:18 -0500 (EST) Message-Id: <199702280258.VAA29387@luminous.MIT.EDU> Date: Thu, 27 Feb 1997 21:58:18 -0500 (EST) From: Sam Hartman Reply-To: hartmans@MIT.EDU To: krb5-bugs@MIT.EDU Cc: probe@MIT.EDU Subject: klist dumps core if ccache not found X-Send-Pr-Version: 3.99 >Number: 383 >Category: krb5-libs >Synopsis: com_err_hook declared static in source, extern in header >Confidential: no >Severity: serious >Priority: high >Responsible: hartmans >State: closed >Class: sw-bug >Submitter-Id: unknown >Arrival-Date: Thu Feb 27 21:59:01 EST 1997 >Last-Modified: Sat Mar 01 17:35:30 EST 1997 >Originator: Sam Hartman >Organization: MIT >Release: 1.1-development >Environment: System: NetBSD luminous 1.2B NetBSD 1.2B (LUMINOUS) #17: Thu Dec 19 02:15:35 EST 1996 hartmans@luminous:/u1/usr/src/sys/arch/i386/compile/LUMINOUS i386 >Description: I built the current sources and klist dumps core if the ccache cannot be found. I know I am using the right shared libraries. It turns out that com_err_hook was declared extern in com_err.h and static in com_err.c. Both gas and gld gave warnings that something strange was going on; they were right. >How-To-Repeat: hartmans@luminous:tmp(1)> cd /tmp hartmans@luminous:/tmp(2)> KRB5CCNAME=/tmp/foobazuu klist Segmentation fault (core dumped) hartmans@luminous:/tmp(3)> which klist /usr/local/bin/klist hartmans@luminous:/tmp(4)> gdb /usr/local/build/krb5/clients/klist/klist klist.core GDB is free software and you are welcome to distribute copies of it under certain conditions; type "show copying" to see the conditions. There is absolutely no warranty for GDB; type "show warranty" for details. GDB 4.11 (i386-netbsd), Copyright 1993 Free Software Foundation, Inc... Core was generated by `klist'. Program terminated with signal 11, Segmentation fault. Reading symbols from /usr/libexec/ld.so...done. Reading symbols from /usr/local/lib/libkrb5.so.1.1...done. Reading symbols from /usr/local/lib/libcrypto.so.1.1...done. Reading symbols from /usr/local/lib/libcom_err.so.3.0...done. Reading symbols from /usr/lib/libc.so.12.10...done. #0 0xb018680 in end () (gdb) bt #0 0xb018680 in end () #1 0x1006942e in com_err_va (whoami=0xf7bfdb74 "klist", code=-1765328189, fmt=0x21ed "while setting cache flags (ticket cache %s)", ap=0xf7bfd648 "@`") at ../../../../src/krb5/src/util/et/com_err.c:104 #2 0x1006945a in com_err (whoami=0xf7bfdb74 "klist", code=-1765328189, fmt=0x21ed "while setting cache flags (ticket cache %s)") at ../../../../src/krb5/src/util/et/com_err.c:127 #3 0x2462 in do_ccache (name=0x0) at ../../../../src/krb5/src/clients/klist/klist.c:283 #4 0x1cb2 in main (argc=1, argv=0xf7bfd6d8) at ../../../../src/krb5/src/clients/klist/klist.c:156 (gdb) up #1 0x1006942e in com_err_va (whoami=0xf7bfdb74 "klist", code=-1765328189, fmt=0x21ed "while setting cache flags (ticket cache %s)", ap=0xf7bfd648 "@`") at ../../../../src/krb5/src/util/et/com_err.c:104 104 (*com_err_hook)(whoami, code, fmt, ap); (gdb) p com_err_hook $1 = (void (*)()) 0x63657865 (gdb) down #0 0xb018680 in end () x/i $eip 0xb018680 : Cannot access memory at address 0xb018680. (gdb) p $eip $2 = (void *) 0xb018680 (gdb) quit hartmans@luminous:/tmp(5)> ldd /usr/local/bin/klist /usr/local/bin/klist: -lkrb5.1 => /usr/local/lib/libkrb5.so.1.1 (0x1001a000) -lcrypto.1 => /usr/local/lib/libcrypto.so.1.1 (0x1005b000) -lcom_err.3 => /usr/local/lib/libcom_err.so.3.0 (0x10069000) -lc.12 => /usr/lib/libc.so.12.10 (0x1006b000) hartmans@luminous:/tmp(6)> rm klist.core hartmans@luminous:/tmp(7)> >Fix: Do not declare the same identifier with both internal and external linkage. >Audit-Trail: From: "Richard Basch" To: hartmans@MIT.EDU Cc: krb5-bugs@MIT.EDU Subject: Re: krb5-clients/383: klist dumps core if ccache not found Date: Thu, 27 Feb 1997 22:23:28 -0500 I can't reproduce the coredump, so if you can narrow down the problem, that would be appreciated... I don't have access to a NetBSD box, and it doesn't fail on any other platform on which I have access. 765-1$ KRB5CCNAME=/ldj /opt/krb5/bin/klist klist: No credentials cache file found while setting cache flags (ticket cache /ldj) 766-1$ I will try to run Purify over everything, in the hopes that maybe it will turn up something... however, I do not have high hopes... -- Richard Basch Sr. Developer/Analyst, DSO URL: http://web.mit.edu/basch/www/home.html Lehman Brothers, Inc. Email: basch@lehman.com, basch@mit.edu 101 Hudson St., 38th Floor Fax: +1-201-524-5828 Jersey City, NJ 07302-3988 Voice: +1-201-524-5049 From: "Richard Basch" To: "Richard Basch" Cc: hartmans@MIT.EDU, krb5-bugs@MIT.EDU Subject: Re: krb5-clients/383: klist dumps core if ccache not found Date: Fri, 28 Feb 1997 00:46:27 -0500 On Thu, 27-February-1997, "Richard Basch" wrote to "hartmans@MIT.EDU, krb5-bugs@MIT.EDU" saying: > I can't reproduce the coredump, so if you can narrow down the problem, > that would be appreciated... I don't have access to a NetBSD box, and > it doesn't fail on any other platform on which I have access. > > 765-1$ KRB5CCNAME=/ldj /opt/krb5/bin/klist > klist: No credentials cache file found while setting cache flags (ticket cache /ldj) > 766-1$ > > I will try to run Purify over everything, in the hopes that maybe it > will turn up something... however, I do not have high hopes... Purify output: Finished klist ( 0 errors, 0 leaked bytes) Purify instrumented ./klist (pid 26490 at Fri Feb 28 00:39:26 1997) Current file descriptors in use: 7 Memory leaked: 0 bytes (0%); potentially leaked: 0 bytes(0%) Program exited with status code 1. Doesn't NetBSD also have incompatible comerr libraries (version 2.x)? Make sure your config.cache didn't cache the wrong value and that you are linked against the correct version of the comerr library. Anyway, without further information, I am not sure I can figure out what is going on. -- Richard Basch Sr. Developer/Analyst, DSO URL: http://web.mit.edu/basch/www/home.html Lehman Brothers, Inc. Email: basch@lehman.com, basch@mit.edu 101 Hudson St., 38th Floor Fax: +1-201-524-5828 Jersey City, NJ 07302-3988 Voice: +1-201-524-5049 From: Sam Hartman To: "Richard Basch" Cc: krb5-unassigned@RT-11.MIT.EDU, krb5-bugs@MIT.EDU Subject: Re: krb5-clients/383: klist dumps core if ccache not found Date: 28 Feb 1997 09:10:22 -0500 >>>>> "Richard" == Richard Basch writes: Richard> Doesn't NetBSD also have incompatible comerr libraries Richard> (version 2.x)? Make sure your config.cache didn't cache Richard> the wrong value and that you are linked against the Richard> correct version of the comerr library. Anyway, without Richard> further information, I am not sure I can figure out what Richard> is going on. Yes, which is one good reason to seriously consider maintaining compatability between new error table .c files and old libcom_err libraries. (I think you will set the problem on BSDI and many operating systems that have native KRB4 support). However, I was linked against the right library. I will run through the code later today. From: "Richard Basch" To: Sam Hartman Cc: "Richard Basch" , krb5-unassigned@RT-11.MIT.EDU, krb5-bugs@MIT.EDU Subject: Re: krb5-clients/383: klist dumps core if ccache not found Date: Fri, 28 Feb 1997 10:05:24 -0500 On , 28-February-1997, "Sam Hartman" wrote to "Richard Basch, krb5-unassigned@RT-11.MIT.EDU, krb5-bugs@mit.edu" saying: > >>>>> "Richard" == Richard Basch writes: > > Richard> Doesn't NetBSD also have incompatible comerr libraries > Richard> (version 2.x)? Make sure your config.cache didn't cache > Richard> the wrong value and that you are linked against the > Richard> correct version of the comerr library. Anyway, without > Richard> further information, I am not sure I can figure out what > Richard> is going on. > > Yes, which is one good reason to seriously consider > maintaining compatability between new error table .c files and old > libcom_err libraries. (I think you will set the problem on BSDI and > many operating systems that have native KRB4 support). I believe I have maintained compatibility with the old comerr, as written by MIT and as present in the Athena release. Since I do not know what was done to the BSDI and NetBSD comerr, I do not know how to maintain compatibility. If someone can give me a handle to that source excerpt, I can see whether it should interoperate. -- Richard Basch Sr. Developer/Analyst, DSO URL: http://web.mit.edu/basch/www/home.html Lehman Brothers, Inc. Email: basch@lehman.com, basch@mit.edu 101 Hudson St., 38th Floor Fax: +1-201-524-5828 Jersey City, NJ 07302-3988 Voice: +1-201-524-5049 From: Sam Hartman To: "Richard Basch" Cc: krb5-bugs@MIT.EDU Subject: Re: krb5-clients/383: klist dumps core if ccache not found Date: 28 Feb 1997 15:09:27 -0500 So, I understand why it is crashing, but not why the why is: * com_err_hook is getting set to some large address in the middle of no where by the time the first line of main is executed. I'm looking into potential shared library build problems. --Sam Responsible-Changed-From-To: krb5-unassigned->hartmans Responsible-Changed-By: hartmans Responsible-Changed-When: Sat Mar 1 12:34:52 1997 Responsible-Changed-Why: Dealing with problem. State-Changed-From-To: open-closed State-Changed-By: hartmans State-Changed-When: Sat Mar 1 12:36:01 1997 State-Changed-Why: ANSI 3.1.2.2 says you lose. From: Sam Hartman To: hartmans@MIT.EDU Cc: krb5-bugs@MIT.EDU Subject: Re: krb5-libs/383: com_err_hook declared static in source, extern in header Date: Sat, 1 Mar 1997 12:35:43 -0500 (EST) `Sam Hartman' made changes to this PR. --- /tmp/gnatsa15756 Sat Mar 1 12:31:03 1997 +++ /tmp/gnatsb15756 Sat Mar 1 12:34:11 1997 @@ -13,8 +13,8 @@ X-Send-Pr-Version: 3.99 >Number: 383 ->Category: krb5-clients ->Synopsis: klist dumps core if ccache not found +>Category: krb5-libs +>Synopsis: com_err_hook declared static in source, extern in header >Confidential: no >Severity: serious >Priority: high @@ -37,6 +37,10 @@ I built the current sources and klist dumps core if the ccache cannot be found. I know I am using the right shared libraries. + + It turns out that com_err_hook was declared extern in +com_err.h and static in com_err.c. Both gas and gld gave warnings +that something strange was going on; they were right. >How-To-Repeat: @@ -93,6 +97,8 @@ hartmans@luminous:/tmp(6)> rm klist.core hartmans@luminous:/tmp(7)> >Fix: + +Do not declare the same identifier with both internal and external linkage. >Audit-Trail: >Unformatted: