weired case, help needed !

Kent_Wu@trendmicro.com Kent_Wu at trendmicro.com
Fri Mar 12 18:30:01 EST 2004


Hi,
 
    This case only happens in our Solaris 8 environment and it only happens when 
Java Tomcat, JNI and our kerberos c code are involved. If I runn the kerberos c code
by itself, it's working fine.
 
    Here is the whole story, we use Java Tomcat as our web host, however we have a 
LDAP module which uses MIT kerberos inside in c++ code, in order to let Tomcat talk
to our c++ module, we use JNI as the bridge. If we run the c++ LDAP module
by itself, it's working fine. However if we invoke the same function through
Tomcat (GUI interface), it would crash inside the krb5_init_context() API.
Here I listed the dbx analysis after we got the core file, the highlight would be:
 
  [9] JVM_handle_solaris_signal(0xef757d60, 0xf0373d60, 0xf0373aa8, 0x3400, 0x35
58, 0x0), at 0xfe33d668
  [10] __sighndlr(0xb, 0xf0373d60, 0xf0373aa8, 0xfe33b174, 0xf0381e14, 0xf0381e0
4), at 0xff30b7dc
  [11] sigacthandler(0xb, 0xf0381d70, 0x0, 0x0, 0x0, 0xff31e000), at 0xff3084c0
  ---- called from signal handler with signal 11 (SIGSEGV) ------
[12] profile_node_iterator(0xf0373ea4, 0x0, 0x0, 0xf0373ea0, 0x4cbc10, 0x0), a
t 0xef757d60
  [13] profile_get_value(0x0, 0xf0373f10, 0xf0373f0c, 0x7efefeff, 0x81010100, 0x
ff00), at 0xef759670
  [14] profile_get_integer(0x4ca9b8, 0xef75e5e4, 0xef75e5f0, 0x0, 0x7, 0xf0373f8
4), at 0xef7597b8
  [15] init_common(0xf037406c, 0x0, 0x4ca9d8, 0x970ea400, 0x970ea724, 0xff1a4100
), at 0xef73e028
=>[16] LDAP_module::_get_TGT(this = 0xf0374350), line 983 in "LDAP_module.cpp"
  
We can see clearly it crashes inside profile_node_iterator() function.
The interesting thing is we haven't really done anything fancy, all we do is calling
krb5_init_context() to initialize the kerberos context and it's absolutely necessary
to do any kerberos operation. The _get_TGT() souce code is as follows,
 
/* private */
bool LDAP_module::_get_TGT()
{
 krb5_error_code ret;
 krb5_context context = 0;
 krb5_principal princ = 0;
 
 if ((ret = krb5_init_context(&context))) 
 {
....
 }
 ........
 
}
 
And this won't happen either in windows and linux environment. It kinda bothers me that
it only happens in the calling sequence of Java->JNI->kerberos c code, I'm hoping somebody
has run into similar situation before and can give me some insight/feedback.
 
Thanks a lot in advance.
 
Kent
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
  [1] __sigprocmask(0x0, 0xf0372d50, 0x0, 0x0, 0x0, 0x0), at 0xff309740
  [2] _resetsig(0xff30bf18, 0x0, 0x0, 0xf0381d70, 0xff31e000, 0x0), at 0xff2fe96
8
  [3] _sigon(0xf0381d70, 0xff325938, 0x6, 0xf0372e24, 0xf0381d70, 0x6), at 0xff2
fe108
  [4] _thrp_kill(0x0, 0x10, 0x6, 0xff31e000, 0x10, 0xff1bc488), at 0xff301148
  [5] raise(0x6, 0x0, 0x0, 0xffffffff, 0xff1bc3f4, 0x4), at 0xff14b450
  [6] abort(0xff1b801c, 0xf0372f78, 0x0, 0xfffffff8, 0x4, 0xf0372f99), at 0xff13
5a7c
  [7] os::abort(0x1, 0xfe3d1162, 0xf0373028, 0xfe3fa000, 0xfe40f900, 0x35e918),
at 0xfe3396fc
  [8] os::handle_unexpected_exception(0xa8368, 0xb, 0xef757d60, 0xf0373d60, 0xb,
 0x0), at 0xfe3377f4
  [9] JVM_handle_solaris_signal(0xef757d60, 0xf0373d60, 0xf0373aa8, 0x3400, 0x35
58, 0x0), at 0xfe33d668
  [10] __sighndlr(0xb, 0xf0373d60, 0xf0373aa8, 0xfe33b174, 0xf0381e14, 0xf0381e0
4), at 0xff30b7dc
  [11] sigacthandler(0xb, 0xf0381d70, 0x0, 0x0, 0x0, 0xff31e000), at 0xff3084c0
  ---- called from signal handler with signal 11 (SIGSEGV) ------
  [12] profile_node_iterator(0xf0373ea4, 0x0, 0x0, 0xf0373ea0, 0x4cbc10, 0x0), a
t 0xef757d60
  [13] profile_get_value(0x0, 0xf0373f10, 0xf0373f0c, 0x7efefeff, 0x81010100, 0x
ff00), at 0xef759670
  [14] profile_get_integer(0x4ca9b8, 0xef75e5e4, 0xef75e5f0, 0x0, 0x7, 0xf0373f8
4), at 0xef7597b8
  [15] init_common(0xf037406c, 0x0, 0x4ca9d8, 0x970ea400, 0x970ea724, 0xff1a4100
), at 0xef73e028
=>[16] LDAP_module::_get_TGT(this = 0xf0374350), line 983 in "LDAP_module.cpp"
  [17] LDAP_module::connect(this = 0xf0374350), line 1545 in "LDAP_module.cpp"
  [18] DoTestLDAP(pHost = 0xe5f38 "U05.US.TRENDNET.ORG", port = 389, pUser =
0x37f930 " iwss_testuser at US.TRENDNET.ORG", pPassword = 0x1788b0 "Pa123", pB
DN = 0x37f520 "DC=US,DC=TRENDNET,DC=ORG", simpleauth = 0, err = 0xf037fad0 "", s
izeErr = 2048), line 837 in "IWSSJNI.cpp"
  [19] Java_com_trend_iwss_gui_IWSSJNI_TestLDAP2(env = 0xa83fc, cl = 0xf0380350,
 host = 0xf03803f4, port = 389, user = 0xf03803ec, passwd = 0xf03803e8, bdn = 0x
f03803e4, simpleauth = 0, defaultRealm = 0xf03803dc, defaultDomain = 0xf03803d8,
 kdc = 0xf03803d4, kerberosPort = 88), line 779 in "IWSSJNI.cpp"


More information about the krbdev mailing list