[
https://issues.apache.org/jira/browse/IMPALA-8250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16778687#comment-16778687
]
Philip Zeyliger commented on IMPALA-8250:
-----------------------------------------
The first few of these were easy and https://gerrit.cloudera.org/#/c/12582/
captures them.
To look at the rest, I've been compiling OpenJDK8
(http://cr.openjdk.java.net/~ihse/demo-new-build-readme/common/doc/building.html#tldr-instructions-for-the-impatient
is surprisingly reasonably) with the following patch applied to the hotspot
subdirectory:
{code}
$hg diff
diff -r 76a9c9cf14f1 src/share/vm/prims/jniCheck.cpp
--- a/src/share/vm/prims/jniCheck.cpp Tue Jan 15 10:43:31 2019 +0000
+++ b/src/share/vm/prims/jniCheck.cpp Tue Feb 26 15:22:56 2019 -0800
@@ -143,11 +143,18 @@
static const char * fatal_instance_field_mismatch = "Field type (instance)
mismatch in JNI get/set field operations";
static const char * fatal_non_string = "JNI string operation received a
non-string";
+// PHIL
+static inline void dump_native_stack(JavaThread* thr) {
+ frame fr = os::current_frame();
+ char buf[6000];
+ print_native_stack(tty, fr, thr, buf, sizeof(buf));
+}
// When in VM state:
static void ReportJNIWarning(JavaThread* thr, const char *msg) {
tty->print_cr("WARNING in native method: %s", msg);
thr->print_stack();
+ dump_native_stack(thr);
}
// When in NATIVE state:
@@ -199,11 +206,15 @@
tty->print_cr("WARNING in native method: JNI call made without checking
exceptions when required to from %s",
thr->get_pending_jni_exception_check());
thr->print_stack();
+
+ dump_native_stack(thr);
)
thr->clear_pending_jni_exception_check(); // Just complain once
}
}
+
+
/**
* Add to the planned number of handles. I.e. plus current live & warning
threshold
*/
@@ -254,6 +265,7 @@
tty->print_cr("WARNING: JNI local refs: %zu, exceeds capacity: %zu",
live_handles, planned_capacity);
thr->print_stack();
+ dump_native_stack(thr);
)
// Complain just the once, reset to current + warn threshold
add_planned_handle_capacity(handles, 0);
{code}
This told me that the vast majority of issues are in Impala's HBase code.
> Impala crashes with -Xcheck:jni
> -------------------------------
>
> Key: IMPALA-8250
> URL: https://issues.apache.org/jira/browse/IMPALA-8250
> Project: IMPALA
> Issue Type: Task
> Reporter: Philip Zeyliger
> Priority: Major
>
> The JVM has a checker for JNI usage, and Impala (and libhdfs) have some
> violations. This ticket captures figuring that out. At least one of the
> issues can crash Impala.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]