Bug 196051

Summary: www/firefox - fix alsa interface to prevent assert-failures
Product: Ports & Packages Reporter: Mikhail T. <freebsd-2024>
Component: Individual Port(s)Assignee: freebsd-gecko (Nobody) <gecko>
Status: Closed FIXED    
Severity: Affects Only Me CC: avg, freebsd-2024, jakub_lach, jbeich
Priority: --- Flags: jbeich: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 196667    
Attachments:
Description Flags
Change existing files/patch-bug1021761 to do a better job with cubeb_alsa.c none

Description Mikhail T. 2014-12-17 03:19:54 UTC
Created attachment 150672 [details]
Change existing files/patch-bug1021761 to do a better job with cubeb_alsa.c

The new version of cubeb_alsa.c handles the ALSA library failures -- documented and undocumented alike. This, probably, obsoletes the 20121010-warning in UPDATING and obviates the Bug 170473.

The idea came from Andriy Gapon's post:

http://lists.freebsd.org/pipermail/freebsd-gecko/2013-November/003793.html

but I expanded on it...
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-12-17 03:19:54 UTC
Auto-assigned to maintainer gecko@FreeBSD.org
Comment 2 jakub_lach 2015-02-02 10:04:48 UTC
Hello, is there any relation to Bug 196667?
Comment 3 Jan Beich freebsd_committer freebsd_triage 2015-02-02 11:07:14 UTC
The patch here didn't land yet because I need to
- test it doesn't introduce regressions unlike Andriy's version (IIRC)
- decouple from unrelated Mozilla bug 1021761
- file an upstream bug and try to scrutinize out the rationale for changes

(In reply to jakub_lach from comment #2)
> Hello, is there any relation to Bug 196667?

To rule out the bug here you can rebuild audio/alsa-plugins with BUFSZ_P2 enabled (default) or switch to PULSEAUDIO in www/firefox.
Comment 4 jakub_lach 2015-02-02 11:56:59 UTC
As I have BUFSZ_P2 enabled in alsa-plugins, looks like my problem, albeit going at the times through cubeb_alsa.c too, is something different.

Thanks for the pointer!
Comment 5 Jan Beich freebsd_committer freebsd_triage 2015-02-04 08:36:12 UTC
Just BUFSZ_P2 enabled doesn't give enough confidence. Also try to
- comment out EXTRA_PATCHES in audio/alsa-plugins/Makefile
- switch to non-default alsa-plugin (e.g. jack or pulse) in ~/.asoundrc
Comment 6 commit-hook freebsd_committer freebsd_triage 2015-02-06 12:09:05 UTC
A commit references this bug:

Author: jbeich
Date: Fri Feb  6 12:08:47 UTC 2015
New revision: 378529
URL: https://svnweb.freebsd.org/changeset/ports/378529

Log:
  Fix crashes with ALSA e.g., when disabling BUFSZ_P2 in alsa-plugins

  PR:		196051
  Differential Revision:	https://reviews.freebsd.org/D1788
  Submitted by:	mi
  Approved by:	bapt (mentor)

Changes:
  head/UPDATING
  head/mail/thunderbird/Makefile
  head/mail/thunderbird/files/patch-bug1130155
  head/www/firefox/Makefile
  head/www/firefox/files/patch-bug1130155
  head/www/firefox-esr/Makefile
  head/www/firefox-esr/files/patch-bug1130155
  head/www/libxul/Makefile
  head/www/libxul/files/patch-bug1130155
  head/www/seamonkey/Makefile
  head/www/seamonkey/files/patch-bug1130155
Comment 7 Jan Beich freebsd_committer freebsd_triage 2015-02-06 12:10:42 UTC
Comitted. Thanks.
Comment 8 Andriy Gapon freebsd_committer freebsd_triage 2015-02-06 15:20:58 UTC
Just for posterity. Some time after I posted my patch I determined that my problems were caused by a kernel bug that result in random userland pages getting zeroed out.  After the kernel bug was fixed I stopped using any extra firefox patches and never saw the problem again.
My alsa libraries came from the official FreeBSD package repository, so all options were at default values.
Comment 9 jakub_lach 2015-02-06 23:48:40 UTC
FWIW, I've replicated the 196667 after this patch too.
Comment 10 Mikhail T. 2015-02-06 23:53:56 UTC
The crash in Bug 196667 seems in Gstreamer-interface, not here. Whatever the problem is there, I doubt it is related one way or the other.
Comment 11 jakub_lach 2015-02-08 11:20:11 UTC
It was confounding issue for me, as I think I got both crashes with firefox-nightly, but couldn't know, as firefox-nightly doesn't work for me at all if compiled with debug. Anyway, I'm really happy that's fixed. Thanks!
Comment 12 commit-hook freebsd_committer freebsd_triage 2015-02-27 06:33:03 UTC
A commit references this bug:

Author: jbeich
Date: Fri Feb 27 06:32:05 UTC 2015
New revision: 380063
URL: https://svnweb.freebsd.org/changeset/ports/380063

Log:
  - Update to 1.0.29
  - alsa-plugins-oss: Disable BUFSZ_P2 by default after r378529 [1]
  - No PORTREVISION bumps because binary compatible

  Changes:	http://www.alsa-project.org/main/index.php/Changes_v1.0.28_v1.0.29
  ACC report:	http://upstream-tracker.org/compat_reports/alsa/1.0.28_to_1.0.29/abi_compat_report.html
  PR:		196051 [1]
  Suggested by:	mi [1]

Changes:
  head/audio/alsa-lib/Makefile
  head/audio/alsa-lib/distinfo
  head/audio/alsa-lib/pkg-plist
  head/audio/alsa-plugins/Makefile
  head/audio/alsa-plugins/distinfo
  head/audio/alsa-utils/Makefile
  head/audio/alsa-utils/distinfo
  head/audio/alsa-utils/pkg-plist