Reloading after creating AudioContext causes InvalidStateError
Categories
(Core :: Web Audio, defect, P2)
Tracking
()
People
(Reporter: omgitsraven, Assigned: padenot)
References
Details
(Keywords: regression)
Attachments
(1 file)
47 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0
Steps to reproduce:
- Visit a page containing a script tag that contains "new AudioContext()", i.e.: http://ravenworks.ca/temp/audioctx.html
- Open the console
- Reload the page
Actual results:
A red error appears, saying " InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable"
Expected results:
Nothing.
For a slightly more complex example: http://ravenworks.ca/temp/audioctx_click.html Here the AudioContext is only created if the text is clicked, and in that case, the error only appears when reloading after having clicked the text, not when reloading after having done nothing.
Updated•5 years ago
|
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Regression window:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=7eb7606a2b12990e8ef5e470db27838d5f5af612&tochange=7ccc1c8a7abeefd54bc4cf9a5d0eef23681c924a
Suspect: Bug 1486130
:kmag,
Your bunch of patch seems to cause the error message.
Can you please look into this?
Comment 2•5 years ago
|
||
My patch does not cause the error. It just stops it from being hidden.
Updated•5 years ago
|
Comment 4•5 years ago
|
||
This is the stack generating the unhandled rejected promise.
#8 0x00007fd8ce466c35 in mozilla::dom::Promise::MaybeReject(nsresult)
(this=0x7fd8c94a5460, aArg=-2142044149)
at /var/karl/moz/obj/dist/include/mozilla/dom/Promise.h:94
#9 0x00007fd8d2b07a60 in mozilla::dom::AudioContext::Shutdown()
(this=0x7fd8e62b4f80)
at /home/karl/moz/dev/dom/media/webaudio/AudioContext.cpp:716
#10 0x00007fd8d05bd3e1 in nsGlobalWindowInner::FreeInnerObjects()
(this=0x7fd8c9209c00)
at /home/karl/moz/dev/dom/base/nsGlobalWindowInner.cpp:1162
#11 0x00007fd8d0601193 in nsGlobalWindowOuter::SetNewDocument(mozilla::dom::Document*, nsISupports*, bool)
(this=0x7fd8c96bf4c0, aDocument=0x7fd8c78f1000, aState=0x0, aForceReuseInnerWindow=false) at /home/karl/moz/dev/dom/base/nsGlobalWindowOuter.cpp:2242
I assume this is the ignored promise from the Close() above.
If the promise is ignored, then perhaps the MaybeReject() loop can be moved to before the Close() call.
https://hg.mozilla.org/mozilla-central/rev/353266dd63ede28fd3f8f5ddd8d855f5beb7395d#l1.12
"global is going away soon" sounds similar to this situation, but I don't know much about that:
https://hg.mozilla.org/mozilla-central/rev/8e22b608af25e273d0cc5d6347bd1112f9de1be1#l1.67
Paul, do you know whether this situation is related to bug 1325215?
Comment 5•5 years ago
|
||
(In reply to Karl Tomlinson (:karlt) from comment #4)
Paul, do you know whether this situation is related to
bug 1343550, I meant.
Assignee | ||
Comment 6•5 years ago
|
||
This is done in the same style as ::Suspend
and ::Resume
.
Assignee | ||
Updated•5 years ago
|
Pushed by padenot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3a9d2f91b022 Don't create a Promise when shutting down an AudioContext. r=karlt
Comment 9•5 years ago
|
||
bugherder |
Hi Paul, since 67 is marked as affected, should we consider uplifting this to Beta67?
Assignee | ||
Comment 11•5 years ago
|
||
Comment on attachment 9052872 [details]
Bug 1528319 - Don't create a Promise when shutting down an AudioContext. r=karlt
Beta/Release Uplift Approval Request
- Feature/Bug causing the regression: Bug 1486130
- User impact if declined: Bug 1486130 made it so that the error stopped being hidden. It's quite benign, but can also be puzzling for developers: it's seemingly an error that only happens during the onloading of a document, but the console persists between reload, so it looks like an error at loading a bit.
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): This is doing the same thing we've been doing for quite some time on the two other methods for the same feature (suspend/resume/close, this is handling the close bit), and we never had any issues with the other ones.
- String changes made/needed:
Comment 12•5 years ago
|
||
https://hg.mozilla.org/projects/ash/rev/3a9d2f91b02203fc9e538fcfe51e2cb5cf620b29 Bug 1528319 - Don't create a Promise when shutting down an AudioContext. r=karlt
Comment 13•5 years ago
|
||
[Tracking Requested - why for this release]:
Paul has posted a patch for beta uplift in comment 11.
Updated•5 years ago
|
Comment 14•5 years ago
|
||
Comment on attachment 9052872 [details]
Bug 1528319 - Don't create a Promise when shutting down an AudioContext. r=karlt
Well understood fix affecting web developers working with audio only, verified on Nightly, uplift approved for 67 beta 7 thanks.
Comment 15•5 years ago
|
||
bugherder uplift |
Updated•5 years ago
|
Comment 16•5 years ago
|
||
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0
Build ID: 20190331141835
Verified as fixed using the latest DevEdition Build and the latest Nightly Build (20190402083512). The Error is no longer displayed in the Console.
Updated•5 years ago
|
Description
•