SEGFAULT during creating cefApp client

Having problems with building or using the JCEF Java binding? Ask your questions here.

SEGFAULT during creating cefApp client

Postby ChevLucas » Tue Oct 11, 2022 2:36 am

Hi, I've tried to use many various jcef implementations and versions but the effect is the same. see attachment

Java code that initialize cefApp and create client:
Code: Select all
  private void initializeBrowserComponents(String startURL, CefLoadHandlerAdapter cefLoadHandlerAdapter) throws Exception {
    startCefAppIfNeeded();
    cefApp = createCefAppInstance();
    client = createCefClient(cefLoadHandlerAdapter);

    log.debug("Creating CefBrowser with start URL: {}", startURL);
    browser = client.createBrowser(startURL, false, false);
  }


  private void startCefAppIfNeeded() throws Exception {
    if (!cefAppLoaded) {
      cefAppLoaded = CefApp.startup(new String[]{});
      if (!cefAppLoaded) {
        throw new Exception("Browser failed to start");
      }
    }
  }

  private void startCefAppIfNeeded() throws Exception {
    if (!cefAppLoaded) {
      cefAppLoaded = CefApp.startup(new String[]{});
      if (!cefAppLoaded) {
        String browserFailedToStartMessage = "Browser failed to start";
        log.error(browserFailedToStartMessage);
        throw new Exception(browserFailedToStartMessage);
      }
    }
  }

  private CefApp createCefAppInstance() {
    String[] arguments = {"--disable-shared-workers", "--enable-crash-reporter", "--full-memory-crash-report"};

    if (CefApp.getState() == CefApp.CefAppState.NONE) {
      CefSettings settings = new CefSettings();
      settings.windowless_rendering_enabled = false;
      settings.log_file = logsPath;
      settings.log_severity = LogSeverity.LOGSEVERITY_VERBOSE;
      return CefApp.getInstance(arguments, settings);
    } else {
      return CefApp.getInstance(arguments);
    }
  }

  private CefClient createCefClient(CefLoadHandlerAdapter cefLoadHandlerAdapter) {
    try {
      CefClient cefClient = cefApp.createClient();
      cefClient.addLoadHandler(cefLoadHandlerAdapter);
      return cefClient;
    } catch (Exception e) {
      log.error("Problem with creating CefClient", e);
      throw e;
    }
  }



Normally error occurs very rarely and indeterministically, but if I attach remote debugger and step over CefAppHandlerAdapter::onBeforeCommandLineProcessing or some next methods called during creating of cefApp client JVM crashes almost always.
I set logs severity to verbose but there are no info there.
I've tried to use switches from https://peter.sh/experiments/chromium-c ... -switches/ especially --disable-dev-shm-usage, --no-sandbox, --disable-shared-workers but with no effect.

Does anyone know what's the problem?
Attachments
SEGFAULTs.png
SEGFAULTs.png (197.56 KiB) Viewed 8280 times
ChevLucas
Newbie
 
Posts: 1
Joined: Fri Jun 10, 2022 6:02 am

Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 149 guests