Daniel Becker has uploaded this change for review. ( http://gerrit.cloudera.org:8080/17106
Change subject: IMPALA-10371: test_java_udfs crash impalad if result spooling is enabled ...................................................................... IMPALA-10371: test_java_udfs crash impalad if result spooling is enabled IMPALA-7658 introduced proper codegen for HiveUdfCall. Because of a bug in LLVM (see https://bugs.llvm.org/show_bug.cgi?id=21431), codegen code could not use JniUtil::GetJNIEnv directly as it involves thread-local variables, which LLVM JIT does not (yet) support. The original solution to get around this problem was to cache the JNIEnv pointer in the FunctionContext but it turned out that this leads to a crash if result spooling is enabled because multiple threads can end up using the same JNIEnv object. This commit fixes the problem by using a different solution: instead of caching the JNIEnv pointer we use a wrapper function (HiveUdfCall:GetJniEnvNotInlined) that prevents JniUtil::GetJNIEnv from being inlined in codegen code, thereby ensuring that the handling of the thread-local variable is compiled by GCC. Testing: Manually verified that TestUdfExecution::test_java_udfs passes with SPOOL_QUERY_RESULTS enabled. Change-Id: Ie3aadb8ccc0f1f9b7b87a5744c22a0555b325ee6 --- M be/src/exprs/hive-udf-call-ir.cc M be/src/exprs/hive-udf-call.cc M be/src/exprs/hive-udf-call.h 3 files changed, 87 insertions(+), 97 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/06/17106/2 -- To view, visit http://gerrit.cloudera.org:8080/17106 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie3aadb8ccc0f1f9b7b87a5744c22a0555b325ee6 Gerrit-Change-Number: 17106 Gerrit-PatchSet: 2 Gerrit-Owner: Daniel Becker <daniel.bec...@cloudera.com> Gerrit-Reviewer: Csaba Ringhofer <csringho...@cloudera.com> Gerrit-Reviewer: Daniel Becker <daniel.bec...@cloudera.com> Gerrit-Reviewer: Riza Suminto <riza.sumi...@cloudera.com>