Closed Bug 1149815 Opened 11 years ago Closed 11 years ago

Lots of asserts/crashes running wpt IndexedDB tests in debug builds

Categories

(Core :: Storage: IndexedDB, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox40 --- affected
firefox41 --- fixed

People

(Reporter: jgraham, Assigned: bent.mozilla)

References

Details

Attachments

(6 files, 1 obsolete file)

3.98 KB, patch
asuth
: review+
Details | Diff | Splinter Review
10.51 KB, patch
janv
: review+
Details | Diff | Splinter Review
18.66 KB, patch
janv
: review+
Details | Diff | Splinter Review
3.16 KB, patch
janv
: review+
Details | Diff | Splinter Review
6.58 KB, patch
janv
: review+
Details | Diff | Splinter Review
34.95 KB, patch
janv
: review+
Details | Diff | Splinter Review
When running the web-platform-tests in debug builds I see a lot of asserts and crashes in IndexedDB tests e.g. [1]. Note that the orange jobs there are just the ones with *unexpected* (i.e. intermittent) crashes, the other jobs have similar, but more stable, crashes that have been marked as "expected". [1] https://treeherder.mozilla.org/#/jobs?repo=cedar&revision=3116e1bb2004&filter-searchStr=web-platform-tests-1%20debug
The assertion that's failing here seems to be "Assertion failure: !metadata->mDeleted"
Flags: needinfo?(bent.mozilla)
At a few different line numbers: PROCESS | 1824 | Assertion failure: !metadata->mDeleted, at /builds/slave/ced-l64-d-00000000000000000000/build/src/dom/indexedDB/ActorsParent.cpp:12238 PROCESS-CRASH | /IndexedDB/idbcursor_delete_index4.htm | application crashed [@ mozilla::dom::indexedDB::::TransactionBase::GetMetadataForObjectStoreId] PROCESS | 2747 | Assertion failure: !metadata->mDeleted, at /builds/slave/ced-l64-d-00000000000000000000/build/src/dom/indexedDB/ActorsParent.cpp:12238 PROCESS-CRASH | /IndexedDB/idbcursor_delete_objectstore4.htm | application crashed [@ mozilla::dom::indexedDB::::TransactionBase::GetMetadataForObjectStoreId] PROCESS | 2814 | Assertion failure: !metadata->mDeleted, at /builds/slave/ced-l64-d-00000000000000000000/build/src/dom/indexedDB/ActorsParent.cpp:12238 PROCESS-CRASH | /IndexedDB/idbcursor_update_index4.htm | application crashed [@ mozilla::dom::indexedDB::::TransactionBase::GetMetadataForObjectStoreId] PROCESS | 2886 | Assertion failure: !metadata->mDeleted, at /builds/slave/ced-l64-d-00000000000000000000/build/src/dom/indexedDB/ActorsParent.cpp:12238 PROCESS-CRASH | /IndexedDB/idbcursor_update_objectstore5.htm | application crashed [@ mozilla::dom::indexedDB::::TransactionBase::GetMetadataForObjectStoreId] PROCESS | 2955 | Assertion failure: mState == State_WaitingForOtherDatabasesToClose, at /builds/slave/ced-l64-d-00000000000000000000/build/src/dom/indexedDB/ActorsParent.cpp:17710 PROCESS-CRASH | /IndexedDB/idbfactory_open12.htm | application crashed [@ mozilla::dom::indexedDB::::OpenDatabaseOp::NoteDatabaseClosed] 1112716 Intermittent test_blocked_order.html | application crashed [@ mozilla::dom::workers::WorkerThread::Dispatch(nsIRunnable*, unsigned int)][@ mozilla::dom::indexedDB::::OpenDatabaseOp::NoteDatabaseClosed] PROCESS | 3066 | Assertion failure: !metadata->mDeleted, at /builds/slave/ced-l64-d-00000000000000000000/build/src/dom/indexedDB/ActorsParent.cpp:12261 PROCESS-CRASH | /IndexedDB/idbindex_get6.htm | application crashed [@ mozilla::dom::indexedDB::::TransactionBase::GetMetadataForIndexId] PROCESS | 3148 | Assertion failure: !metadata->mDeleted, at /builds/slave/ced-l64-d-00000000000000000000/build/src/dom/indexedDB/ActorsParent.cpp:12261 PROCESS-CRASH | /IndexedDB/idbindex_getKey6.htm | application crashed [@ mozilla::dom::indexedDB::::TransactionBase::GetMetadataForIndexId] PROCESS | 3215 | Assertion failure: !metadata->mDeleted, at /builds/slave/ced-l64-d-00000000000000000000/build/src/dom/indexedDB/ActorsParent.cpp:12261 PROCESS-CRASH | /IndexedDB/idbindex_openCursor.htm | application crashed [@ mozilla::dom::indexedDB::::TransactionBase::GetMetadataForIndexId] PROCESS | 3278 | Assertion failure: !metadata->mDeleted, at /builds/slave/ced-l64-d-00000000000000000000/build/src/dom/indexedDB/ActorsParent.cpp:12261 PROCESS-CRASH | /IndexedDB/idbindex_openKeyCursor2.htm | application crashed [@ mozilla::dom::indexedDB::::TransactionBase::GetMetadataForIndexId] PROCESS | 3341 | Assertion failure: !metadata->mDeleted, at /builds/slave/ced-l64-d-00000000000000000000/build/src/dom/indexedDB/ActorsParent.cpp:12238 PROCESS-CRASH | /IndexedDB/idbobjectstore_deleted.htm | application crashed [@ mozilla::dom::indexedDB::::TransactionBase::GetMetadataForObjectStoreId]
Blocks: 1076787
Any objection to removing those assertions?
Flags: needinfo?(amarchesini)
(In reply to :Ms2ger from comment #3) > Any objection to removing those assertions? Yes, they're there for a reason. I'll try to catch in rr.
Flags: needinfo?(amarchesini)
This doesn't look like a race at all, we're just not properly guarding against deleted objectstores/indexes in some cases.
Flags: needinfo?(bent.mozilla)
Storage is eating the result codes from custom functions and always returning a generic SQLITE_ERROR. This fix allows us to pass failure codes through properly.
Assignee: nobody → bent.mozilla
Status: NEW → ASSIGNED
Attachment #8623181 - Flags: review?(bugmail)
We're not doing a great job of preventing JS from using deleted IDBObjectStore and IDBIndex objects here, and apparently we don't have our own tests for that.
Attachment #8623188 - Flags: review?(Jan.Varga)
I added an optimization to avoid modifying index data if we knew that the objectstore didn't have indexes. The optimization will be defeated (and an assertion will fire) if we're in a versionchange transaction and we try to create an index but it fails. This patch fixes the optimization.
Attachment #8623191 - Flags: review?(Jan.Varga)
Comment on attachment 8623181 [details] [diff] [review] Part 1: Pass storage function failure codes through to callers, v1 Review of attachment 8623181 [details] [diff] [review]: ----------------------------------------------------------------- This looks good and correct. sqlite3_result_error is correctly called before sqlite3_result_error_code to avoid value clobbering and the string handling properly gets the whole nul-terminated string.
Attachment #8623181 - Flags: review?(bugmail) → review+
Attachment #8623188 - Flags: review?(Jan.Varga) → review+
Attachment #8623191 - Flags: review?(Jan.Varga) → review+
Early results are promising, but I'm seeing a few unexpected fails and at least one assert in debug: https://treeherder.mozilla.org/#/jobs?repo=cedar&revision=0325e7cdfb17&filter-searchStr=web-platform
The spec says that we should let the transaction commit but still fire an error event with AbortErr on the IDBOpenDBRequest object. This change causes a few xpcshell failures so those changes are included here.
Attachment #8623400 - Flags: review?(Jan.Varga)
Attachment #8623400 - Attachment description: Part 4: Properly handle IDBDatabase.close() called during a versionchange transaction → Part 4: Properly handle IDBDatabase.close() called during a versionchange transaction, v1
And we should run these tests now that they pass.
Attachment #8623410 - Flags: review?(Jan.Varga)
(In reply to Ben Turner [:bent] (use the needinfo flag!) from comment #14) A few mochitests need to be tightened up too it seems.
Additional test changes only, now try is happy.
Attachment #8623400 - Attachment is obsolete: true
Attachment #8623400 - Flags: review?(Jan.Varga)
Attachment #8624594 - Flags: review?(Jan.Varga)
Attachment #8623409 - Flags: review?(Jan.Varga) → review+
Attachment #8623410 - Flags: review?(Jan.Varga) → review+
Comment on attachment 8624594 [details] [diff] [review] Part 4: Properly handle IDBDatabase.close() called during a versionchange transaction, v1 Review of attachment 8624594 [details] [diff] [review]: ----------------------------------------------------------------- Looks good!
Attachment #8624594 - Flags: review?(Jan.Varga) → review+
Attachment #8623181 - Flags: approval-mozilla-aurora?
Attachment #8623188 - Flags: approval-mozilla-aurora?
Attachment #8623191 - Flags: approval-mozilla-aurora?
Attachment #8624594 - Flags: approval-mozilla-aurora?
Attachment #8623409 - Flags: approval-mozilla-aurora?
Comment on attachment 8623410 [details] [diff] [review] Part 6: Enable wpt tests that now pass. Approval Request Comment [Feature/regressing bug #]: This non-spec-compliant behavior is very old, probably since the first version if IndexedDB. [User impact if declined]: Broken behavior in several edge cases [Describe test coverage new/current, TreeHerder]: WPT tests [Risks and why]: Low risk, just changes behavior to be spec compliant in edge cases. [String/UUID change made/needed]: None
Attachment #8623410 - Flags: approval-mozilla-aurora?
Ben, I am not sure to understand why this cannot ride the trains. It is pretty big patches and I am not sure to see the gains for users.
Flags: needinfo?(bent.mozilla)
They can, I just don't think the patches are very risky and we could fix broken behavior sooner.
Flags: needinfo?(bent.mozilla)
OK. So, let's it ride the train. We have this issue for a while, no need to ask risk to the 40 release then.
Attachment #8623181 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora-
Attachment #8624594 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora-
Attachment #8623410 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora-
Attachment #8623409 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora-
Attachment #8623191 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora-
Attachment #8623188 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: