Hello Impala Public Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/24033
to look at the new patch set (#2).
Change subject: Fix infinite loops in threads causing ASAN heap-use-after-free
......................................................................
Fix infinite loops in threads causing ASAN heap-use-after-free
Fixes IMPALA-14325 and other similar ASAN issues.
Threads running a function with an infinite loop
(e.g. LogMaintenanceThread) can cause ASAN heap-use-after-free
errors when exiting, if they try to read a resource already
freed by a static global variable.
This sometimes happens in flaky tests, but it happens rarely,
depending on how much sleep is remaining when the exit happens.
Also, it only happens with tests that exit in a non-graceful way,
e.g. by calling stdlib's exit.
To fix this issue, the following was changed:
1. The definition of the thread's static unique_ptr variables were
moved inside function scope, so that their initialization happens
after (and their destruction before) those of global static objects.
2. The threads are killed upon destruction, to make sure they are
stopped by the time any global static variable frees its data.
Testing:
- before the patch, an ASAN heap-use-after-free can be consistently
reproduced by removing the sleep in LogMaintenanceThread
- after the patch, the heap-use-after-free didn't reproduce
Change-Id: I97188e5ca2ace960c5db5cb44af44f42255902e8
---
M be/src/common/init.cc
M be/src/util/thread.cc
M be/src/util/thread.h
3 files changed, 63 insertions(+), 47 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/33/24033/2
--
To view, visit http://gerrit.cloudera.org:8080/24033
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I97188e5ca2ace960c5db5cb44af44f42255902e8
Gerrit-Change-Number: 24033
Gerrit-PatchSet: 2
Gerrit-Owner: Balazs Hevele <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>