impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henry Robinson (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-4532: Fix use-after-free in ProcessBuildInputAsync()
Date Mon, 28 Nov 2016 21:29:02 GMT
Henry Robinson has posted comments on this change.

Change subject: IMPALA-4532: Fix use-after-free in ProcessBuildInputAsync()
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/5246/1/be/src/exec/blocking-join-node.cc
File be/src/exec/blocking-join-node.cc:

PS1, Line 167: // Please keep this as the last line in this function to avoid use-after-free
problem.
             :   // Once 'status' is set, ProcessBuildInputAndProbe() will start running and
'states'
             :   // may have been freed after this line once the query completes. IMPALA-4532.
             :   // TODO: Make this less fragile.
             :   status->Set(s);
I just added ScopeExitTrigger which might be useful here? You'd do something like:

  ScopeExitTrigger trigger([&s, status]() { status->Set(s); });

which would ensure the invariant of status always being set as the last action of the method.


-- 
To view, visit http://gerrit.cloudera.org:8080/5246
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I6bfd094e2e9500f1b7843486f3f745cb921764d4
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Michael Ho <kwho@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dhecht@cloudera.com>
Gerrit-Reviewer: Henry Robinson <henry@cloudera.com>
Gerrit-Reviewer: Michael Ho <kwho@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstrong@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message