Backgrounding MobileSafari with open WebSocket connections can cause crash

Originator:andy
Number:rdar://10811789 Date Originated:2012-02-06
Status:Open Resolved:
Product:iOS Product Version:4.x/5.x
Classification: Reproducible:Yes
 
06-Feb-2012 11:51 AM Andy Buckingham:
Summary:
When backgrounding Mobile Safari once a web page has opened a WebSocket connection, when returning to Mobile Safari after the socket has likely timed out and been closed MobileSafari will crash.

Steps to Reproduce:
1. Open a web page that establishes a web socket connection.
2. Press Home to background the app.
3. Wait for the remote end to disconnect due to inactivity.
4. Re-open Mobile Safari.

Expected Results:
The page would reconnect and gracefully handle the disconnection.

Actual Results:
Mobile Safari crashes.

Comments

In my tests it's also necessary to try calling send() on the connection, e.g. in response to a message

Full details here: https://gist.github.com/2052006


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!