WARNING: SQL statement 'SELECT * FROM moz_downloads ORDER BY id DESC' was not finalized

RESOLVED FIXED in Firefox 15

Status

()

Firefox
Downloads Panel
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Jesse Ruderman, Assigned: Paolo)

Tracking

({assertion, regression})

Trunk
Firefox 15
x86_64
Linux
assertion, regression
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
I've been hitting this semi-randomly when fuzzing:

WARNING: SQL statement 'SELECT * FROM moz_downloads ORDER BY id DESC' was not finalized: file /builds/slave/m-cen-lnx64-dbg/build/storage/src/mozStorageConnection.cpp, line 851

###!!! ASSERTION: sqlite3_close failed. There are probably outstanding statements that are listed above!: 'srv == SQLITE_OK', file /builds/slave/m-cen-lnx64-dbg/build/storage/src/mozStorageConnection.cpp, line 858

mozilla::storage::::AsyncCloseConnection::Run [storage/src/mozStorageConnection.cpp:391]
nsThread::ProcessNextEvent [xpcom/threads/nsThread.cpp:656]
NS_ProcessNextEvent_P [obj-firefox/xpcom/build/nsThreadUtils.cpp:245]
nsThread::Shutdown [xpcom/threads/nsThread.cpp:497]
nsUrlClassifierDBService::Shutdown [toolkit/components/url-classifier/nsUrlClassifierDBService.cpp:1539]
nsUrlClassifierDBService::Observe [toolkit/components/url-classifier/nsUrlClassifierDBService.cpp:1498]
nsObserverList::NotifyObservers [nsVoidArray.h:69]
nsObserverService::NotifyObservers [xpcom/ds/nsObserverService.cpp:185]
nsXREDirProvider::DoShutdown [toolkit/xre/nsXREDirProvider.cpp:854]
ScopedXPCOMStartup::~ScopedXPCOMStartup [toolkit/xre/nsAppRunner.cpp:1127]
XREMain::XRE_main [mozalloc.h:253]
XRE_main [toolkit/xre/nsAppRunner.cpp:3920]
main [browser/app/nsBrowserApp.cpp:190]
libc.so.6 + 0x2130d
firefox-bin + 0x1b99
thanks.  Paolo could you please prioritize this fix?
Assignee: nobody → paolo.mozmail
Component: General → Downloads Panel
QA Contact: general → downloads.panel
(Assignee)

Comment 2

5 years ago
Created attachment 617553 [details] [diff] [review]
The patch

Since we don't need to wait for the statement to finish its execution before
calling finalize on it, we can simplify the finalization code, and probably
solve this issue.
Attachment #617553 - Flags: review?(mak77)
Comment on attachment 617553 [details] [diff] [review]
The patch

Review of attachment 617553 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/components/downloads/src/DownloadsCommon.jsm
@@ +450,5 @@
>        }
>      } else {
>        if (this._loadState != this.kLoadAll) {
> +        let statement = Services.downloads.DBConnection.createAsyncStatement(
> +                          "SELECT * FROM moz_downloads ORDER BY id DESC");

please specify column names here, just to make it more efficient and future-proof
Attachment #617553 - Flags: review?(mak77) → review+
(Assignee)

Comment 4

5 years ago
Pushed with the requested change:

https://hg.mozilla.org/integration/mozilla-inbound/rev/3a0ef5b4a91b
Target Milestone: --- → Firefox 15
http://hg.mozilla.org/mozilla-central/rev/3a0ef5b4a91b
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.