SUMMARY: AddressSanitizer: SEGV /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray-inl.h:22:17 in ~nsTArray_base
Categories
(Core :: Storage: IndexedDB, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr60 | --- | unaffected |
| firefox65 | --- | wontfix |
| firefox66 | --- | wontfix |
| firefox67 | --- | wontfix |
| firefox68 | --- | fixed |
People
(Reporter: jkratzer, Assigned: violet.bugreport)
References
(Blocks 3 open bugs,
URL
)
Details
(Keywords: crash, regression, testcase)
Attachments
(3 files)
Updated•7 years ago
|
| Assignee | ||
Updated•7 years ago
|
| Assignee | ||
Comment 1•7 years ago
•
|
||
Interestingly, this bug is caused by two unrelated serialization/deserialization bugs.
The most serious one is the out-of-order backreference in StructuredClone code in JS engine, it's irrelevant to IndexedDB. See bug 1538622. This is the cause of the immediate crash of the whole browser when the original testcase is loaded in the release build.
However, there is still a minor bug in the IndexedDB part. The serialization and deserialization for KeyPath is inconsistent for ['']. That will cause an assertion failure when the testcase is loaded twice.
| Assignee | ||
Comment 2•7 years ago
|
||
| Assignee | ||
Comment 3•7 years ago
|
||
KeyPath [''] will be serialized as a single comma, when deserializing it, we should
return back an array with a single empty string, instead of an empty array. Otherwise
we will get inconsistent result with the KeyPath::Parse() method, causing assertions
failure.
Updated•7 years ago
|
| Assignee | ||
Comment 4•7 years ago
|
||
Hi Jan,
Could you review this patch I submitted 9 days ago? It's just a straightforward parsing error, since the major part has already been resolved by my patch to the JS engine.
Thanks!
Comment 6•7 years ago
|
||
Friday is the day.
Comment 7•7 years ago
|
||
Reviewing this now.
Comment 8•7 years ago
|
||
Ok, the new crash test won't assert if I run it separately.
It obviously depends on 1507229-1.html
Both crash tests share the same database, I'm not sure if this is a good idea.
1507229-1.html should delete the database before finishing and the new crash test should simulate the problem without depending on other tests.
Both crash tests should rather use unique database names (bug numbers?)
| Assignee | ||
Comment 9•7 years ago
|
||
Updated.
Also there is another patch of mine which you've already reviewed: https://phabricator.services.mozilla.com/D24009. I've already added the testcase you requested.
Comment 10•7 years ago
•
|
||
If I disable your fix in KeyPath.cpp, the assertion isn't hit at all.
The new crash test should "simulate the problem", so without the fix it should hit the assertion.
| Assignee | ||
Comment 11•7 years ago
|
||
It actually will hit at Test Verify, I discovered this because of TV failure.
I don't know how to make it hit at first load, do you know how to write this test since now the cause is clear?
Comment 12•7 years ago
|
||
Generally, you shouldn't depend on other tests in the directory.
Can you try to reopen the database in the same test ?
| Assignee | ||
Comment 13•7 years ago
|
||
The assertion failure isn't caused by dependency between two tests, it's caused by loading itself twice. It has nothing to do with other tests. TV can reproduce it.
I couldn't reproduce it by reopen the database in the same file twice.
Comment 14•7 years ago
|
||
That's not exactly true. I hit the assertion with your original patch.
Comment 15•7 years ago
|
||
If you want to provide a good test for this you can't rely on the verify mode. It should reproduce problem without that dependency.
| Assignee | ||
Comment 16•7 years ago
|
||
I don't have any idea how to do it because I'm far from an IndexedDB expert. Probably you know how to provide this testcase? I think the cause is really clear.
| Assignee | ||
Comment 18•7 years ago
|
||
So I should take this bug ?
If you think an obscure testcase is really important to an essentially typo-fixing bug, I have no objection if you want to take it. I believe it requires much more effort to find a obscure testcase than fixing the typo itself, and the testcase immediately becomes useless since it's almost impossible to get regressed to a typo in the future.
Comment 19•7 years ago
|
||
I plan to write a more detailed comment here, but for now ...
Does the test need to be a crash test ?
We just need to create a new database and then force parent process to reload database metadata. It means we need to close the database, reset origin directory (so parent closes all related os files) and reopen database again.
Comment 20•7 years ago
|
||
(In reply to violet.bugreport from comment #18)
So I should take this bug ?
If you think an obscure testcase is really important to an essentially typo-fixing bug, I have no objection if you want to take it. I believe it requires much more effort to find a obscure testcase than fixing the typo itself, and the testcase immediately becomes useless since it's almost impossible to get regressed to a typo in the future.
I'm sorry I didn't mean to discourage you from working on this. We appreciate any help, you are doing great job.
Anyway, it can be frustrating sometimes, but yes, writing a patch it's only a small part of the job. Reviews can take much more time than writing a patch and writing a test can be really hard. But that's how it works if you want to provide reliable solutions.
For example, if we land the crash test as it is, it can cause trouble in future and can be "frustrating" for someone else and that someone else can blame you or the reviewer for doing it incorrectly.
I'm delagating this and other reviews to Andrew Sutherland since I have to work on new LocalStorage implementation to stabilize it before next soft freeze.
| Assignee | ||
Comment 21•7 years ago
|
||
No problem, and thanks for your time.
Comment 22•7 years ago
|
||
Comment 23•7 years ago
|
||
| bugherder | ||
Updated•7 years ago
|
Updated•7 years ago
|
Updated•6 years ago
|
Description
•