Last Comment Bug 704004 - Firefox in “work offline” mode crashes when starting a Websocket
: Firefox in “work offline” mode crashes when starting a Websocket
Status: VERIFIED FIXED
[qa!]
: verified-beta
Product: Core
Classification: Components
Component: Networking: WebSockets (show other bugs)
: 11 Branch
: x86 Mac OS X
: -- normal (vote)
: mozilla10
Assigned To: Patrick McManus [:mcmanus] PTO until Sep 6
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-20 11:20 PST by Ivan Enderlin
Modified: 2012-02-27 07:44 PST (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
unaffected
unaffected
verified
verified


Attachments
Bug.html (797 bytes, text/html)
2011-11-20 11:20 PST, Ivan Enderlin
no flags Details
patch 0 (992 bytes, patch)
2011-11-22 05:57 PST, Patrick McManus [:mcmanus] PTO until Sep 6
jduell.mcbugs: review+
christian: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description Ivan Enderlin 2011-11-20 11:20:20 PST
Created attachment 575759 [details]
Bug.html

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0a1) Gecko/20111117 Firefox/11.0a1
Build ID: 20111117030939

Steps to reproduce:

Turn off your connection (Ethernet, Wifi & co.). Turn Firefox to the “work offline” mode. Close Firefox. Open the attached file (which only starts a new Websocket) in a new Firefox instance (normally in the “work offline” mode).


Actual results:

Firefox crashes :-(.


Expected results:

Starting a new Websocket in the “work offline” mode should throw an exception or should call the Websocket.onclose event.
Comment 1 Patrick McManus [:mcmanus] PTO until Sep 6 2011-11-20 12:49:20 PST
this is wfm on linux, though it isn't hard to imagine how it could be os dependent.

do you happen to have a stack trace?
Comment 2 Josh Matthews [:jdm] (away until 9/3) 2011-11-20 20:31:32 PST
I'm not reproducing on a local debug build from the 18th. Do you need to have a websocket server running?
Comment 3 Paul Rouget [:paul] 2011-11-21 02:10:45 PST
Can't reproduce (Linux here).
Comment 4 Ivan Enderlin 2011-11-21 05:21:28 PST
I targeted Mac OS X.

@Patrick: I don't have any stack trace :-/.
@Josh: Even if my Websocket is running, the bug appears. I tried with a build from the 19th.
Comment 5 Josh Matthews [:jdm] (away until 9/3) 2011-11-21 06:07:35 PST
Ivan, just to confirm two things: are you saying that there's no crash report listed in about:crashes? Also, comment 4 isn't clear to me - can you reproduce the crash _without_ a websocket server running?
Comment 6 Ivan Enderlin 2011-11-22 01:58:58 PST
@Josh: It could be one of theses crashes: https://crash-stats.mozilla.com/report/index/bp-3907a952-a21c-4659-9c9f-bf3d82111122.
No Websocket server is listening/running. I just have Firefox in “work offline” mode and my Bug.html file.
Comment 7 Patrick McManus [:mcmanus] PTO until Sep 6 2011-11-22 05:32:44 PST
Thanks for the stack ivan!

I suspect this is probably caused by 664894, but I'm not certain.

you are exiting EstablishConnection early via a failed NS_ENSURE_SUCCESS path - probably asyncopen() given your network setup.

That causes the nsAutoCloseWS class to call CloseConnection(), which in turn deref's mWebsocketChannel which is null because you're still in CONNECTING state and haven't finished EstablishConnection.

The fix is just a null ptr check; I'll attach it shortly.
Comment 8 Ivan Enderlin 2011-11-22 05:35:55 PST
I have suspected something like this. Good to know you have a clue :-).
Comment 9 Patrick McManus [:mcmanus] PTO until Sep 6 2011-11-22 05:57:33 PST
Created attachment 576134 [details] [diff] [review]
patch 0
Comment 10 Patrick McManus [:mcmanus] PTO until Sep 6 2011-11-22 15:44:24 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/0cffc341bd5b
Comment 11 Ed Morley [:emorley] 2011-11-23 04:24:01 PST
https://hg.mozilla.org/mozilla-central/rev/0cffc341bd5b
Comment 12 Patrick McManus [:mcmanus] PTO until Sep 6 2011-11-28 14:31:48 PST
https://hg.mozilla.org/releases/mozilla-aurora/rev/e6dc2e642824
Comment 13 Vlad [QA] 2012-01-03 06:57:00 PST
I have verified this bug using the steps from the description on:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0) Gecko/20100101 Firefox/10.0 beta 2
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0) Gecko/20100101 Firefox/10.0 beta 2

and Firefox didn't crash.

Setting resolution to verified on Beta.
Comment 14 Vlad [QA] 2012-02-27 07:44:46 PST
I've verified this bug using the steps from the description and Firefox did not crash.

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0 beta 4
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20100101 Firefox/11.0 beta 4

Setting resolution to Verified Fixed.

Note You need to log in before you can comment on or make changes to this bug.