gimite / web-socket-js

HTML5 Web Socket implementation powered by Flash
BSD 3-Clause "New" or "Revised" License
2.73k stars 489 forks source link

Firefox 3.6.13 Error #1009: Cannot access a property or method of a null object reference #54

Closed michaelfig closed 13 years ago

michaelfig commented 13 years ago

Hi,

I can use the WebSocket without any problems on Chrome and IE6 (with the flash fallback), but when I try Firefox 3.6.13, it works for the first few message exchanges, but then dies during a message I send from a button onclick event. Here is the Console log (the Error #1009 shows up each time I click a button).

I've hidden the domain name, replacing everything with private.example.com because I'm not yet sure that the person I'm working on this for would be willing to expose her site to the public yet. Note that I run a policy server on port 843, the main web site is on 5004, and the web socket-enabled web server is on 8100.

[WebSocket] policy file: xmlsocket://private.example.com:843
[WebSocket] connected
[WebSocket] request header: GET /_hippie/ws/ab:16011?client_id= HTTP/1.1 Upgrade: WebSocket
Connection: Upgrade
Host: private.example.com:8100
Origin: http://private.example.com:5004
Cookie: __utma=229512961.963454258.1293130049.1295481209.1295545518.7; __utmz=229512961.1295545518.7.7.utmcsr=XXX:5004|utmccn=(referral)|utmcmd=referral|utmcct=/cgi-bin/Upcoming.cgi; COOKIE-DATA
Sec-WebSocket-Key1: 14%27=c80Z99 64
Sec-WebSocket-Key2: * 472 7o8K3 5jeE 9p bo8W *

[WebSocket] sent key3: SOMEKEY
[WebSocket] response header:
HTTP/1.1 101 Web Socket Protocol Handshake
Upgrade: WebSocket
Connection: Upgrade
Sec-WebSocket-Origin: http://private.example.com:5004
Sec-WebSocket-Location: ws://private.example.com:8100/_hippie/ws/aucbidder:16011?client_id=

[WebSocket] reply digest: SOME-DIGEST
POST http://private.example.com:5004/cgi-bin/Upcoming.cgi
POST http://private.example.com:5004/cgi-bin/Upcoming.cgi 200 OK 4.61s lai.js (line 128)
[WebSocket] received: {"client_id":"0.83394390687782","type":"hippie.pipe.set_client_id"}
[WebSocket] sent: {"type":"watch","expanded":[],"shown":["23137","23117","23136","23119","22454","23121","23135","23122","23120","23139","23140","23141","20562","23055"]}
[WebSocket] received: {"type":"ready"}
[WebSocket] sent: {"type":"watch","expanded":["23119"],"shown":["23137","23117","23136","23119","22454","23121","23135","23122","23120","23139","23140","23141","20562","23055"]}
Error #1009: Cannot access a property or method of a null object reference.
   throw new Error(myErrorMessage[1]);   FABridge.js (line 561)
Error #1009: Cannot access a property or method of a null object reference.
   throw new Error(myErrorMessage[1]);  FABridge.js (line 561)
POST http://private.example.com:5004/cgi-bin/Upcoming.cgi 200 OK 2.01s lai.js (line 128)
POST http://private.example.com:5004/cgi-bin/Upcoming.cgi 200 OK 830ms lai.js (line 128)
Error #1009: Cannot access a property or method of a null object reference.
    throw new Error(myErrorMessage[1]);  FABridge.js (line 561)

The Flash trace log is as follows:

model: item: 0
model: item: 0
view: item: 0,undefined
view: item: 0,undefined
view: item: 0,undefined
model: item: 0
model: volume: 95
model: volume: 95
view: volume: 95,undefined
view: volume: 95,undefined
view: volume: 95,undefined
model: volume: 95
model: pause: 0
model: pause: 0
view: time: 0,0
view: time: 0,0
view: time: 0,0
view: state: 0,undefined
view: state: 0,undefined
view: state: 0,undefined
model: pause: 0

And finally, the Policy Log:

OK: Root-level SWF loaded: file:///home/michael/.mozilla/firefox/uzfwk6yl.default/extensions/flashbug@coursevector.com/chrome/content/flashbug/version.swf
OK: Root-level SWF loaded: http://private.example.com:8100/static/web-socket-js/WebSocketMainInsecure.swf
OK: Root-level SWF loaded: http://private.example.com/media/mediaplayer.swf
OK: Searching for  in policy files to authorize data loading from resource at xmlsocket://private.example.com:8100 by requestor from http://private.example.com:8100/static/web-socket-js/WebSocketMainInsecure.swf
OK: Policy file accepted: xmlsocket://private.example.com:843
OK: Request for resource at xmlsocket://private.example.com:8100 by requestor from http://private.example.com:8100/static/web-socket-js/WebSocketMainInsecure.swf is permitted due to policy file at xmlsocket://private.example.com:843
OK: Root-level SWF loaded: http://private.example.com:8100/static/web-socket-js/WebSocketMainInsecure.swf

I tried with both the secure and insecure versions, with no luck.

Ordinarily, I would try hunting down the misbehaving code myself, but even after following the instructions in the README.txt and rerunning build.sh, I can't seem to get any of my changes to the code to reflect in the browser. Weird.

I'd be happy to provide more details upon request, Thanks.

michaelfig commented 13 years ago

I was able to recompile the .swf with more debug logging. I traced my problem to the following scenario:

Could it be that Flash is recreating the new WebSocketMain because the old object crashes somehow? If so, how can I find out how the old one crashed?

Thanks, Michael.

gimite commented 13 years ago

Hmm I haven't seen such thing happens.

kanaka commented 13 years ago

michaelfig, can you check to see if you still see this issue with the new web-socket-js which removes FABridge?

gimite commented 13 years ago

Assuming this is fixed. Please reopen if you still see this.