Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1077: Deprecate Mozc_tsf_ui.log #1078

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix #1077: Deprecate Mozc_tsf_ui.log
This commit affects only mozc_tip{32,64}.dll build with debug mode.
There must be no behavior change in release build.

Currently 'Mozc_tsf_ui.log' is created only when NDEBUG is defined.
With this commit we stop creating it even when NDEBUG is defined.
This addresses a crash issue in debug builds discussed in #1077.

See #856 about why absl::LocalTimeZone cannot be used in Windows right
now.

Note that this commit may also help us diagnose #1076, where
  Windows.Storage.OneCore.dll
looks to be intercepting certain Win32 file I/O API calls in
AppContainer processes then trigger RoInitialize as needed.
Creating 'Mozc_tsf_ui.log' only in debug builds can make our debugging
more complicated.
yukawa committed Oct 14, 2024
commit 49e1e0f9841332aa8831552a09467b2c73f44e99
3 changes: 0 additions & 3 deletions src/win32/tip/tip_text_service.cc
Original file line number Diff line number Diff line change
@@ -150,7 +150,6 @@ constexpr GUID kTipFunctionProvider = {
#else // GOOGLE_JAPANESE_INPUT_BUILD

constexpr char kHelpUrl[] = "https://github.com/google/mozc";
constexpr char kLogFileName[] = "Mozc_tsf_ui.log";
constexpr wchar_t kTaskWindowClassName[] =
L"Mozc Immersive Task Message Window";

@@ -511,8 +510,6 @@ class TipTextServiceImpl
StorePointerForCurrentThread(this);

HRESULT result = E_UNEXPECTED;
RegisterLogFileSink(
FileUtil::JoinPath(SystemUtil::GetLoggingDirectory(), kLogFileName));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about commenting out them with a note why the log is not stored into a file?

Copy link
Collaborator Author

@yukawa yukawa Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually wondering if we can permanently deprecate the log file, as it's not reliable (we cannot write file from AppContainer process) and I suspect no one is checking it as it is only available in debug build. At least I in general do not rely on log files for debugging.

Are you still using *.log from other processes? I'm actually leaning towards deprecating other logging files, but it's a separate discussion after fixing this obvious crash bug.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine to permanently deprecate the log file.
I'd like to prevent anyone from creating the log file again in the future, since it may cause the crash issue again.

So adding a note instead of the comment out is also fine with me.


EnsureKanaLockUnlocked();