impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Impala Public Jenkins (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-5815: right outer join returns invalid memory
Date Wed, 23 Aug 2017 06:17:18 GMT
Impala Public Jenkins has submitted this change and it was merged.

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.

Running TestTPCHJoinQueries.test_outer_joins() reliably reproduced this
for me locally under ASAN. After the fix the problem does not reoccur.

Change-Id: Ia14148499ddaec41c2e70fef5d53e5d06ea0538d
Reviewed-by: Dan Hecht <>
Tested-by: Impala Public Jenkins
M be/src/exec/
1 file changed, 7 insertions(+), 1 deletion(-)

  Impala Public Jenkins: Verified
  Dan Hecht: Looks good to me, approved

To view, visit
To unsubscribe, visit

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia14148499ddaec41c2e70fef5d53e5d06ea0538d
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tim Armstrong <>
Gerrit-Reviewer: Dan Hecht <>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Thomas Tauber-Marshall <>

View raw message