From owner-svn-ports-all@freebsd.org Fri Dec 27 23:50:44 2019 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 177E31D2E1A; Fri, 27 Dec 2019 23:50:44 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47l3VX0Yl3z4jdm; Fri, 27 Dec 2019 23:50:44 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E639205CF; Fri, 27 Dec 2019 23:50:44 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBRNohGm057421; Fri, 27 Dec 2019 23:50:43 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBRNoget057413; Fri, 27 Dec 2019 23:50:42 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <201912272350.xBRNoget057413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Fri, 27 Dec 2019 23:50:42 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r521041 - in branches/2019Q4: mail/thunderbird mail/thunderbird/files www/firefox www/firefox-esr www/firefox-esr/files www/firefox/files X-SVN-Group: ports-branches X-SVN-Commit-Author: jbeich X-SVN-Commit-Paths: in branches/2019Q4: mail/thunderbird mail/thunderbird/files www/firefox www/firefox-esr www/firefox-esr/files www/firefox/files X-SVN-Commit-Revision: 521041 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2019 23:50:44 -0000 Author: jbeich Date: Fri Dec 27 23:50:42 2019 New Revision: 521041 URL: https://svnweb.freebsd.org/changeset/ports/521041 Log: MFH: r521037 www/firefox: backport upstream sndio fixes Apparently, it fixes random tab crashes. Submitted by: tobik Approved by: ports-secteam blanket Added: branches/2019Q4/mail/thunderbird/files/patch-cubeb-sndio - copied unchanged from r521037, head/mail/thunderbird/files/patch-cubeb-sndio branches/2019Q4/www/firefox-esr/files/patch-cubeb-sndio - copied unchanged from r521037, head/www/firefox-esr/files/patch-cubeb-sndio branches/2019Q4/www/firefox/files/patch-cubeb-sndio - copied unchanged from r521037, head/www/firefox/files/patch-cubeb-sndio Modified: branches/2019Q4/mail/thunderbird/Makefile branches/2019Q4/www/firefox-esr/Makefile branches/2019Q4/www/firefox/Makefile Directory Properties: branches/2019Q4/ (props changed) Modified: branches/2019Q4/mail/thunderbird/Makefile ============================================================================== --- branches/2019Q4/mail/thunderbird/Makefile Fri Dec 27 23:48:43 2019 (r521040) +++ branches/2019Q4/mail/thunderbird/Makefile Fri Dec 27 23:50:42 2019 (r521041) @@ -3,6 +3,7 @@ PORTNAME= thunderbird DISTVERSION= 68.3.1 +PORTREVISION= 1 CATEGORIES= mail news net-im MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source Copied: branches/2019Q4/mail/thunderbird/files/patch-cubeb-sndio (from r521037, head/mail/thunderbird/files/patch-cubeb-sndio) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2019Q4/mail/thunderbird/files/patch-cubeb-sndio Fri Dec 27 23:50:42 2019 (r521041, copy of r521037, head/mail/thunderbird/files/patch-cubeb-sndio) @@ -0,0 +1,113 @@ +https://github.com/kinetiknz/cubeb/commit/a71f116501fe39962599c435ef65066f7e7ea9f5 +https://github.com/kinetiknz/cubeb/commit/3025cbec70f3ed097ec9a2f33a4823316a29efc4 +https://github.com/kinetiknz/cubeb/commit/bb2735fa2ff680fdc615edbb363b19ff4a759503 +https://github.com/kinetiknz/cubeb/pull/564 + +diff --git a/src/cubeb_sndio.c b/src/cubeb_sndio.c +index 4a05bd84..34b3513d 100644 +--- media/libcubeb/src/cubeb_sndio.c ++++ media/libcubeb/src/cubeb_sndio.c +@@ -32,6 +32,7 @@ + X(sio_eof) \ + X(sio_getpar) \ + X(sio_initpar) \ ++ X(sio_nfds) \ + X(sio_onmove) \ + X(sio_open) \ + X(sio_pollfd) \ +@@ -124,6 +125,23 @@ s16_to_float(void *ptr, long nsamp) + *(--dst) = (1. / 32768) * *(--src); + } + ++static const char * ++sndio_get_device() ++{ ++#ifdef __linux__ ++ /* ++ * On other platforms default to sndio devices, ++ * so cubebs other backends can be used instead. ++ */ ++ const char *dev = getenv("AUDIODEVICE"); ++ if (dev == NULL || *dev == '\0') ++ return "snd/0"; ++ return dev; ++#else ++ return SIO_DEVANY; ++#endif ++} ++ + static void + sndio_onmove(void *arg, int delta) + { +@@ -135,18 +153,23 @@ sndio_onmove(void *arg, int delta) + static void * + sndio_mainloop(void *arg) + { +-#define MAXFDS 8 +- struct pollfd pfds[MAXFDS]; ++ struct pollfd *pfds; + cubeb_stream *s = arg; + int n, eof = 0, prime, nfds, events, revents, state = CUBEB_STATE_STARTED; + size_t pstart = 0, pend = 0, rstart = 0, rend = 0; + long nfr; + ++ nfds = WRAP(sio_nfds)(s->hdl); ++ pfds = calloc(nfds, sizeof (struct pollfd)); ++ if (pfds == NULL) ++ return NULL; ++ + DPR("sndio_mainloop()\n"); + s->state_cb(s, s->arg, CUBEB_STATE_STARTED); + pthread_mutex_lock(&s->mtx); + if (!WRAP(sio_start)(s->hdl)) { + pthread_mutex_unlock(&s->mtx); ++ free(pfds); + return NULL; + } + DPR("sndio_mainloop(), started\n"); +@@ -274,6 +297,7 @@ sndio_mainloop(void *arg) + s->hwpos = s->swpos; + pthread_mutex_unlock(&s->mtx); + s->state_cb(s, s->arg, state); ++ free(pfds); + return NULL; + } + +@@ -281,6 +305,9 @@ sndio_mainloop(void *arg) + sndio_init(cubeb **context, char const *context_name) + { + void * libsndio = NULL; ++ struct sio_hdl *hdl; ++ ++ assert(context); + + #ifndef DISABLE_LIBSNDIO_DLOPEN + libsndio = dlopen("libsndio.so.7.0", RTLD_LAZY); +@@ -305,8 +332,17 @@ sndio_init(cubeb **context, char const *context_name) + #undef LOAD + #endif + ++ /* test if sndio works */ ++ hdl = WRAP(sio_open)(sndio_get_device(), SIO_PLAY, 1); ++ if (hdl == NULL) { ++ return CUBEB_ERROR; ++ } ++ WRAP(sio_close)(hdl); ++ + DPR("sndio_init(%s)\n", context_name); +- *context = malloc(sizeof(*context)); ++ *context = malloc(sizeof(**context)); ++ if (*context == NULL) ++ return CUBEB_ERROR; + (*context)->libsndio = libsndio; + (*context)->ops = &sndio_ops; + (void)context_name; +@@ -377,7 +413,7 @@ sndio_stream_init(cubeb * context, + goto err; + } + s->context = context; +- s->hdl = WRAP(sio_open)(NULL, s->mode, 1); ++ s->hdl = WRAP(sio_open)(sndio_get_device(), s->mode, 1); + if (s->hdl == NULL) { + DPR("sndio_stream_init(), sio_open() failed\n"); + goto err; Modified: branches/2019Q4/www/firefox-esr/Makefile ============================================================================== --- branches/2019Q4/www/firefox-esr/Makefile Fri Dec 27 23:48:43 2019 (r521040) +++ branches/2019Q4/www/firefox-esr/Makefile Fri Dec 27 23:50:42 2019 (r521041) @@ -3,6 +3,7 @@ PORTNAME= firefox DISTVERSION= 68.3.0 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= www ipv6 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}esr/source \ Copied: branches/2019Q4/www/firefox-esr/files/patch-cubeb-sndio (from r521037, head/www/firefox-esr/files/patch-cubeb-sndio) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2019Q4/www/firefox-esr/files/patch-cubeb-sndio Fri Dec 27 23:50:42 2019 (r521041, copy of r521037, head/www/firefox-esr/files/patch-cubeb-sndio) @@ -0,0 +1,113 @@ +https://github.com/kinetiknz/cubeb/commit/a71f116501fe39962599c435ef65066f7e7ea9f5 +https://github.com/kinetiknz/cubeb/commit/3025cbec70f3ed097ec9a2f33a4823316a29efc4 +https://github.com/kinetiknz/cubeb/commit/bb2735fa2ff680fdc615edbb363b19ff4a759503 +https://github.com/kinetiknz/cubeb/pull/564 + +diff --git a/src/cubeb_sndio.c b/src/cubeb_sndio.c +index 4a05bd84..34b3513d 100644 +--- media/libcubeb/src/cubeb_sndio.c ++++ media/libcubeb/src/cubeb_sndio.c +@@ -32,6 +32,7 @@ + X(sio_eof) \ + X(sio_getpar) \ + X(sio_initpar) \ ++ X(sio_nfds) \ + X(sio_onmove) \ + X(sio_open) \ + X(sio_pollfd) \ +@@ -124,6 +125,23 @@ s16_to_float(void *ptr, long nsamp) + *(--dst) = (1. / 32768) * *(--src); + } + ++static const char * ++sndio_get_device() ++{ ++#ifdef __linux__ ++ /* ++ * On other platforms default to sndio devices, ++ * so cubebs other backends can be used instead. ++ */ ++ const char *dev = getenv("AUDIODEVICE"); ++ if (dev == NULL || *dev == '\0') ++ return "snd/0"; ++ return dev; ++#else ++ return SIO_DEVANY; ++#endif ++} ++ + static void + sndio_onmove(void *arg, int delta) + { +@@ -135,18 +153,23 @@ sndio_onmove(void *arg, int delta) + static void * + sndio_mainloop(void *arg) + { +-#define MAXFDS 8 +- struct pollfd pfds[MAXFDS]; ++ struct pollfd *pfds; + cubeb_stream *s = arg; + int n, eof = 0, prime, nfds, events, revents, state = CUBEB_STATE_STARTED; + size_t pstart = 0, pend = 0, rstart = 0, rend = 0; + long nfr; + ++ nfds = WRAP(sio_nfds)(s->hdl); ++ pfds = calloc(nfds, sizeof (struct pollfd)); ++ if (pfds == NULL) ++ return NULL; ++ + DPR("sndio_mainloop()\n"); + s->state_cb(s, s->arg, CUBEB_STATE_STARTED); + pthread_mutex_lock(&s->mtx); + if (!WRAP(sio_start)(s->hdl)) { + pthread_mutex_unlock(&s->mtx); ++ free(pfds); + return NULL; + } + DPR("sndio_mainloop(), started\n"); +@@ -274,6 +297,7 @@ sndio_mainloop(void *arg) + s->hwpos = s->swpos; + pthread_mutex_unlock(&s->mtx); + s->state_cb(s, s->arg, state); ++ free(pfds); + return NULL; + } + +@@ -281,6 +305,9 @@ sndio_mainloop(void *arg) + sndio_init(cubeb **context, char const *context_name) + { + void * libsndio = NULL; ++ struct sio_hdl *hdl; ++ ++ assert(context); + + #ifndef DISABLE_LIBSNDIO_DLOPEN + libsndio = dlopen("libsndio.so.7.0", RTLD_LAZY); +@@ -305,8 +332,17 @@ sndio_init(cubeb **context, char const *context_name) + #undef LOAD + #endif + ++ /* test if sndio works */ ++ hdl = WRAP(sio_open)(sndio_get_device(), SIO_PLAY, 1); ++ if (hdl == NULL) { ++ return CUBEB_ERROR; ++ } ++ WRAP(sio_close)(hdl); ++ + DPR("sndio_init(%s)\n", context_name); +- *context = malloc(sizeof(*context)); ++ *context = malloc(sizeof(**context)); ++ if (*context == NULL) ++ return CUBEB_ERROR; + (*context)->libsndio = libsndio; + (*context)->ops = &sndio_ops; + (void)context_name; +@@ -377,7 +413,7 @@ sndio_stream_init(cubeb * context, + goto err; + } + s->context = context; +- s->hdl = WRAP(sio_open)(NULL, s->mode, 1); ++ s->hdl = WRAP(sio_open)(sndio_get_device(), s->mode, 1); + if (s->hdl == NULL) { + DPR("sndio_stream_init(), sio_open() failed\n"); + goto err; Modified: branches/2019Q4/www/firefox/Makefile ============================================================================== --- branches/2019Q4/www/firefox/Makefile Fri Dec 27 23:48:43 2019 (r521040) +++ branches/2019Q4/www/firefox/Makefile Fri Dec 27 23:50:42 2019 (r521041) @@ -3,7 +3,7 @@ PORTNAME= firefox DISTVERSION= 71.0 -PORTREVISION= 2 +PORTREVISION= 3 PORTEPOCH= 1 CATEGORIES= www ipv6 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ Copied: branches/2019Q4/www/firefox/files/patch-cubeb-sndio (from r521037, head/www/firefox/files/patch-cubeb-sndio) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2019Q4/www/firefox/files/patch-cubeb-sndio Fri Dec 27 23:50:42 2019 (r521041, copy of r521037, head/www/firefox/files/patch-cubeb-sndio) @@ -0,0 +1,113 @@ +https://github.com/kinetiknz/cubeb/commit/a71f116501fe39962599c435ef65066f7e7ea9f5 +https://github.com/kinetiknz/cubeb/commit/3025cbec70f3ed097ec9a2f33a4823316a29efc4 +https://github.com/kinetiknz/cubeb/commit/bb2735fa2ff680fdc615edbb363b19ff4a759503 +https://github.com/kinetiknz/cubeb/pull/564 + +diff --git a/src/cubeb_sndio.c b/src/cubeb_sndio.c +index 4a05bd84..34b3513d 100644 +--- media/libcubeb/src/cubeb_sndio.c ++++ media/libcubeb/src/cubeb_sndio.c +@@ -32,6 +32,7 @@ + X(sio_eof) \ + X(sio_getpar) \ + X(sio_initpar) \ ++ X(sio_nfds) \ + X(sio_onmove) \ + X(sio_open) \ + X(sio_pollfd) \ +@@ -124,6 +125,23 @@ s16_to_float(void *ptr, long nsamp) + *(--dst) = (1. / 32768) * *(--src); + } + ++static const char * ++sndio_get_device() ++{ ++#ifdef __linux__ ++ /* ++ * On other platforms default to sndio devices, ++ * so cubebs other backends can be used instead. ++ */ ++ const char *dev = getenv("AUDIODEVICE"); ++ if (dev == NULL || *dev == '\0') ++ return "snd/0"; ++ return dev; ++#else ++ return SIO_DEVANY; ++#endif ++} ++ + static void + sndio_onmove(void *arg, int delta) + { +@@ -135,18 +153,23 @@ sndio_onmove(void *arg, int delta) + static void * + sndio_mainloop(void *arg) + { +-#define MAXFDS 8 +- struct pollfd pfds[MAXFDS]; ++ struct pollfd *pfds; + cubeb_stream *s = arg; + int n, eof = 0, prime, nfds, events, revents, state = CUBEB_STATE_STARTED; + size_t pstart = 0, pend = 0, rstart = 0, rend = 0; + long nfr; + ++ nfds = WRAP(sio_nfds)(s->hdl); ++ pfds = calloc(nfds, sizeof (struct pollfd)); ++ if (pfds == NULL) ++ return NULL; ++ + DPR("sndio_mainloop()\n"); + s->state_cb(s, s->arg, CUBEB_STATE_STARTED); + pthread_mutex_lock(&s->mtx); + if (!WRAP(sio_start)(s->hdl)) { + pthread_mutex_unlock(&s->mtx); ++ free(pfds); + return NULL; + } + DPR("sndio_mainloop(), started\n"); +@@ -274,6 +297,7 @@ sndio_mainloop(void *arg) + s->hwpos = s->swpos; + pthread_mutex_unlock(&s->mtx); + s->state_cb(s, s->arg, state); ++ free(pfds); + return NULL; + } + +@@ -281,6 +305,9 @@ sndio_mainloop(void *arg) + sndio_init(cubeb **context, char const *context_name) + { + void * libsndio = NULL; ++ struct sio_hdl *hdl; ++ ++ assert(context); + + #ifndef DISABLE_LIBSNDIO_DLOPEN + libsndio = dlopen("libsndio.so.7.0", RTLD_LAZY); +@@ -305,8 +332,17 @@ sndio_init(cubeb **context, char const *context_name) + #undef LOAD + #endif + ++ /* test if sndio works */ ++ hdl = WRAP(sio_open)(sndio_get_device(), SIO_PLAY, 1); ++ if (hdl == NULL) { ++ return CUBEB_ERROR; ++ } ++ WRAP(sio_close)(hdl); ++ + DPR("sndio_init(%s)\n", context_name); +- *context = malloc(sizeof(*context)); ++ *context = malloc(sizeof(**context)); ++ if (*context == NULL) ++ return CUBEB_ERROR; + (*context)->libsndio = libsndio; + (*context)->ops = &sndio_ops; + (void)context_name; +@@ -377,7 +413,7 @@ sndio_stream_init(cubeb * context, + goto err; + } + s->context = context; +- s->hdl = WRAP(sio_open)(NULL, s->mode, 1); ++ s->hdl = WRAP(sio_open)(sndio_get_device(), s->mode, 1); + if (s->hdl == NULL) { + DPR("sndio_stream_init(), sio_open() failed\n"); + goto err;