java - JNI application hanging -
please how approach debugging jni application.
used jps pid of process that's running jvm:
$ jps 8248 <- pid of process span c++ application run jni stuff ... 8335 jps
now can attach gdb stack.
$ gdb -p 8248 gnu gdb (gdb) red hat enterprise linux 7.6.1-94.el7 .... /cut/ (gdb) (gdb) bt #0 0x00007fddd9f141bd in __lll_lock_wait () /lib64/libpthread.so.0 #1 0x00007fddd9f0fd02 in _l_lock_791 () /lib64/libpthread.so.0 #2 0x00007fddd9f0fc08 in pthread_mutex_lock () /lib64/libpthread.so.0 #3 0x00007fddda9f3e26 in mutexlock () /opt/cloudera/parcels/cdh/lib64/libhdfs.so.0.0.0 #4 0x00007fddda9ed6f1 in settlsexceptionstrings () /opt/cloudera/parcels/cdh/lib64/libhdfs.so.0.0.0 #5 0x00007fddda9ec38c in printexceptionandfreev () /opt/cloudera/parcels/cdh/lib64/libhdfs.so.0.0.0 #6 0x00007fddda9ec52d in printexceptionandfree () /opt/cloudera/parcels/cdh/lib64/libhdfs.so.0.0.0 #7 0x00007fddda9ed46b in getjnienv () /opt/cloudera/parcels/cdh/lib64/libhdfs.so.0.0.0 #8 0x00007fddda9eee94 in hdfsbuilderconnect () /opt/cloudera/parcels/cdh/lib64/libhdfs.so.0.0.0 #9 0x0000000000400950 in main ()
notice it's hanging in sort of global mutex lock
i think gdb backtrace stack should useful identify root cause of issue.
this should generic jni debugging question? if if you're interested here's c code spans jvm jni interaction - https://gist.github.com/tagar/7c42f82f5538004bda2f4ea0b0e0adc5
java version "1.8.0_141" gcc version 4.8.5 20150623 (red hat 4.8.5-11) (gcc)
runtime environment:
export ld_library_path=$cdh/lib64:$java_home/jre/lib/$os_arch/server export classpath=`hadoop classpath` export _java_options=-xss1280m
thanks leads.
also, based on hanging stack trying fail
#6 0x00007fddda9ec52d in printexceptionandfree () /opt/cloudera/parcels/cdh/lib64/libhdfs.so.0.0.0 #7 0x00007fddda9ed46b in getjnienv () /opt/cloudera/parcels/cdh/lib64/libhdfs.so.0.0.0
but hangs on attempt printexceptionandfreev () -> settlsexceptionstrings () -> mutexlock () lock..
root cause found https://issues.apache.org/jira/browse/hdfs-11851
thanks.
Comments
Post a Comment