Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
Impala 2.8.0
-
ghx-label-7
Description
Look at this code from hive-udf-call.cc HiveUdfCall::GetStringVal():
StringVal HiveUdfCall::GetStringVal(ExprContext* ctx, const TupleRow* row) { DCHECK_EQ(type_.type, TYPE_STRING); StringVal result = *reinterpret_cast<StringVal*>(Evaluate(ctx, row)); // Copy the string into a local allocation with the usual lifetime for expr results. // Needed because the UDF output buffer is owned by the Java UDF executor and may be // freed or reused by the next call into the Java UDF executor. FunctionContext* fn_ctx = ctx->fn_context(fn_context_index_); uint8_t* local_alloc = fn_ctx->impl()->AllocateLocal(result.len); memcpy(local_alloc, result.ptr, result.len); <--- crash when local_alloc is nullptr result.ptr = local_alloc; return result; }
Attachments
Issue Links
- breaks
-
IMPALA-5580 Java UDF: return null STRING incorrectly converted to empty string
- Resolved
- is broken by
-
IMPALA-4266 Java udf expression returning string in group by can give incorrect results.
- Resolved