Closed Bug 1560211 Opened 6 years ago Closed 5 years ago

consider reopening env after creating store to work around crash in mdb_cursor_put

Categories

(Core :: SQLite and Embedded Database Bindings, enhancement, P3)

enhancement

Tracking

()

RESOLVED INACTIVE

People

(Reporter: myk, Assigned: myk)

References

Details

Attachments

(1 file)

Bug 1538541 seems to happen when we first open an environment, create a store in it, and then write a bunch of data to that store. I wonder if it's possible to work around the problem by reopening the environment and re-getting a handle to the store before writing data to it.

Pushed by myk@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0a7f56cabe97 reopen env after creating store r=nanj,keeler

The changes reads XULStore's data.mdb file twice on startup, whereas currently the file is read once. That triggered the main thread file IO test. To address the issue, we can either whitelist the extra read—which is restricted to Nightly only until bug 1546838 is resolved—or wait to fix bug 1546838.

I'm going to opt for the latter for now, which makes this dependent on that bug. (It's also possible that we'll fix or work around bug 1538541 in the meantime, making this change unnecessary.)

Type: defect → enhancement
Depends on: 1546838
Flags: needinfo?(myk)

Could we land just the cert_storage changes in the meantime?

Flags: needinfo?(myk)

(In reply to Dana Keeler (she/her) (use needinfo) (:keeler for reviews) from comment #5)

Could we land just the cert_storage changes in the meantime?

We could, but as I've been testing the change further, I've also come to doubt its efficacy.

Yesterday evening I adapted a program that Nan wrote into this LMDB test program written in C that resembles the way cert_storage and xulstore create and populate a database. I've been testing variations of it against the latest version of mdb.c in the Mozilla fork of LMDB, which asserts if mdb_page_search fails when called from mdb_cursor_init.

And it seems like mdb_page_search always fails the first time data is written to a named database, even if the environment is closed and reopened after the named database is created. If we ignore the mdb_page_search failure instead of asserting, then the data still gets written; but my theory is that something about that failure is responsible for the occasional crash in mdb_cursor_put; and closing/reopening the environment doesn't seem to avoid it.

So… I'm still open to landing the change, but I'm no longer optimistic about its chances. I'll continue debugging this afternoon and see if I can identify a better workaround.

Flags: needinfo?(myk)

Ah, ok. Well, my vote would be for investigating further, then. Thanks for the update!

Priority: -- → P3

Closing in favor of bug 1594995.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → INACTIVE
Product: Toolkit → Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: