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

chrome: DCHECK failure in SimpleMenuModel::AddSeparator with --filter-chrome-commands #3577

Closed
magreenblatt opened this issue Oct 5, 2023 · 0 comments
Labels
bug Bug report chrome Related to the Chrome runtime

Comments

@magreenblatt
Copy link
Collaborator

Describe the bug

  1. Run cefclient.exe --enable-chrome-runtime --filter-chrome-commands using a Debug build.
  2. Click the 3-dot menu button in the Chrome toolbar

Expected behavior
The application should not crash. Instead, it crashes with the below error and stack trace:

[5600:22356:1004/195900.974:FATAL:simple_menu_model.cc(168)] Check failed: NORMAL_SEPARATOR == separator_type (0 vs. 3)

 	base.dll!logging::CheckError::~CheckError() Line 267	C++
 	ui_base.dll!ui::SimpleMenuModel::AddSeparator(ui::MenuSeparatorType separator_type) Line 169	C++
 	libcef.dll!AppMenuModel::Build() Line 1634	C++
 	libcef.dll!AppMenuModel::Init() Line 865	C++
 	libcef.dll!AppMenuButton::RunMenu(std::__Cr::unique_ptr<AppMenuModel,std::__Cr::default_delete<AppMenuModel>> menu_model, Browser * browser, int run_flags) Line 65	C++
 	libcef.dll!BrowserAppMenuButton::ShowMenu(int run_types) Line 111	C++
 	libcef.dll!BrowserAppMenuButton::ButtonPressed(const ui::Event & event) Line 310	C++

Versions (please complete the following information):

  • OS: Windows 10
  • CEF Version: M117+

Additional context
Likely related to the changes in this Chromium commit.

Check last visible menu item instead of last one when adding separators

In this case we're adding a new LOWER_SEPARATOR (as separator_type). The previous logic would check the last item in the menu, which is TYPE_SUBMENU. The new logic excludes non-visible items, so it finds a TYPE_SEPARATOR (at index 3 out of 9). The DCHECK then fails because it thinks it's adding a LOWER_SEPARATOR after a NORMAL_SEPARATOR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report chrome Related to the Chrome runtime
Projects
None yet
Development

No branches or pull requests

1 participant