Closed Bug 938361 Opened 12 years ago Closed 12 years ago

getusermedia makes cpu go to 100% and firefox become killable zombie after closing window

Categories

(Core :: WebRTC: Audio/Video, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: firefoxiscute, Unassigned)

References

()

Details

Attachments

(2 files, 1 obsolete file)

Reproduced with: https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2013-11-13-00-40-04-mozilla-aurora/firefox-27.0a2.en-US.linux-x86_64.tar.bz2 http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/25.0/linux-x86_64/en-US/firefox-25.0.tar.bz2 http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/25.0/linux-x86_64/en-US/firefox-24.0.tar.bz2 not reproducable with: (tried to supply you with a fancy log but with a debug build everything works fine :-( ) http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2013-11-13-mozilla-release-debug/firefox-25.0.en-US.debug-linux-x86_64.tar.bz2 Steps to reproduce: (Works regardless whether camera is plugged in or not) 1. Visit http://mozilla.github.io/webrtc-landing/gum_test.html 2. Click on "Video" 3. Watch cpu go to 100%. If camera is plugged in, no dialog appears asking to share cam. If it is not plugged in, no NO_DEVICES_FOUND appears. However, the stop button appears, but clicking does not have any effect, expect of "TypeError: video.mozSrcObject is null @ http://mozilla.github.io/webrtc-landing/gum_test.html:119" error in web console. 4. close tab. 5. watch cpu remain at 100% 6. close firefox window 7. watch cpu remain at 100%. firefox process is still alive. You can also wait some time, it still remains in this state. 8. from console: killall firefox 9. cpu is at normal level again, firefox process is terminated Expected behaviour: cpu remains normal, NO_DEVICES_FOUND when no camera is plugged in, camera offered for sharing when it is plugged in. I'm using Kubuntu 13.10. I have set the security flag as getusermedia can be called just by visiting a website without further user interaction.
DOS bugs don't need to be security-private.
Group: core-security
The stop button thing is normal for no devices (JS error in the test). What camera do you have? What if you just allow microphone and no camera? (Audio test - note it may feed back) Can you load the nightly into gdb, and then when it's sitting at 100% usage ^C and see what the stack looks like? (maybe a few times) and post here? What camera are you using?
Attached file gdb backtrace (obsolete) —
You get the gdb log where I make some stacktraces. All were created after video button was clicked. The first ones were created while the window was open, the last ones when the window has already been closed. I use: 046d:09a1 Logitech, Inc. QuickCam Communicate MP/S5500 But see comment 0: "Works (I meant 'shows this beahiour') regardless whether camera is plugged in or not" I can't allow neither microphone nor camera as no dialog appears. See comment 0 for this.
Sorry, the first log won't help much. In my second log I've selected the thread that causes the 100% CPU according to htop. The bug seems upstream: libasound. Is there a workaround to use pulseaudio for example?
Attachment #8337006 - Attachment is obsolete: true
Seldomly I also got segfaults when testing. Might be another bug.
What version of libasound is being used in kubuntu? It does seem to be i-looping in Enumerate for audio devices in the hints call. (sigh) I suggest you file a bug with upstream as well. It's also quite possible it's an artifact of your particular system and audio device drivers/configuration, or those combined with a bug in libasound. (Can you try a newer/older version, perhaps with LD_LIBRARY_PRELOAD to force a different version to be used for your test?) You could set include_alsa_audio to 0 in media/webrtc/webrtc_config.gypi and see if that works/works better. (BSD/etc don't use alsa)
Comment on attachment 8337113 [details] gdb backtrace log (segfault) This crash also speaks to internal ALSA bugs; perhaps with a bad card definition or failure to lock some internal structure.
Created upstream bug: https://bugs.launchpad.net/ubuntu/+source/alsa-lib/+bug/1254562 There your questions should be answered. Seems to be bug in the buildscript of my distro.
To clarify: I have libasound 1.0.27.2-1ubuntu6. If you want to try to reproduce the bug, either download the (compiled!) package from http://archive.ubuntu.com/ubuntu/pool/main/a/alsa-lib/alsa-lib_1.0.27.2-1ubuntu6.debian.tar.gz or compile it yourself using the automated "apt-get source -b" - mechanism on debian. Using other build methods I couldn't reproduce the issue.
Ok, clearly an upstream bug (perhaps in the build scripts for ubuntu?) Closing (for mozilla) as Invalid unless someone can point to us doing something wrong with the interface, which it does not appear currently.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
The 100% don't appear in firefox 28 anymore, however it still crashes sometimes. The dialog asking which device to give to the page appears very fast now. Bisected it to these commits: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=b4143e04bea1&tochange=47c8e9b16918 In the changes, there is also this change: https://hg.mozilla.org/mozilla-central/rev/6b6ea9376519 Don't know if the topic is related. I've tried to compile a working (recent) revision with --disable-pulseaudio --enable-alsa, but it still works. So don't know what it made work.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: