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 release mode brave_unit_tests crash on Windows #201

Merged
merged 1 commit into from
Jun 28, 2018

Conversation

simonhong
Copy link
Member

@simonhong simonhong commented Jun 28, 2018

This is regression of #158.
During the initialization of unit test, channel info is accessed.
However, |g_module_details| isn't initialized in test.
Before the above PR, channel was always Channel::UNKNOWN.
So, channel info can be fetched without accessing |g_module_details|.
After the above PR, channel info is fetched via |g_module_details| in
release mode. So crash is happened because |g_module_details| is
nullptr.
Fixed by initializing install details explicitly.

Close: brave/brave-browser#443

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.

Test Plan:

Run yarn test brave_unit_tests Release on Windows

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions

@simonhong simonhong self-assigned this Jun 28, 2018
@simonhong simonhong requested a review from darkdh June 28, 2018 12:11
This is regression of #158.
During the initialization of unit test, channel info is accessed.
However, |g_module_details| isn't initialized in test.
Before the above PR, channel was always Channel::UNKNOWN.
So, channel info can be fetched without accessing |g_module_details|.
After the above PR, channel info is fetched via |g_module_details| in
release mode. So crash is happened because |g_module_details| is
nullptr.
Fixed by initializing install details explicitly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants