Skip to content

cefsimple crashes on startup with debug builds of CEF on macOS #181

@tasuren

Description

@tasuren

Describe the bug
When using a debug build of CEF on macOS, the cefsimple example crashes on launch due to a DCHECK failure.

[39815:226336:0814/115923.756723:FATAL:chrome/common/chrome_paths_mac.mm:189] DCHECK failed: path.BaseName().value() == kChromeVersion (target vs. 139.0.7258.31)

I was wondering if this is a known issue. Alternatively, perhaps cef-rs does not yet officially support CEF debug builds. Could you please clarify if this is the expected behavior?

To Reproduce
Steps to reproduce the behavior:

  1. Clone repository.
  2. Download the CEF Standard Distribution from here that matches the CEF version used by cef-rs.
  3. Manually create a cef directory, mimicking the structure that export-cef-dir command would generate.
    a. Move cmake, include, libcef_dll, and CMakeLists.txt files and directories into the new cef directory.
    b. From the downloaded CEF distribution, move Chromium Embedded Framework.framework from its Debug subfolder into the cef directory.
    c. Create an archive.json file inside the cef directory with the content {"type": "standard"}, mimicking archive.json that export-cef-dir would generate.
  4. Set the CEF_PATH and DYLD_FALLBACK_LIBRARY_PATH environment variables to the absolute path of the cef directory you just created.
  5. Bundle the cefsimple example using the command: cargo run --bin bundle_cefsimple.
  6. Attempt to run the bundled application from your shell: ./target/debug/cefsimple.app/Contents/MacOS/cefsimple

Expected behavior
The cefsimple application should launch successfully and display its window without any crashes.

Additional context
I found that the initial startup crash can be worked around by setting LSUIElement to 0 at this line:

ls_ui_element: "1".to_string(),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions