Failing WPT IndexedDB/serialize-sharedarraybuffer-throws.https.html
Categories
(Core :: Storage: IndexedDB, defect)
Tracking
()
People
(Reporter: twisniewski, Assigned: twisniewski)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Updated•8 months ago
|
Assignee | ||
Comment 1•5 months ago
•
|
||
We do throw an error, but it's not the one the test expects:
assert_throws_dom: function "() => { rq = objStore.put({sab: sab}, "key"); }" threw object
"DataError: Data provided to an operation does not meet requirements."
that is not a DOMException DataCloneError: property "code" is equal to 0, expected 25
And we're getting that NS_ERROR_DOM_INDEXEDDB_DATA_ERR from here:
void IDBObjectStore::GetAddInfo(...) {
// Return DATA_ERR if a key was passed in and this objectStore uses inline keys.
if (!aKeyVal.isUndefined() && HasValidKeyPath()) {
aRv.Throw(NS_ERROR_DOM_INDEXEDDB_DATA_ERR);
return;
}
Which seems odd. This is the core of the test:
let open_rq = createdb(t);
open_rq.onupgradeneeded = function(e) {
let db = e.target.result;
let objStore = db.createObjectStore("test", { keyPath:"pKey" });
let sab = new SharedArrayBuffer(256);
let rq;
assert_throws_dom("DataCloneError", () => {
rq = objStore.put({sab: sab}, "key");
});
If I drop the "key" argument on the put
so it's just objStore.put({sab: sab})
, then we do get a data clone error, it's just still not the "right" one:
assert_throws_dom: function "() => { rq = objStore.put({sab: sab}); }" threw object
"TypeError: The SharedArrayBuffer object cannot be serialized. The Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy HTTP headers can be used to enable this."
that is not a DOMException DataCloneError: property "code" is equal to undefined, expected 25
It becomes the "right" one if I add a JS_ClearPendingException
here:
if (!aValueWrapper.Clone(aCx)) {
JS_ClearPendingException(aCx);
aRv.Throw(NS_ERROR_DOM_DATA_CLONE_ERR);
return;
}
But the real question is: what's going on with the "key" argument in the test. Jarl, any clues?
Comment 2•5 months ago
|
||
We should fail on step 13 https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal , which seems to be the one you get by not running first on the key path issues, apart from the unexpectely undefined code. If the object store should use a keypath, there should be an error when data does not provide a key for the path and also when an explicit key is given.
Assignee | ||
Comment 3•5 months ago
|
||
Right, but if I'm not mistaken the spec for add/put says we should do the key checks first (step 8), and then the cloning (step 10). So shouldn't our current behaviour be correct and the test should expect a DataError, not a DataCloneError?
Or should we not be failing on step 8? (which I think is the code here, where it's failing for us).
Comment 4•5 months ago
|
||
Yeah, it seems like the test needs to be fixed. In v8 they are checking the value and the key in the order they appear among the arguments. It seems that the test landed to probe the cross-origin isolation and there was no discussion on this question.
Assignee | ||
Comment 5•5 months ago
|
||
Updated•5 months ago
|
Comment 8•5 months ago
|
||
Backed out for causing failures on key-conversion-exceptions.htm
- backout: https://hg.mozilla.org/integration/autoland/rev/66b11776bfaa8d41d189cdc1f1cb2d75de9b1e50
- push: https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&selectedTaskRun=Wcgs2P_DQZefgEFXwuumiw.0&revision=a913463932b70a4b7504d40b66173c0b20e76894
- failure log: https://treeherder.mozilla.org/logviewer?job_id=455867590&repo=autoland&lineNumber=3475
[task 2024-04-25T16:44:00.825Z] 16:44:00 INFO - TEST-PASS | /IndexedDB/key-conversion-exceptions.htm | IDBKeyRange bound() static with throwing/invalid keys
[task 2024-04-25T16:44:00.825Z] 16:44:00 INFO - TEST-UNEXPECTED-FAIL | /IndexedDB/key-conversion-exceptions.htm | IDBObjectStore add() method with throwing/invalid keys - assert_throws_exactly: throwing getter should rethrow during clone function "() => {
[task 2024-04-25T16:44:00.825Z] 16:44:00 INFO - in_line[method](value);
[task 2024-04-25T16:44:00.825Z] 16:44:00 INFO - }" threw object "DataCloneError: The object could not be cloned." but we expected it to throw object "getter: throwing from getter"
[task 2024-04-25T16:44:00.825Z] 16:44:00 INFO - @http://web-platform.test:8000/IndexedDB/key-conversion-exceptions.htm:158:30
[task 2024-04-25T16:44:00.825Z] 16:44:00 INFO - indexeddb_test/</open.onupgradeneeded<@http://web-platform.test:8000/IndexedDB/resources/support.js:132:19
[task 2024-04-25T16:44:00.825Z] 16:44:00 INFO - Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:2622:25
[task 2024-04-25T16:44:00.825Z] 16:44:00 INFO - Test.prototype.step_func/<@http://web-platform.test:8000/resources/testharness.js:2669:35
[task 2024-04-25T16:44:00.827Z] 16:44:00 INFO -
[task 2024-04-25T16:44:00.827Z] 16:44:00 INFO - TEST-UNEXPECTED-FAIL | /IndexedDB/key-conversion-exceptions.htm | IDBObjectStore put() method with throwing/invalid keys - assert_throws_exactly: throwing getter should rethrow during clone function "() => {
[task 2024-04-25T16:44:00.827Z] 16:44:00 INFO - in_line[method](value);
[task 2024-04-25T16:44:00.827Z] 16:44:00 INFO - }" threw object "DataCloneError: The object could not be cloned." but we expected it to throw object "getter: throwing from getter"
[task 2024-04-25T16:44:00.827Z] 16:44:00 INFO - @http://web-platform.test:8000/IndexedDB/key-conversion-exceptions.htm:158:30
[task 2024-04-25T16:44:00.827Z] 16:44:00 INFO - indexeddb_test/</open.onupgradeneeded<@http://web-platform.test:8000/IndexedDB/resources/support.js:132:19
[task 2024-04-25T16:44:00.827Z] 16:44:00 INFO - Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:2622:25
[task 2024-04-25T16:44:00.827Z] 16:44:00 INFO - Test.prototype.step_func/<@http://web-platform.test:8000/resources/testharness.js:2669:35
[task 2024-04-25T16:44:00.834Z] 16:44:00 INFO - ...............
[task 2024-04-25T16:44:00.835Z] 16:44:00 INFO - TEST-OK | /IndexedDB/key-conversion-exceptions.htm | took 2357ms
Comment 10•5 months ago
|
||
Assignee | ||
Updated•5 months ago
|
Comment 11•5 months ago
|
||
Backed out for causing xpc crashes @ mozilla::dom::(anonymous namespace)::ensureCorrectDataCloneError
Backout link: https://hg.mozilla.org/integration/autoland/rev/f8a7a562b63a7046491d04971e58f2e39dedde7e
mozcrash Saved app info as /builds/worker/workspace/build/blobber_upload_dir/46394573-fbf9-4a1b-49d1-e62826879c7d.extra
[task 2024-04-25T21:47:03.096Z] 21:47:03 WARNING - PROCESS-CRASH | application crashed [@ mozilla::dom::(anonymous namespace)::ensureCorrectDataCloneError] | xpcshell.toml:dom/indexedDB/test/unit/test_wasm_put_get_values.js
[task 2024-04-25T21:47:03.096Z] 21:47:03 INFO - Process type: main
[task 2024-04-25T21:47:03.096Z] 21:47:03 INFO - Process pid: 32505
[task 2024-04-25T21:47:03.096Z] 21:47:03 INFO - Crash dump filename: /tmp/tmp555hp3ct/46394573-fbf9-4a1b-49d1-e62826879c7d.dmp
[task 2024-04-25T21:47:03.096Z] 21:47:03 INFO - Operating system: Android
[task 2024-04-25T21:47:03.096Z] 21:47:03 INFO - 0.0.0 Linux 3.10.0+ #260 SMP PREEMPT Fri May 19 12:48:14 PDT 2017 x86_64
[task 2024-04-25T21:47:03.096Z] 21:47:03 INFO - CPU: amd64
[task 2024-04-25T21:47:03.096Z] 21:47:03 INFO - family 6 model 6 stepping 3
[task 2024-04-25T21:47:03.096Z] 21:47:03 INFO - 4 CPUs
[task 2024-04-25T21:47:03.096Z] 21:47:03 INFO - Crash reason: SIGSEGV / SEGV_MAPERR
[task 2024-04-25T21:47:03.096Z] 21:47:03 INFO - Crash address: 0x000000000000001c **
[task 2024-04-25T21:47:03.096Z] 21:47:03 INFO - ** Null pointer detected with offset: 0x000000000000001c
[task 2024-04-25T21:47:03.097Z] 21:47:03 INFO - Crashing instruction: `mov eax, dword [rax + 0x1c]`
[task 2024-04-25T21:47:03.097Z] 21:47:03 INFO - Memory accessed by instruction:
[task 2024-04-25T21:47:03.097Z] 21:47:03 INFO - 0. Address: 0x000000000000001c
[task 2024-04-25T21:47:03.097Z] 21:47:03 INFO - Size: 4
[task 2024-04-25T21:47:03.097Z] 21:47:03 INFO - Process uptime: not available
[task 2024-04-25T21:47:03.097Z] 21:47:03 INFO - Thread 12 Gecko (crashed)
[task 2024-04-25T21:47:03.097Z] 21:47:03 INFO - 0 libxul.so!mozilla::dom::(anonymous namespace)::ensureCorrectDataCloneError(JSContext*) [IDBObjectStore.cpp:133181fbd1efe43a038d82c04f0d681a3320f389 : 288 + 0x0]
[task 2024-04-25T21:47:03.097Z] 21:47:03 INFO - rax = 0x0000000000000000 rdx = 0x00007f83777d9720
Assignee | ||
Comment 13•5 months ago
|
||
Comment 14•5 months ago
|
||
Comment 15•5 months ago
|
||
Backed out for causing multiple wpt failures with serialization in summary
- Backout link
- Push with failures
- Failure Log
- Failure line: TEST-UNEXPECTED-PASS | /html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-idb.any.worker.html | SharedArrayBuffer cloning via IndexedDB: basic case - expected FAIL
another wpt failure: https://treeherder.mozilla.org/logviewer?job_id=456090427&repo=autoland
Comment 17•5 months ago
|
||
Comment 18•5 months ago
|
||
bugherder |
Assignee | ||
Updated•5 months ago
|
Description
•