Tim Armstrong has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/11976 )
Change subject: IMPALA-7851: fix underflow in ReserveSpace() ...................................................................... IMPALA-7851: fix underflow in ReserveSpace() The (num_rows - start_idx) calculation was incorrect because num_rows is *not* inclusive of start_idx - it is the number of rows after start_idx to add to the output batch rather than one past the last row to add. (run_rows - start_idx) could then be negative, which results in an underflow when it is implicitly converted to uint32_t. The underflow could result in reserving huge amounts of memory in the vector, which resulted in various misbehaviour such as hangs. Testing: Looped the test under ASAN. Before the fix it hung reliably. After it succeeds quickly. Change-Id: Iaec944f2149a6b9b605a5a885357fd54754dc046 Reviewed-on: http://gerrit.cloudera.org:8080/11976 Reviewed-by: Thomas Marshall <[email protected]> Tested-by: Tim Armstrong <[email protected]> --- M be/src/service/hs2-util.cc 1 file changed, 15 insertions(+), 13 deletions(-) Approvals: Thomas Marshall: Looks good to me, approved Tim Armstrong: Verified -- To view, visit http://gerrit.cloudera.org:8080/11976 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iaec944f2149a6b9b605a5a885357fd54754dc046 Gerrit-Change-Number: 11976 Gerrit-PatchSet: 5 Gerrit-Owner: Tim Armstrong <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Joe McDonnell <[email protected]> Gerrit-Reviewer: Thomas Marshall <[email protected]> Gerrit-Reviewer: Tim Armstrong <[email protected]>
