Closed Bug 910422 Opened 11 years ago Closed 11 years ago

Crash when installing an app with appcache if the appcache is already downloaded in Firefox

Categories

(Core :: Networking: Cache, defect, P1)

x86_64
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 927878

People

(Reporter: marco, Unassigned)

References

Details

This is simply reproducible with this app: http://nell-balloons.github.cscott.net/
This page has an appcache defined and allows you to install an app.
If you install the app before the appcache downloading is finished, the installation is performed cleanly.
If you install the app after the appcache downloading is finished, Firefox crashes.
Confirmed against Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0 ID:20130901030218 CSet: b6c29e434519

bp-198f52f8-65d8-44be-aa19-1637b2130901

Frame 	Module 	        Signature 	Source
0 	xul.dll 	nsDOMOfflineResourceList::ApplicationCacheAvailable(nsIApplicationCache *) 	dom/src/offline/nsDOMOfflineResourceList.cpp
1 	xul.dll 	nsOfflineCacheUpdate::AssociateDocuments(nsIApplicationCache *) 	uriloader/prefetch/nsOfflineCacheUpdate.cpp
2 	xul.dll 	nsOfflineCacheUpdate::LoadCompleted(nsOfflineCacheUpdateItem *) 	uriloader/prefetch/nsOfflineCacheUpdate.cpp
3 	xul.dll 	nsOfflineCacheUpdateItem::Run() 	uriloader/prefetch/nsOfflineCacheUpdate.cpp
4 	xul.dll 	nsThread::ProcessNextEvent(bool,bool *) 	xpcom/threads/nsThread.cpp
5 	xul.dll 	NS_ProcessNextEvent(nsIThread *,bool) 	obj-firefox/xpcom/build/nsThreadUtils.cpp
6 	xul.dll 	mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate *) 	ipc/glue/MessagePump.cpp
7 	xul.dll 	MessageLoop::RunHandler() 	ipc/chromium/src/base/message_loop.cc
8 	xul.dll 	MessageLoop::Run() 	ipc/chromium/src/base/message_loop.cc
9 	xul.dll 	nsBaseAppShell::Run() 	widget/xpwidgets/nsBaseAppShell.cpp
10 	xul.dll 	nsAppShell::Run() 	widget/windows/nsAppShell.cpp
11 	xul.dll 	nsAppStartup::Run() 	toolkit/components/startup/nsAppStartup.cpp
12 	xul.dll 	XREMain::XRE_mainRun() 	toolkit/xre/nsAppRunner.cpp
13 	xul.dll 	XREMain::XRE_main(int,char * * const,nsXREAppData const *) 	toolkit/xre/nsAppRunner.cpp
14 	xul.dll 	XRE_main 	toolkit/xre/nsAppRunner.cpp
15 	firefox.exe 	do_main 	browser/app/nsBrowserApp.cpp
16 	firefox.exe 	NS_internal_main(int,char * *) 	browser/app/nsBrowserApp.cpp
17 	firefox.exe 	wmain 	toolkit/xre/nsWindowsWMain.cpp
18 	firefox.exe 	__tmainCRTStartup 	f:/dd/vctools/crt_bld/self_x86/crt/src/crtexe.c
19 	kernel32.dll 	BaseThreadInitThunk 	
20 	ntdll.dll 	ntdll.dll@0x39f72 	
21 	ntdll.dll 	ntdll.dll@0x39f45 

Btw, just loading the Site pegs hard time on CPU + I/O.
It's also reproducible with http://piranhas.sourceforge.net/.
I seem to be able to reproduce as follows:
1. Go to http://piranhas.sourceforge.net/
2. Click "Install me"
3. Once installation is complete, remove the installed application
4. Click "Install me" once again.
5. Crash. Note that this creates the application icon.
(In reply to David Rajchenbach Teller [:Yoric] from comment #4)
> I seem to be able to reproduce as follows:
> 1. Go to http://piranhas.sourceforge.net/
> 2. Click "Install me"
> 3. Once installation is complete, remove the installed application
> 4. Click "Install me" once again.
> 5. Crash. Note that this creates the application icon.

It is expected that the crash happens after the installation is finished (we start the download of the AppCache after the installation).
With the link in comment #0 (that gives you an indication of the appcache downloading progress in Firefox) I've managed to find out that the crash happens only when the AppCache download is already completed in Firefox.

I suspect in the Piranhas case, the first time you manage to install the application because its AppCache is still being downloaded. When you try to install the application again, the AppCache is downloaded and so Firefox crashes.

Could you verify that my findings are accurate?

You could:
1) Verify that on http://nell-balloons.github.cscott.net/ Firefox crashes only if you wait the appcache download to finish.
2) Install http://piranhas.sourceforge.net/, remove the app, remove the offline cache for the website from the Firefox preferences, try to install again.
Priority: -- → P1
Component: Web Apps → Networking: Cache
Product: Firefox → Core
See Also: → 927878
I noted in bug 927878, you don't need to install an app to cause this bug to manifest (<-- ha!). If you have two pages that use the same manifest, the same crash will happen visiting the second page. There's also a simple test-case of the crash here: http://teamgiraffe.co.uk/crash-firefox.html
hmm, spent some time trying to reproduce the two-page-one-manifest crash and couldn't get it to happen again, so maybe I was mistaken on that one. I'm not unconvinced that there isn't an even easier way to reproduce this though, and I hope that we back-port the fix when it gets done, this is quite awkward for app developers that want to distribute their own apps... (personally, I've built code that adds suffixes to the app version during my build process, but this also means that the installed and web version of the app don't share local storage, which is a shame)
(In reply to Honza Bambas (:mayhemer) from comment #9)
> Dupe of bug 927878 ?

Almost certainly, feel free to dupe to whichever one would be more useful if you're going to be working on it.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.