IMPALA-4808: old hash join can reference invalid memory The bug was that 'probe_rows_exist' could be true even if there was no current probe row. The node can get into this state if it takes the branch at line 390.
I tried to reproduce the crash but was unable to after a few attempts. Change-Id: Ic068bbc3e029264d1ce814d286e372391639fa68 Reviewed-on: http://gerrit.cloudera.org:8080/5850 Reviewed-by: Matthew Jacobs <[email protected]> Reviewed-by: Dan Hecht <[email protected]> Tested-by: Impala Public Jenkins Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/e3566ac0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/e3566ac0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/e3566ac0 Branch: refs/heads/master Commit: e3566ac048a122a8c6c88ac696a3cb1f9f31b2fc Parents: 8f59ce9 Author: Tim Armstrong <[email protected]> Authored: Thu Jan 26 12:04:39 2017 -0800 Committer: Impala Public Jenkins <[email protected]> Committed: Wed Feb 1 07:56:56 2017 +0000 ---------------------------------------------------------------------- be/src/exec/hash-join-node.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/e3566ac0/be/src/exec/hash-join-node.cc ---------------------------------------------------------------------- diff --git a/be/src/exec/hash-join-node.cc b/be/src/exec/hash-join-node.cc index 77807f6..ecde742 100644 --- a/be/src/exec/hash-join-node.cc +++ b/be/src/exec/hash-join-node.cc @@ -350,7 +350,7 @@ Status HashJoinNode::GetNext(RuntimeState* state, RowBatch* out_batch, bool* eos // If a probe row exists at this point, check whether we need to output the current // probe row before getting a new probe batch. (IMPALA-2440) - bool probe_row_exists = !probe_side_eos_ || probe_batch_->num_rows() > 0; + bool probe_row_exists = probe_batch_->num_rows() > 0; if (match_all_probe_ && !matched_probe_ && probe_row_exists) { int row_idx = out_batch->AddRow(); TupleRow* out_row = out_batch->GetRow(row_idx);
