Closed Bug 478948 Opened 15 years ago Closed 15 years ago

SQL statements not finalized warnings during shutdown

Categories

(Toolkit :: Places, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: bzbarsky, Assigned: sdwilsh)

References

Details

(Keywords: fixed1.9.1)

Attachments

(1 file)

************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIIdleService.removeIdleObserver]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: file:///Users/bzbarsky/mozilla/css-frameconst/obj-firefox/dist/MinefieldDebug.app/Contents/MacOS/components/nsBrowserGlue.js :: anonymous :: line 202"  data: no]
************************************************************
WARNING: SQL statement 'DELETE FROM moz_historyvisits_temp WHERE visit_type <> 4' was not finalized: file /Users/bzbarsky/mozilla/css-frameconst/mozilla/storage/src/mozStorageConnection.cpp, line 254
WARNING: SQL statement 'DELETE FROM moz_places_temp WHERE id IN (SELECT id FROM moz_places_temp h WHERE h.hidden <> 1 OR NOT EXISTS ( SELECT id FROM moz_historyvisits_temp WHERE place_id = h.id AND visit_type = 4 LIMIT 1) )' was not finalized: file /Users/bzbarsky/mozilla/css-frameconst/mozilla/storage/src/mozStorageConnection.cpp, line 254
WARNING: sqlite3_close failed. There are probably outstanding statements that are listed above!: file /Users/bzbarsky/mozilla/css-frameconst/mozilla/storage/src/mozStorageConnection.cpp, line 267
************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "Component returned failure code: 0x80630001 [mozIStorageConnection.close]"  nsresult: "0x80630001 (<unknown>)"  location: "JS frame :: file:///Users/bzbarsky/mozilla/css-frameconst/obj-firefox/dist/MinefieldDebug.app/Contents/MacOS/components/nsPlacesDBFlush.js :: anonymous :: line 135"  data: no]
************************************************************

Not sure whether that first JS error is relevant to this.
I don't think the first error is relevant, but this issue is odd.  Those statements are cached, and they should be finalized just before we try to close the db:
http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/src/nsPlacesDBFlush.js#134

Unless my js magic is totally wrong there...
Your JS magic is wrong.  forEach on an array enumerates the properties that:

1) Are set
2) Have names that are nonnegative integers < array.length.

In other words, actual array elements.

In your case, you're setting properties on this array keyed by table name, so there are none such.  When I'm shutting down this array thinks it has length 0.

You probably want an array to handle finalization (with push() used to put things in it) and a separate (non-array) object mapping names to statements for lookup.

Looks like a regression from bug 468705.
Blocks: 468705
Bah, yeah.  I really want an object I guess for cacheing, and use the array with push to store for finalization.
Assignee: nobody → sdwilsh
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.9.2a1
Blocks: 479391
Attached patch v1.0Splinter Review
Don't need to use the array if I just make sure that what I'm iterating is a storage statement.
Attachment #363340 - Flags: review?(mak77)
Whiteboard: [needs review mak]
Attachment #363340 - Flags: review?(mak77) → review+
Whiteboard: [needs review mak]
http://hg.mozilla.org/mozilla-central/rev/8966535ccf1b
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
OS: Mac OS X → All
Hardware: x86 → All
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: