Following from the code review: https://gerrit.cloudera.org/#/c/8412/
After moving the string into InitAuth() and storing it in AuthManager (which is a global singleton), the ASAN error still kept showing up. I spent many hours trying to debug this problem and I have no understanding of why it happens. My inclination is that ASAN gets confused by how kudu::PosixEnv::GetExecutablePath() creates a string. It creates a unique_ptr<char> and then assign()'s it to a string.
For some reason this is seen as a heap-use-after free if it is called multiple times.
The only thing that works for now is to leave the code as is in this patch set.
I have 2 attempts to move/copy the string into GetExecutablePath() and their corresponding errors here:
If anyone else is able to make progress on this, that would be great.