In fact, I've seen getenv() on linux not working properly during MSan initialization, because it happens in .preinit_array and environ is simply not set at this point. Just FYI. If msan_init somehow caused getenv() call, it might be getting unexpected results. http://reviews.llvm.org/D6417