[
https://issues.apache.org/jira/browse/IMPALA-15379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18117866#comment-18117866
]
ASF subversion and git services commented on IMPALA-15379:
----------------------------------------------------------
Commit e55545f2d1ad901e30fb663ba566de4e173ba98e in impala's branch
refs/heads/master from Michael Smith
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=e55545f2d ]
IMPALA-15379: Fix UBSan VLA-bound-0 aborts
ExecNode::CodegenEvalConjuncts declared a C-style VLA
(llvm::Function* conjunct_fns[conjuncts.size()]) to hold codegen'd
conjunct functions. When a scan node has zero conjuncts (e.g. a
query with no WHERE clause), conjuncts.size() is 0, and a VLA with a
runtime bound of 0 is undefined behavior. UBSan's vla-bound check
flags this as fatal in future Clang versions, aborting impalad mid-query
(reproduced by
TestNestedCollectionsInSelectList::test_array_in_select_list).
Tuple::CodegenMaterializeExprs and
TupleRowComparatorConfig::CodegenLexicalCompare have similar cases when
inputs are empty.
Replace VLAs with a std::vector.
Change-Id: I9d476f5adc47d2a9e368a8960fa4e7c3817f43fd
Assisted-by: Claude Sonnet 5 (GitHub Copilot)
Reviewed-on: http://gerrit.cloudera.org:8080/24890
Reviewed-by: Jiyoung Yoo <[email protected]>
Reviewed-by: Joe McDonnell <[email protected]>
Reviewed-by: Michael Smith <[email protected]>
Tested-by: Michael Smith <[email protected]>
> Undefined VLA size 0 in CodegenEvalConjuncts and CodegenMaterializeExprs
> ------------------------------------------------------------------------
>
> Key: IMPALA-15379
> URL: https://issues.apache.org/jira/browse/IMPALA-15379
> Project: IMPALA
> Issue Type: Bug
> Components: Backend
> Reporter: Michael Smith
> Assignee: Michael Smith
> Priority: Major
>
> Creating a variable-length array with size 0 is undefined in C (and VLAs are
> only allowed in C++ via GCC/Clang extensions).
> ExecNode::CodegenEvalConjuncts and Tuple::CodegenMaterializeExprs both
> initialize VLAs that can have an input size of 0, which newer Clang versions
> identify in UBSAN builds.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]