Closed Bug 700512 Opened 8 years ago Closed 8 years ago
Workers + Files exposes threadsafety assertions with Data
Jonas reports that bent has seen threadsafety assertions from DataOwner when manipulating File objects in Workers in certain ways.
Yeah, we need to make the DataOwner refcounting threadsafe. As things stand now, if a memory-blob is used on both the main thread and a worker thread, the refcount can end up both too high and too low due to races.
Assignee: nobody → khuey
Comment on attachment 572820 [details] [diff] [review] Patch Err.. you only want to delete if the refcount goes to 0, right?
Attachment #572820 - Flags: review?(jonas) → review-
Attachment #572824 - Flags: review?(jonas) → review+
Attachment #572824 - Flags: review?(benjamin)
If we're respinning 8.0, perhaps we should consider including this? It's a pretty easy fix to a new bug in 8.0.
[Triage Comment] This is sg:high and therefore doesn't meet the criteria for landing on the release branch for a chemspill.
Wait... I don't like that this doesn't stabilize the refcount. Having inconsistent implementations of Release seems like a recipe for headaches, and having no stabilization seems like a recipe for double-free.
refcount stabilization was a terrible idea. We should assert if you try to addref a dying object, not propagate stabilization to new macros where it's not already potentially used.
Fatally asserting sounds fine, but I imagine we'd only do that in debug builds since you have to have some other state bit to track that. For opt builds we'd just have no protection against double frees?
You really don't need another state bit, just use PR_UINT32_MAX as a sentinel value. I'm not sure that the extra branch is worth the protection in release builds, but we should probably measure to see how much it actually costs.
Checked in without a test case. https://hg.mozilla.org/mozilla-central/rev/d20b9d389776
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
Comment on attachment 572824 [details] [diff] [review] Patch Requesting aurora and beta approval for this security regression introduced in Firefox 8.
Comment on attachment 572824 [details] [diff] [review] Patch [triage comment] Please land on aurora and beta today if at all possible.
Does this affect the 1.9.2 branch? (qawanted)
Is there something QA can do to verify this fix?
Whiteboard: [sg:high] → [sg:high][qa?]
The tests for this landed in Bug 698621 for reasons that I don't understand.
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.