Codebase list mozc / 32615e9
Fix application freeze due to NPE on Windows Currently trying to use debug build of Mozc in a sandboxed process results in an infinite loop as follows: 1. The system calls TipTextServiceImpl::ActivateEx(). 2. It internally calls Logging::InitLogStream(FileUtil::JoinPath( SystemUtil::GetLoggingDirectory(), kLogFileName)). 3. SystemUtil::GetLoggingDirectory() internally calls SystemUtil::GetUserProfileDirectory(). 4. It internally calls Singleton<UserProfileDirectoryImpl>::get(). 5. UserProfileDirectoryImpl::UserProfileDirectoryImpl() can call LOG(ERROR). 6. LogStreamImpl::Write() can cause NPE when called before LogStreamImpl::Init() is called, which can result in broken CallOnceState of Singleton<UserProfileDirectoryImpl>. 7. Singleton<UserProfileDirectoryImpl>::get() called from other threads never returns. As a quick workaround, this CL makes sure that at least LogStreamImpl::Write() never causes NPE, even if it is called before LogStreamImpl::Init(). BUG= TEST= REF_BUG=32360767 REF_CL=136988186 REF_TIME=2016-10-23T21:33:47-07:00 REF_TIME_RAW=1477283627 -0700 Yohei Yukawa 7 years ago
2 changed file(s) with 9 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
243243 __android_log_write(severity, kProductPrefix,
244244 const_cast<char*>(log.c_str()));
245245 #else // OS_ANDROID
246 *real_log_stream_ << log;
246 // Since our logging mechanism is essentially singleton, it is indeed
247 // possible that this method is called before |Logging::InitLogStream()|.
248 // b/32360767 is an example, where |SystemUtil::GetLoggingDirectory()|
249 // called as a preparation for |Logging::InitLogStream()| internally
250 // triggered |LOG(ERROR)|.
251 if (real_log_stream_) {
252 *real_log_stream_ << log;
253 }
247254 #endif // OS_ANDROID
248255 }
249256 }
2929
3030 MAJOR=2
3131 MINOR=19
32 BUILD=2649
32 BUILD=2650
3333 REVISION=102
3434 # This version represents the version of Mozc IME engine (converter, predictor,
3535 # etc.). This version info is included both in the Mozc server and in the Mozc