Bug 292142
| Summary: | REGRESSION (iOS 18.4.x): Accessing BLOBs stored in IndexedDB leads to Networking process getting terminated | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | philipp.pirrung+apple |
| Component: | Website Storage | Assignee: | Sihui Liu <sihui_liu> |
| Status: | RESOLVED FIXED | ||
| Severity: | Critical | CC: | ap, sihui_liu, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | iPhone / iPad | ||
| OS: | iOS 18 | ||
philipp.pirrung+apple
#### Setting
We're running a web application that enables the user to upload certain objects containing BLOB properties.
To allow for offline usage of the application, we're using stores in the indexeddb, in which we temporarily save the data to be uploaded.
The files are created using a <input type="file" ... /> element.
The object's are supposed to be read from the database using `getAll(...)` on an index on the respective store.
#### Problem
When attempting to load a BLOB from the database (using the mentioned index), which was previously created in another tab, Safari crashes silently.
The only error message shown by Safari is that an error has occurred repeatedly.
The only way to repair this state is to remove the faulty object from the db store, resulting in lost data.
#### Workaround
We've managed to avoid the issue by not using an index to retrieve the data, but rather retrieving all data through the stores `getAll()` and filtering the result manually.
Obviously, this is not an acceptable long-term solution, as accessing data in the indexeddb should be possible using the built-in functions.
#### Tested devices
- iPad with iPadOS 18.3.1 --> Works fine without the described error
- iPad after update to iPadOS 18.4.1 --> Crashes with the described behavior
- iPhone with iOS 18.3.1 --> Works fine without the described error
- iPhone with iOS 16.x --> Works fine without the described error
- iPhone after update to iOS 18.4.1 --> Crashes with the described behavior
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
Thank you for the report! Should it be possible to provide a test case, either as an attachment or a link?
philipp.pirrung+apple
Hi Alexey,
thanks for the quick response.
I've been able to reproduce the problem with the following sample:
https://playcode.io/2361531
1. Open the page.
2. Select any arbitrary file in the input. It will be saved to the indexeddb.
3. Open the page in a second tab.
4. Click on the "Index" button. It will attempt to read the object containing the BLOB from the indexeddb.
Note:
I haven't been able to validate that our workaround with store.getAll() works using the above sample.
Radar WebKit Bug Importer
<rdar://problem/150284384>
Alexey Proskuryakov
Thank you, I can reproduce as described.
UI process terminates the networking process for sending an invalid IPC message:
NetworkConnectionToWebProcess.cpp 1108: Invalid message dispatched void WebKit::NetworkConnectionToWebProcess::registerInternalBlobURLOptionallyFileBacked(URL &&, URL &&, const String &, String &&)
Sihui Liu
Pull request: https://github.com/WebKit/WebKit/pull/47700
EWS
Committed 297122@main (74123c260a43): <https://commits.webkit.org/297122@main>
Reviewed commits have been landed. Closing PR #47700 and removing active labels.