Tim Armstrong has uploaded a new patch set (#2). Change subject: IMPALA-5815: right outer join returns invalid memory ......................................................................
IMPALA-5815: right outer join returns invalid memory The bug is that OutputAllBuild() called BufferedTupleStream::GetNext() while 'out_batch' still referenced data from the current page of the stream. When iterating over an unpinned stream, GetNext() sets the 'needs_deep_copy' flag when it hits the end of a page, so that the caller has an opportunity to flush or deep copy the data. On the next call to GetNext(), that page may be deleted or unpinned. The fix is to check whether the batch is at capacity before calling BTS::GetNext(). This issue was masked by not using the 'delete_on_read' mode of the stream, which would have freed the stream's buffers earlier and increased the odds of ASAN detecting the problem. Testing: Running TestTPCHJoinQueries.test_outer_joins() reliably reproduced this for me locally under ASAN. After the fix the problem does not reoccur. Change-Id: Ia14148499ddaec41c2e70fef5d53e5d06ea0538d --- M be/src/exec/partitioned-hash-join-node.cc 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/72/7772/2 -- To view, visit http://gerrit.cloudera.org:8080/7772 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia14148499ddaec41c2e70fef5d53e5d06ea0538d Gerrit-PatchSet: 2 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Tim Armstrong <[email protected]>
