From owner-freebsd-gecko@FreeBSD.ORG Wed Nov 27 08:51:08 2013 Return-Path: Delivered-To: freebsd-gecko@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6B83200 for ; Wed, 27 Nov 2013 08:51:08 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 15AF9213A for ; Wed, 27 Nov 2013 08:51:04 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA29861; Wed, 27 Nov 2013 10:51:02 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Vlapq-0005Fc-KW; Wed, 27 Nov 2013 10:51:02 +0200 Message-ID: <5295B23E.5050901@FreeBSD.org> Date: Wed, 27 Nov 2013 10:50:06 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: freebsd-gecko@FreeBSD.org Subject: Re: Firefox 25 crashing on HTML5 video References: <5275CD06.5000309@tasteapiana.com> <527611AE.8080102@smeets.im> In-Reply-To: <527611AE.8080102@smeets.im> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-gecko@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Gecko Rendering Engine issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Nov 2013 08:51:08 -0000 on 03/11/2013 11:04 Florian Smeets said the following: > On 03/11/13 05:11, Bryon wrote: >> >> Problem: >> When I visit vimeo.com, attempt to play any video, firefox crashes and I >> get: >> >> Assertion failed: (wrote >= 0 && wrote == got), function >> alsa_refill_stream, file >> /usr/ports/www/firefox/work/mozilla-release/media/libcubeb/src/cubeb_alsa.c, >> line 319. >> Abort >> >> > > I'm copying the UPDATING entry that describes how to fix the issue. This > should fix your problem. > > 20121010: > AFFECTS: users of www/firefox and www/seamonkey > AUTHOR: gecko@FreeBSD.org > > When using Firefox or SeaMonkey compiled with ALSA option ON it may > crash on assert in alsa_refill_stream as described in ports/170473. > To workaround disable ARIFF_OSS in audio/alsa-plugins or use PULSEAUDIO. > >From time to time I have this assertion triggered as well as another one in alsa_stream_get_position(). I do use alsa instead of pulseaudio and do I have ARIFF_OSS disabled. My impression is that those assertions are simply bogus and the checked conditions should really be handled. The following patch seems to help me: --- media/libcubeb/src/cubeb_alsa.c.orig 2013-11-25 12:26:52.535841261 +0200 +++ media/libcubeb/src/cubeb_alsa.c 2013-11-25 21:37:26.341186969 +0200 @@ -252,7 +252,9 @@ alsa_refill_stream(cubeb_stream * stm) unsigned short revents; snd_pcm_sframes_t avail; long got; + long towrite; void * p; + void * write_p; int draining; draining = 0; @@ -310,14 +312,20 @@ alsa_refill_stream(cubeb_stream * stm) stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR); return ERROR; } - if (got > 0) { - snd_pcm_sframes_t wrote = snd_pcm_writei(stm->pcm, p, got); - if (wrote == -EPIPE) { + towrite = got; + write_p = p; + while (towrite > 0) { + snd_pcm_sframes_t wrote = snd_pcm_writei(stm->pcm, p, towrite); + if (wrote < 0) { snd_pcm_recover(stm->pcm, wrote, 1); - wrote = snd_pcm_writei(stm->pcm, p, got); + continue; } - assert(wrote >= 0 && wrote == got); + if (towrite != wrote) + printf("writing %d wrote %d\n", towrite, wrote); + assert(wrote >= 0); stm->write_position += wrote; + write_p = (char*)write_p + wrote; + towrite -= wrote; gettimeofday(&stm->last_activity, NULL); } if (got != avail) { @@ -996,7 +1004,10 @@ alsa_stream_get_position(cubeb_stream * return CUBEB_OK; } - assert(delay >= 0); + if (delay < 0) { + snd_pcm_forward(stm->pcm, -delay); + delay = 0; + } *position = 0; if (stm->write_position >= (snd_pcm_uframes_t) delay) { -- Andriy Gapon