pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/firefox60 firefox60: Workaround broken pthread_equ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fef5d5a055b2
branches:  trunk
changeset: 423012:fef5d5a055b2
user:      kamil <kamil%pkgsrc.org@localhost>
date:      Sat Feb 08 21:54:30 2020 +0000

description:
firefox60: Workaround broken pthread_equal() usage

Switch to an internal version of pthread_equal() without sanity checks.

Problems detected on NetBSD 9.99.46.

diffstat:

 www/firefox60/Makefile                                        |    4 +-
 www/firefox60/distinfo                                        |    4 +-
 www/firefox60/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c |  106 ++++++++++
 3 files changed, 111 insertions(+), 3 deletions(-)

diffs (149 lines):

diff -r 2ba131028f1b -r fef5d5a055b2 www/firefox60/Makefile
--- a/www/firefox60/Makefile    Sat Feb 08 21:47:42 2020 +0000
+++ b/www/firefox60/Makefile    Sat Feb 08 21:54:30 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.37 2020/01/18 21:51:06 jperkin Exp $
+# $NetBSD: Makefile,v 1.38 2020/02/08 21:54:30 kamil Exp $
 
 FIREFOX_VER=           ${MOZ_BRANCH}${MOZ_BRANCH_MINOR}
 MOZ_BRANCH=            60.9
@@ -6,7 +6,7 @@
 
 DISTNAME=      firefox-${FIREFOX_VER}.source
 PKGNAME=       firefox${MOZ_BRANCH:C/\..*$//}-${MOZ_BRANCH}${MOZ_BRANCH_MINOR:S/b/beta/:S/esr//}
-PKGREVISION=   2
+PKGREVISION=   3
 CATEGORIES=    www
 MASTER_SITES+= ${MASTER_SITE_MOZILLA:=firefox/releases/${FIREFOX_VER}/source/}
 EXTRACT_SUFX=  .tar.xz
diff -r 2ba131028f1b -r fef5d5a055b2 www/firefox60/distinfo
--- a/www/firefox60/distinfo    Sat Feb 08 21:47:42 2020 +0000
+++ b/www/firefox60/distinfo    Sat Feb 08 21:54:30 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.20 2020/01/05 02:18:53 ryoon Exp $
+$NetBSD: distinfo,v 1.21 2020/02/08 21:54:30 kamil Exp $
 
 SHA1 (firefox-60.9.0esr.source.tar.xz) = 616f8afdee741f0bea607a671b8515ef13c68b4a
 RMD160 (firefox-60.9.0esr.source.tar.xz) = f3ef7629ab28960fb383d3fb12dab69feb0f45ee
@@ -33,9 +33,11 @@
 SHA1 (patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc) = 0141dd1372c13ea1fce6e2f5ffb65e0cb0f3a13e
 SHA1 (patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_video__capture__linux.cc) = a69bc7b7096b410582e725f9dbec57fee90d6686
 SHA1 (patch-modules_pdfium_update.sh) = b0bf091325c9322c54880de067871354cd689038
+SHA1 (patch-nsprpub_pr_src_pthreads_ptsynch.c) = 49c1cd3b70e707fccec695f87bf00bf8749ba7f4
 SHA1 (patch-servo_components_style__traits_lib.rs) = b07dfc91bae3f94b7da0c5dab523a6901b9b1bf7
 SHA1 (patch-servo_components_style_build__gecko.rs) = fca2260a70b496fc010f165ff4d68788b7e28632
 SHA1 (patch-servo_components_style_lib.rs) = 1df2f6580da3c4a2fadd7ddcead000fa3c8a6a14
+SHA1 (patch-third__party_rust_cssparser_.cargo-checksum.json) = d968afb9e9b4843737c9e9bf78aa4c513b730911
 SHA1 (patch-third__party_rust_cssparser_src_parser.rs) = 97d89ca616271dea3dd564b1e96f0087c21e8be0
 SHA1 (patch-third__party_rust_url_src_form__urlencoded.rs) = 803c9501d2aec0ad1588cd05d625f679581841f6
 SHA1 (patch-third__party_rust_url_src_lib.rs) = 97730d2d9a1b6e3b42687da4cdb04b4ac1bd903b
diff -r 2ba131028f1b -r fef5d5a055b2 www/firefox60/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/firefox60/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c     Sat Feb 08 21:54:30 2020 +0000
@@ -0,0 +1,106 @@
+$NetBSD: patch-nsprpub_pr_src_pthreads_ptsynch.c,v 1.1 2020/02/08 21:54:30 kamil Exp $
+
+Workaround buggy usage of pthread_equal().
+
+--- nsprpub/pr/src/pthreads/ptsynch.c.orig     2019-09-01 13:09:51.000000000 +0000
++++ nsprpub/pr/src/pthreads/ptsynch.c
+@@ -25,6 +25,13 @@ static pthread_condattr_t _pt_cvar_attr;
+ extern PTDebug pt_debug;  /* this is shared between several modules */
+ #endif  /* defined(DEBUG) */
+ 
++/* XXX, pthread_equal() is misused to compare non-valid thread pointers */
++static int
++pt_pthread_equal(pthread_t t1, pthread_t t2)
++{
++      return t1 == t2;
++}
++
+ #if defined(FREEBSD)
+ /*
+  * On older versions of FreeBSD, pthread_mutex_trylock returns EDEADLK.
+@@ -192,9 +199,9 @@ PR_IMPLEMENT(PRStatus) PR_Unlock(PRLock 
+     PR_ASSERT(lock != NULL);
+     PR_ASSERT(_PT_PTHREAD_MUTEX_IS_LOCKED(lock->mutex));
+     PR_ASSERT(PR_TRUE == lock->locked);
+-    PR_ASSERT(pthread_equal(lock->owner, self));
++    PR_ASSERT(pt_pthread_equal(lock->owner, self));
+ 
+-    if (!lock->locked || !pthread_equal(lock->owner, self))
++    if (!lock->locked || !pt_pthread_equal(lock->owner, self))
+         return PR_FAILURE;
+ 
+     lock->locked = PR_FALSE;
+@@ -217,7 +224,7 @@ PR_IMPLEMENT(void) PR_AssertCurrentThrea
+      * to the correctness of PR_AssertCurrentThreadOwnsLock(), but 
+      * this particular order makes the assertion more likely to
+      * catch errors. */
+-    PR_ASSERT(lock->locked && pthread_equal(lock->owner, pthread_self()));
++    PR_ASSERT(lock->locked && pt_pthread_equal(lock->owner, pthread_self()));
+ }
+ 
+ /**************************************************************/
+@@ -273,7 +280,7 @@ static void pt_PostNotifyToCvar(PRCondVa
+     _PT_Notified *notified = &cvar->lock->notified;
+ 
+     PR_ASSERT(PR_TRUE == cvar->lock->locked);
+-    PR_ASSERT(pthread_equal(cvar->lock->owner, pthread_self()));
++    PR_ASSERT(pt_pthread_equal(cvar->lock->owner, pthread_self()));
+     PR_ASSERT(_PT_PTHREAD_MUTEX_IS_LOCKED(cvar->lock->mutex));
+ 
+     while (1)
+@@ -356,7 +363,7 @@ PR_IMPLEMENT(PRStatus) PR_WaitCondVar(PR
+     PR_ASSERT(_PT_PTHREAD_MUTEX_IS_LOCKED(cvar->lock->mutex));
+     PR_ASSERT(PR_TRUE == cvar->lock->locked);
+     /* and it better be by us */
+-    PR_ASSERT(pthread_equal(cvar->lock->owner, pthread_self()));
++    PR_ASSERT(pt_pthread_equal(cvar->lock->owner, pthread_self()));
+ 
+     if (_PT_THREAD_INTERRUPTED(thred)) goto aborted;
+ 
+@@ -554,7 +561,7 @@ PR_IMPLEMENT(PRIntn) PR_GetMonitorEntryC
+ 
+     rv = pthread_mutex_lock(&mon->lock);
+     PR_ASSERT(0 == rv);
+-    if (pthread_equal(mon->owner, self))
++    if (pt_pthread_equal(mon->owner, self))
+         count = mon->entryCount;
+     rv = pthread_mutex_unlock(&mon->lock);
+     PR_ASSERT(0 == rv);
+@@ -569,7 +576,7 @@ PR_IMPLEMENT(void) PR_AssertCurrentThrea
+     rv = pthread_mutex_lock(&mon->lock);
+     PR_ASSERT(0 == rv);
+     PR_ASSERT(mon->entryCount != 0 &&
+-              pthread_equal(mon->owner, pthread_self()));
++              pt_pthread_equal(mon->owner, pthread_self()));
+     rv = pthread_mutex_unlock(&mon->lock);
+     PR_ASSERT(0 == rv);
+ #endif
+@@ -585,7 +592,7 @@ PR_IMPLEMENT(void) PR_EnterMonitor(PRMon
+     PR_ASSERT(0 == rv);
+     if (mon->entryCount != 0)
+     {
+-        if (pthread_equal(mon->owner, self))
++        if (pt_pthread_equal(mon->owner, self))
+             goto done;
+         while (mon->entryCount != 0)
+         {
+@@ -616,8 +623,8 @@ PR_IMPLEMENT(PRStatus) PR_ExitMonitor(PR
+     PR_ASSERT(0 == rv);
+     /* the entries should be > 0 and we'd better be the owner */
+     PR_ASSERT(mon->entryCount > 0);
+-    PR_ASSERT(pthread_equal(mon->owner, self));
+-    if (mon->entryCount == 0 || !pthread_equal(mon->owner, self))
++    PR_ASSERT(pt_pthread_equal(mon->owner, self));
++    if (mon->entryCount == 0 || !pt_pthread_equal(mon->owner, self))
+     {
+         rv = pthread_mutex_unlock(&mon->lock);
+         PR_ASSERT(0 == rv);
+@@ -664,7 +671,7 @@ PR_IMPLEMENT(PRStatus) PR_Wait(PRMonitor
+     /* the entries better be positive */
+     PR_ASSERT(mon->entryCount > 0);
+     /* and it better be owned by us */
+-    PR_ASSERT(pthread_equal(mon->owner, pthread_self()));
++    PR_ASSERT(pt_pthread_equal(mon->owner, pthread_self()));
+ 
+     /* tuck these away 'till later */
+     saved_entries = mon->entryCount; 



Home | Main Index | Thread Index | Old Index