worker.postMessage behaves like there is a hidden exception in Cloud9 Ace

VERIFIED FIXED in Firefox 8

Status

()

Core
DOM
VERIFIED FIXED
6 years ago
6 years ago

People

(Reporter: Fabian Jakobs, Assigned: Ben Turner (not reading bugmail, use the needinfo flag!))

Tracking

({regression})

8 Branch
mozilla8
x86
Mac OS X
regression
Points:
---

Firefox Tracking Flags

(firefox8+ fixed, firefox9+ fixed, firefox10 fixed)

Details

(Whiteboard: [qa!])

Attachments

(2 attachments)

(Reporter)

Description

6 years ago
Created attachment 563961 [details]
kitchen-sink-uncompressed.js

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.5 (KHTML, like Gecko) Chrome/16.0.891.1 Safari/535.5

Steps to reproduce:

The latest FF 8 beta broke the Ace editor <http://ace.ajax.org>. I was able to trace it down to a problem with web workers and postMessage. The relevant code is:

console.log("before")
this.$worker.postMessage({event: event, data: data});
console.log("posted");

The last line is never executed, however there is no error shown and the callstack is rolled back just normal. It looks like an invisible exception is thrown.

Steps to reproduce:

1. go to <http://fjakobs.github.com/ace_ff8_bug/kitchen-sink.html>
2. execute fire() in the console.
3. Observe that "before" is printed but "posted" is not.

Setting a breakpoint in <http://fjakobs.github.com/ace_ff8_bug/demo/kitchen-sink-uncompressed.js> line 17245 and stepping over the postMessage shows this behavior.

Updated

6 years ago
Component: General → DOM
Product: Firefox → Core
QA Contact: general → general
(Reporter)

Comment 1

6 years ago
the related Ace bug is <https://github.com/ajaxorg/ace/issues/405>
status-firefox10: --- → affected
status-firefox8: --- → affected
status-firefox9: --- → affected
tracking-firefox8: --- → ?
tracking-firefox9: --- → ?
Keywords: regression
Yeah, there's a bug here, in our code as well as yours I think. You're calling postMessage() on a worker after you call terminate() on it which is probably not what you mean to do. However, the bigger problem here is that we throw an uncatchable exception in this case.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Created attachment 564078 [details] [diff] [review]
Patch, v1

Patch should fix us.
Assignee: nobody → bent.mozilla
Status: NEW → ASSIGNED
Attachment #564078 - Flags: review?(jonas)
(Reporter)

Comment 4

6 years ago
Calling postMessage() after terminate() is really not what I intended. Let me know once you have a build where I can test the fix. The bug is currently in FF 8beta and I think it is pretty severe.
Attachment #564078 - Flags: review?(jonas) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/74e93efada21
Whiteboard: [inbound]
Comment on attachment 564078 [details] [diff] [review]
Patch, v1

This fixes a pretty bad bug in the new worker implementation (new in FF8) and it's a tiny change, well localized.
Attachment #564078 - Flags: approval-mozilla-beta?
Attachment #564078 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/74e93efada21
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla10

Updated

6 years ago
Attachment #564078 - Flags: approval-mozilla-beta?
Attachment #564078 - Flags: approval-mozilla-beta+
Attachment #564078 - Flags: approval-mozilla-aurora?
Attachment #564078 - Flags: approval-mozilla-aurora+
https://hg.mozilla.org/releases/mozilla-aurora/rev/557b00e625d2
https://hg.mozilla.org/releases/mozilla-beta/rev/1f97d3a842c3
status-firefox10: affected → fixed
status-firefox8: affected → fixed
status-firefox9: affected → fixed
Target Milestone: mozilla10 → mozilla8
qa+ for verification in Firefox 8, 9, and 10 using the testcase in comment 0.
Whiteboard: [qa+]

Comment 10

6 years ago
I tested to see if the issue is still reproducible since the fix landed on all channels (comment 7 and comment8); I followed the steps to reproduce in the description and got the following results:
WORKS:
-> Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20100101 Firefox/8.0 (Mac OS 10.6 - Beta)
-> Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0a2) Gecko/20111013 Firefox/9.0a2 (Mac OS 10.6 - Aurora)
-> Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0a1) Gecko/20111013 Firefox/10.0a1 (Mac OS 10.6 - Nightly)

Since it works on all channels setting this bug as Verified and changing the whiteboard entry qa+ to qa!
Status: RESOLVED → VERIFIED
Whiteboard: [qa+] → [qa!]

Comment 11

6 years ago
[triage comment]

We'll track this as it was a regression in a widely used library and we'll want to be aware if it breaks or wasn't fixed all the way. Because it is already fixed in beta, nothing to do currently.
tracking-firefox8: ? → +
tracking-firefox9: ? → +
You need to log in before you can comment on or make changes to this bug.