Repository navigation
GH-55615: [C++][Gandiva] Validate the input expression of IN - #55609
dmitry-chirkov-dremio wants to merge 2 commits into
Conversation
The tests cover an invalid, a null and an untyped input expression of IN, for Projector::Make and Filter::Make. They fail or crash on main. The fix is in the next commit.
ExprValidator checked the value list of IN but not its input expression. An invalid input was accepted and a null input crashed Make. The validator now rejects a null input or type and visits the input. InExpressionNode::ToString() prints null for a null input, so the cache key does not crash before validation.
|
Thanks for opening a pull request! This pull request has been automatically converted to a draft because its title doesn't match Arrow's required format. If this is not a minor PR, could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format? or After updating the title, you can mark the pull request as ready for review. See also: |
|
CI results for the new tests. Tests-only commit, before the fix:
The crash is in Different from what I predicted: the crash stops the binary, so With the fix commit, A few known failures seen previously also appeared. They are not related to this PR. |
|
|
Rationale for this change
ExprValidatorchecks the value list ofINbut not its input expression. AnIFwith anint32condition is rejected alone and accepted underIN. A null input crashesProjector::Makewith SIGSEGV.What changes are included in this PR?
The PR has the tests first, then the fix in
expr_validator.ccandnode.h.ValidateInExpressionchecks that the input and its type are not null, and visits the input.InExpressionNode::ToString()printsnullfor a null input, so the cache key does not crash before validation.Are these changes tested?
Yes. The new tests cover invalid, null and untyped input for all
INvalue types, withProjector::MakeandFilter::Make, and a validIN. On main, one of them fails and two crash with SIGSEGV. All of them pass with the fix.Are there any user-facing changes?
Makenow returnsExpressionValidationErrorfor anINwith an invalid or null input. Before, it accepted it or crashed.This PR contains a "Critical Fix". It fixes a crash.
Projector::MakeandFilter::Makedie with SIGSEGV (exit code 139) when the input expression of anINnode is null. The null pointer is dereferenced inInExpressionNode::ToString(), which the cache key calls before the validator runs. BothMakecalls now returnExpressionValidationError.Was AI used for this PR?
AI tools helped investigate the bug and write the fix, tests, and description.
PR code and description written by:
Reviewed before submission by: