Safari crashes on iOS 5.0.1 when WebSockets are used over 3G

Originator:rantav
Number:rdar://10835095 Date Originated:09-Feb-2012 03:19 PM
Status:Duplicate Resolved:
Product:iOS Product Version:5
Classification:Crash Reproducible:yes
 
09-Feb-2012 03:19 PM Ran Tavory:
Summary:
When opening a web page with the following javascript code in Mobile Safari for iOS 5.0.1 over 3G, Safari crashes.
The code opens a WebSockets connection to the pusher websockets service. 

   // over port 80 - ws.html
   var ws = new WebSocket('ws://ws.pusherapp.com:80/app/a42751cdeb5eb77a6889?client=js&version=1.11');
   ws.onopen = function() { console.log('open'); };
   ws.onmessage = function(msg) { console.log('msg: ' + msg.data); };
// CRASH HERE


   // over port 443 - wss.html
   var ws = new WebSocket('wss://ws.pusherapp.com:443/app/a42751cdeb5eb77a6889?client=js&version=1.11');
   ws.onopen = function() { console.log('open'); };
   ws.onmessage = function(msg) { console.log('msg: ' + msg.data); };
// CRASH HERE TOO

I've seen this only when using 3G, not wifi. This happens regardless of using port 80 or port 443

Steps to Reproduce:
1. Create a web page with the javascript code
2. Visit this page using mobile safari over 3G

Expected Results:
Should not crash :)

Actual Results:
Crash :(

Regression:
WebSockets are supposed to be new, so that's a new feature.

Notes:
See an example crash log.

Comments

I'm not able to replicate this issue. Does this maybe only happen on certain 3G networks? At Pusher (I'm the CTO) we have recently worked around a separate crashing bug in Safari (http://openradar.appspot.com/10811789), but we've never been able to replicate this one.


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!