Closed Bug 412164 Opened 18 years ago Closed 17 years ago

Crash of Minefield while non-resumable download is running corrupts Download Manager

Categories

(Toolkit :: Downloads API, defect, P4)

defect

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: whimboo, Unassigned)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file)

This issue can be reproduced with my patch on bug 401846. After its checkin we will be able to pause (the old way) non-resumable downloads. If you are running such a download and Firefox crashes or quits due to any reason the Download Manager gets corrupted and doesn't respond to any event. You have to manually delete the downloads.sqlite to get rid of it. It would be nice to have this bug fixed before the patch on bug 401846 will be checked-in. I attached a broken downloads.sqlite file which only has to be copied into the profile folder. Afterwards to Download Manager is not usable. Just asking for blocking firefox3.
Flags: blocking-firefox3?
Summary: Crash of Minefield while not resumable download is running currupts Download Manager → Crash of Minefield while not resumable download is running corrupts Download Manager
(In reply to comment #0) > This issue can be reproduced with my patch on bug 401846. After its checkin we > will be able to pause (the old way) non-resumable downloads. It seems like we're removing the old "pause" UI in bug 410289. Should that be reconsidered given your patch for bug 401846?
Comment on attachment 296815 [details] downloads.sqlite which makes Download Manager unusable (In reply to comment #1) > It seems like we're removing the old "pause" UI in bug 410289. Should that be > reconsidered given your patch for bug 401846? I don't think so. My patch on bug 401846 fixes the accidentally created and broken EntityID which let the Download Manager think the server supports resuming. Even with the UI deleted this bug will happen when you download a file from such a server.
Attachment #296815 - Attachment description: Broken downloads.sqlite which makes Download Manager unusable → downloads.sqlite which makes Download Manager unusable
(In reply to comment #2) > Even with the UI deleted this bug will happen when you download a file from > such a server. How? The old behavior (calling suspend) won't work anymore. That sounds exactly like what you described in comment 0.
(In reply to comment #3) > How? The old behavior (calling suspend) won't work anymore. That sounds > exactly like what you described in comment 0. You don't need to pause (suspend) the download. As the summary describes you only have to start to download and kill Firefox afterwards while the download is *running*. And these steps will not change with the patch on bug 410289, correct?
Edward - I thought we had code that tried to rectify this situation...
Summary: Crash of Minefield while not resumable download is running corrupts Download Manager → Crash of Minefield while non-resumable download is running corrupts Download Manager
RestoreDatabaseState will set downloads that are notstarted, queued, downloading to autoresume which will cause RestoreActiveDownloads to start them. Perhaps there's an issue with resuming this particular download?
There are two uncaught exceptions when clicking resume or cancel: Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDownloadManager.resumeDownload]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://mozapps/content/downloads/downloads.js :: resumeDownload :: line 196" data: no] Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDownloadManager.cancelDownload]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://mozapps/content/downloads/downloads.js :: cancelDownload :: line 174" data: no]
Flags: blocking-firefox3? → blocking-firefox3+
Priority: -- → P3
Whiteboard: [needs assignee]
(In reply to comment #8) > So we have a bad download id? It just means we were passed a non-active download at that point.
This shouldn't be an issue anymore. This problem is caused by fake-pausing a download and crashing. This means we're in PAUSED with no entityID. If we crash when downloading a non-resumable, we'll try to restart it next time.
I did think about doing this... nsDownloadManager::RestoreActiveDownloads() { nsCOMPtr<mozIStorageStatement> stmt; nsresult rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING( "SELECT id " "FROM moz_downloads " - "WHERE (state = ?1 AND LENGTH(entityID) > 0) " - "OR autoResume != ?2"), getter_AddRefs(stmt)); + "WHERE state = ?1 OR autoResume != ?2"), getter_AddRefs(stmt)); But that'll just put a paused download in the UI with a disabled resume button ;)
Priority: P3 → P4
Meanwhile this issue was fixed by a patch in the last days or weeks. Using the attached downloads.sqlite file doesn't stop displaying the download manager. Tested with Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b5pre) Gecko/2008030904 Minefield/3.0b5pre ID:2008030904
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
Whiteboard: [needs assignee]
(In reply to comment #12) > Meanwhile this issue was fixed by a patch in the last days or weeks. Using the > attached downloads.sqlite file doesn't stop displaying the download manager. > Tested with Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b5pre) > Gecko/2008030904 Minefield/3.0b5pre ID:2008030904 Probably bug 412360; also, this now works for me also using Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9b5pre) Gecko/2008030904 Minefield/3.0b5pre with the downloads.sqlite file from comment 0. I'm able to download again even though CoD4MWDemoSetup.exe download entry isn't resumable due to bug 401846. Verified
Status: RESOLVED → VERIFIED
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: