Closed Bug 621430 Opened 15 years ago Closed 15 years ago

Freeze (OOM) when playing Agent 008 Ball (NS_ERROR_OUT_OF_MEMORY) [nsIDOMHTMLAudioElement.play]

Categories

(Core :: Audio/Video, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED FIXED
Tracking Status
blocking2.0 --- final+
status2.0 --- wanted

People

(Reporter: LpSolit, Assigned: roc)

References

()

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

This problem is new to Fx4.0b8, AFAIK. I don't remember having seen this problem with beta6 or beta7. When playing the game at http://agent8ball.com/, it suddenly freezes after a few minutes with the following error in the Error Console: Error : uncaught exception: [Exception... "Component returned failure code: 0x8007000e (NS_ERROR_OUT_OF_MEMORY) [nsIDOMHTMLAudioElement.play]" nsresult: "0x8007000e (NS_ERROR_OUT_OF_MEMORY)" location: "JS frame :: http://assets2.agent8ball.com/javascripts/compiled.js?1292308929 :: <TOP_LEVEL> :: line 127" data: no] I have several addons installed, so I wonder if one of them is interacting with the game or not. Maybe the error above is enough for you to debug it. :) Let me know if more information is needed.
If I reload the page after the game freezes, I get: Error : out of memory Source File : jar:file:///usr/local/firefox/omni.jar!/components/nsSessionStore.js Line : 3611
After pasting the previous comment, I got: Error : [Exception... "Component returned failure code: 0x8007000e (NS_ERROR_OUT_OF_MEMORY) [nsIScriptableUnicodeConverter.convertToInputStream]" nsresult: "0x8007000e (NS_ERROR_OUT_OF_MEMORY)" location: "JS frame :: jar:file:///usr/local/firefox/omni.jar!/components/nsSessionStore.js :: sss_writeFile :: line 3805" data: no] Source File : jar:file:///usr/local/firefox/omni.jar!/components/nsSessionStore.js Line : 3805
(In reply to comment #0) > I have several addons installed, so I wonder if one of them is interacting with > the game or not. This problem also occurs with a new clean profile, so extensions are not the culprit. Also, I can see the following error in the console: mmap() failed: Ne peut allouer de la mémoire (means: mmap() failed: cannot allocate memory)
blocking2.0: --- → ?
I suspect this is related to bug 613915.
Summary: Freeze (OOM) when playing Agent 008 Ball → Freeze (OOM) when playing Agent 008 Ball (NS_ERROR_OUT_OF_MEMORY) [nsIDOMHTMLAudioElement.play]
I see the same with http://www.pirateslovedaisies.com/ Error: uncaught exception: [Exception... "Component returned failure code: 0x8007000e (NS_ERROR_OUT_OF_MEMORY) [nsIDOMHTMLAudioElement.play]" nsresult: "0x8007000e (NS_ERROR_OUT_OF_MEMORY)" location: "JS frame :: http://www.pirateslovedaisies.com/scripts/compiled-scripts.js :: <TOP_LEVEL> :: line 507" data: no] The results is that Firefox (latest-trunk) hangs completly / crashes, the only way out is to kill the process. I am using Win Vista. (In reply to comment #4) > I suspect this is related to bug 613915. Note that both websites are only using HTML5 features and no plugins.
Tentatively making this block since it's a demo that plays very well otherwise ... at least until we figure out what the problem is. It may be too hard to fix for FF4 if it's, say, zillions of media elements lying around.
Assignee: nobody → chris.double
blocking2.0: ? → final+
I get messages like [WAVE API] No memory error returned while executing opening audio device for playback which suggests we may actually be leaking something
Actually I don't think this should really block since it's probably not a regression. However, I would very much like to have a fix!
blocking2.0: final+ → -
Unsurprisingly, we have an obscene number of threads.
(In reply to comment #8) > Actually I don't think this should really block since it's probably not a > regression. Maybe someone can confirm this: works: win32 2010-11-30-03-mozilla-central 837d7b346a64 broken: win32 2010-12-01-03-mozilla-central d48a0e23feec http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=837d7b346a64&tochange=d48a0e23feec
OK.
blocking2.0: - → final+
Regression from bug 612798.
Assignee: chris.double → roc
Blocks: 612798
Attached patch patch v.1 (obsolete) — Splinter Review
Assignee: roc → doug.turner
Attachment #500937 - Flags: review?(roc)
Attached patch my fixSplinter Review
I think this one is simpler: we can just create the thread lazily. Also, I doubt it's safe to shut down the thread inside the stream destructor --- that spins the current thread's event loop.
Attachment #500948 - Flags: review?(doug.turner)
Comment on attachment 500948 [details] [diff] [review] my fix In this file, we already have a nsRunnable with the name AudioShutdownEvent. Please consider renaming your runnable to AsyncThreadShutdownEvent or something similar to avoid any confusion. nsAudioStreamLocal and nsAudioStreamRemote derive from nsAudioStream and nsAudioStream does have that nsCOMPtr to the playback thread. Although, we aren't down casting anywhere, you might as well make ~nsAudioStream virtual to avoid future issues. With those changes, r+
Attachment #500948 - Flags: review?(doug.turner) → review+
Assignee: doug.turner → roc
Whiteboard: [needs landing]
Attachment #500937 - Attachment is obsolete: true
Attachment #500937 - Flags: review?(roc)
http://hg.mozilla.org/mozilla-central/rev/29867a7bccf2 We need to figure out how to test this. I think we might want some kind of check at the end of mochitests, before we shut down, that not too many threads exist.
Status: NEW → RESOLVED
Closed: 15 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Whiteboard: [needs landing]
Verified fixed using 4.0b9pre, build d2bd42931b03 The memory is released once the game is over, or when doing nothing (Virtual Memory: 800 Mb instead of 2.8 Gb!) Thanks! :)
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: