Closed Bug 949946 Opened 6 years ago Closed 6 years ago

"Assertion failure: !domainInfo->mSharedWorkerInfos.Get(sharedWorkerScriptSpec)"

Categories

(Core :: DOM: Workers, defect, critical)

x86_64
macOS
defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla30
Tracking Status
firefox29 + fixed
firefox30 --- verified

People

(Reporter: jruderman, Assigned: baku)

References

(Regression)

Details

(Keywords: assertion, testcase)

Attachments

(3 files)

Attached file testcase
No description provided.
Flags: needinfo?(bent.mozilla)
Attached file stack
Assertion failure: !domainInfo->mSharedWorkerInfos.Get(sharedWorkerScriptSpec), at /Users/jruderman/trees/mozilla-central/dom/workers/RuntimeService.cpp:1314
Assignee: nobody → amarchesini
Attached patch crash.patchSplinter Review
I think that we can keep the name as nsCString instead nsString. The name getter is less common than any lookup in the hash table.
Attachment #8370222 - Flags: review?(bent.mozilla)
Comment on attachment 8370222 [details] [diff] [review]
crash.patch

Review of attachment 8370222 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!

::: dom/workers/RuntimeService.cpp
@@ +276,5 @@
>  }
>  
> +// This function creates a key for a SharedWorker composed by "name|scriptSpec".
> +// If the name contains a '|', this will be replaced by '||'.
> +static void

Nit: This is in an anonymous namespace so the 'static' isn't needed.

@@ +280,5 @@
> +static void
> +GenerateSharedWorkerKey(const nsACString& aScriptSpec, const nsACString& aName,
> +                        nsCString& aKey)
> +{
> +  aKey.Truncate();

Let's do a SetCapacity(aScriptSpec.Length() + aName.Length() + 1) to avoid mallocing more than once in the common case?

@@ +293,5 @@
> +      aKey.Append(*start);
> +    }
> +  }
> +
> +  aKey.AppendASCII("|");

Just |Append('|')|

@@ +1328,5 @@
>        domainInfo->mActiveWorkers.AppendElement(aWorkerPrivate);
>      }
>  
>      if (isSharedWorker) {
> +      nsCString key;

Let's make this nsAutoCString, and everywhere else where you call GenerateSharedWorkerKey
Attachment #8370222 - Flags: review?(bent.mozilla) → review+
Flags: needinfo?(bent.mozilla)
We should really get this on aurora.
Comment on attachment 8370222 [details] [diff] [review]
crash.patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 643325
User impact if declined: a crash
Testing completed (on m-c, etc.): m-c 
Risk to taking this patch (and alternatives if risky): none.
String or IDL/UUID changes made by this patch: none.
Attachment #8370222 - Flags: approval-mozilla-aurora?
Attachment #8370222 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
https://hg.mozilla.org/mozilla-central/rev/e29e610f7567
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
Reproduced in Nightly 2013-12-18-mozilla-central-debug.
Verified fixed in Nightly 2014-02-10-mozilla-central-debug, Win 7 x64.
Status: RESOLVED → VERIFIED
Regressed by: 1510744
You need to log in before you can comment on or make changes to this bug.