[Webkit-unassigned] [Bug 254813] New: REGRESSION(r259689): [WTF][GLib] openFile() fails to create files

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 31 07:52:06 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=254813

            Bug ID: 254813
           Summary: REGRESSION(r259689): [WTF][GLib] openFile() fails to
                    create files
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKitGTK
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: aboya at igalia.com
                CC: bugs-noreply at webkitgtk.org, zdobersek at igalia.com

How to reproduce:

$ run-webkit-httpd
$ TEST_RUNNER_TEST_PLUGIN_PATH=this_env_var_is_no_longer_used_and_shouldnt_be_required_but_that_is_work_for_another_patch \
  webkit-flatpak --gtk --debug -c \
  /app/webkit/WebKitBuild/Debug/bin/WebKitTestRunner --show-window http://localhost:8000/media-resources/media-source/media-source-seek-unbuffered.html
[...]
ERROR: writeOriginToFile: Failed to open origin file '/home/ntrrgc/.local/share/WebKitTestRunner/storage/4NoLZrGDXutAmUUf2IXlV4GkA_dI4PpgaXiB2xqjhow/4NoLZrGDXutAmUUf2IXlV4GkA_dI4PpgaXiB2xqjhow/origin'
/app/webkit/Source/WebKit/NetworkProcess/storage/StorageUtilities.h(73) : bool WebKit::writeOriginToFile(const WTF::String &, const WebCore::ClientOrigin &)

There is nothing wrong about the path above. This is the call that is being made:

auto originFileHandle = FileSystem::openFile(filePath, FileSystem::FileOpenMode::ReadWrite[, failIfFileExists = false]);

The problem is openFile() is using g_file_open_readwrite() in this code path, which fails if the file doesn't exist.

The following is a table of valid GIO functions for creating an stream with permissions requested by WebKit:

+-----------+-------------------------+----------------------------+
|   Mode    |    failIfFileExists     |            Call            |
+-----------+-------------------------+----------------------------+
| Read      | (any, will always fail) | g_file_read()              |
| Truncate  | true                    | g_file_create()            |
| Truncate  | false                   | g_file_replace()           |
| ReadWrite | true                    | g_file_create_readwrite()  |
| ReadWrite | false                   | g_file_replace_readwrite() |
+-----------+-------------------------+----------------------------+

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230331/e5fbbdee/attachment.htm>


More information about the webkit-unassigned mailing list