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

[REG 5.14] user_prefs.json gets written before profile is ready

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • None
    • 5.14
    • WebEngine
    • None

    Description

      When doing this with Qt 5.14:

      #include <QApplication>
      #include <QWebEngineProfile>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          app.setOrganizationName("qtbug-test");
          QWebEngineProfile *profile = QWebEngineProfile::defaultProfile();
          profile->setPersistentStoragePath("/tmp/test");
          return 0;
      }
      

      It seems like Chromium tries to write to the (non-existent) path before the custom path was set, causing a warning:

      [723673:723687:0916/184513.927681:WARNING:important_file_writer.cc(97)] temp file failure: /home/florian/.local/share/qtbug-test/testproj/QtWebEngine/Default/user_prefs.json : could not create temporary file: No such file or directory (2)
      

      This is probably caused because ProfileQt::setupPrefService() is called twice - once in defaultProfile():

      #0  QtWebEngineCore::ProfileQt::setupPrefService (this=0x55555629a7d0) at ../profile_qt.cpp:303
      #1  0x00007fffe1939ac9 in QtWebEngineCore::ProfileQt::ProfileQt (this=0x55555629a7d0, profileAdapter=0x5555561e2470) at ../profile_qt.cpp:97
      #2  0x00007fffe1931fe6 in QtWebEngineCore::ProfileAdapter::ProfileAdapter (this=0x5555561e2470, storageName="Default") at ../profile_adapter.cpp:98
      #3  0x00007fffe19c0a75 in QtWebEngineCore::WebEngineContext::createDefaultProfileAdapter (this=0x555555dfa8f0) at ../web_engine_context.cpp:317
      #4  0x00007fffe1932993 in QtWebEngineCore::ProfileAdapter::createDefaultProfileAdapter () at ../profile_adapter.cpp:239
      #5  0x00007fffeeef3a24 in QWebEngineProfile::defaultProfile () at api/qwebengineprofile.cpp:694
      

      and then again in setPersistentStoragePath():

      #0  QtWebEngineCore::ProfileQt::setupPrefService (this=0x55555629a7d0) at ../profile_qt.cpp:303
      #1  0x00007fffe1932b13 in QtWebEngineCore::ProfileAdapter::setDataPath (this=0x5555561e2470, path="/tmp/qutebrowser-basedir-1gbzmbrp/data/webengine") at ../profile_adapter.cpp:270
      #2  0x00007fffeeef3346 in QWebEngineProfile::setPersistentStoragePath (this=0x555556371a20, path="/tmp/qutebrowser-basedir-1gbzmbrp/data/webengine") at api/qwebengineprofile.cpp:390
      

      which causes it to (try to) flush data to the location which doesn't exist.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qt_webengine_team Qt WebEngine Team
              the compiler Florian Bruhin
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes