Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-105124

qtwebengine crashes when `/usr/share/X11/xkb` is empty

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.5
    • 6.3.1
    • WebEngine
    • None
    • Linux/X11
    • 1da0407a3 (dev), eaeb152b2 (6.5)

    Description

      Hi,

      Building qtwebengine as a module on my system and using it as part of building an application (Jami), I can then observe the following at run time:

      Using Qt runtime version: 6.3.1
      "notify server name: dunst, vendor: knopwob, version: 1.8.1 (2022-03-02), spec: 1.2"
      qt.webenginecontext: 
      
      GL Type: desktop
      Surface Type: OpenGL
      Surface Profile: CompatibilityProfile
      Surface Version: 3.3
      QSG RHI Backend: OpenGL
      Using Supported QSG Backend: yes
      Using Software Dynamic GL: no
      Using Multithreaded OpenGL: no
      
      Init Parameters:
        *  application-name Jami 
        *  browser-subprocess-path /gnu/store/kbq6fcg7sibmbllclhwq012jcqvggxcb-qtwebengine-6.3.1/lib/qt6/libexec/QtWebEngineProcess 
        *  create-default-gl-context  
        *  disable-features ConsolidatedMovementXY,InstalledApp,BackgroundFetch,WebOTP,WebPayments,WebUSB,PictureInPicture 
        *  disable-setuid-sandbox  
        *  disable-speech-api  
        *  disable-web-security  
        *  enable-features NetworkServiceInProcess,TracingServiceInProcess 
        *  enable-threaded-compositing  
        *  in-process-gpu  
        *  single-process  
        *  use-gl desktop 
      
      xkbcommon: ERROR: Couldn't find file "rules/evdev" in include paths
      xkbcommon: ERROR: There are no include paths to search
      xkbcommon: ERROR: 1 include paths could not be added:
      xkbcommon: ERROR:       /usr/share/X11/xkb
      xkbcommon: ERROR: Couldn't look up rules 'evdev', model 'pc101', layout 'us', variant 'dvorak', options ''
      [32380:32398:0721/085929.529041:FATAL:xkb_keyboard_layout_engine.cc(641)] Keymap file failed to load: us-dvorak
      Trace/breakpoint trap
      

      The error seems to be reported by this code, in src/3rdparty/chromium/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc

      
      #if BUILDFLAG(IS_CHROMEOS_ASH) || defined(TOOLKIT_QT)
      void LoadKeymap(const std::string& layout_name,
                      scoped_refptr<base::SingleThreadTaskRunner> reply_runner,
                      LoadKeymapCallback reply_callback) {
        std::string layout_id;
        std::string layout_variant;
        XkbKeyboardLayoutEngine::ParseLayoutName(layout_name, &layout_id,
                                                 &layout_variant);
        xkb_rule_names names = {.rules = NULL,
                                .model = "pc101",
                                .layout = layout_id.c_str(),
                                .variant = layout_variant.c_str(),
                                .options = ""};
        std::unique_ptr<xkb_context, XkbContextDeleter> context;
        context.reset(xkb_context_new(XKB_CONTEXT_NO_DEFAULT_INCLUDES));
        xkb_context_include_path_append(context.get(), "/usr/share/X11/xkb");
        std::unique_ptr<xkb_keymap, XkbKeymapDeleter> keymap;
        keymap.reset(xkb_keymap_new_from_names(context.get(), &names,
                                               XKB_KEYMAP_COMPILE_NO_FLAGS));
        if (keymap) {
          std::unique_ptr<char, base::FreeDeleter> keymap_str(
              xkb_keymap_get_as_string(keymap.get(), XKB_KEYMAP_FORMAT_TEXT_V1));
          reply_runner->PostTask(
              FROM_HERE, base::BindOnce(std::move(reply_callback), layout_name,
                                        std::move(keymap_str)));
        } else {
          LOG(FATAL) << "Keymap file failed to load: " << layout_name;
        }
      }
      #endif
      

      On my system (Guix System), `/usr/share/X11/xkb` is empty.

      This shouldn't be fatal, I believe; and ideally, it should be possible to configure where to look for X11 keyboard layouts too, perhaps via an environment variable.

      Thanks!

      Attachments

        For Gerrit Dashboard: QTBUG-105124
        # Subject Branch Project Status CR V

        Activity

          People

            mnegyokru Martin Negyokru
            apteryx Maxim Cournoyer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes