pkgsrc-Changes archive

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

CVS commit: pkgsrc/mail/thunderbird52



Module Name:    pkgsrc
Committed By:   kamil
Date:           Sat Feb  8 22:20:26 UTC 2020

Modified Files:
        pkgsrc/mail/thunderbird52: Makefile distinfo
Added Files:
        pkgsrc/mail/thunderbird52/patches:
            patch-mozilla_nsprpub_pr_src_pthreads_ptsynch.c

Log Message:
thunderbird52: Workaround broken pthread_equal() usage

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

Problems detected on NetBSD 9.99.46.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 pkgsrc/mail/thunderbird52/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/mail/thunderbird52/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/mail/thunderbird52/patches/patch-mozilla_nsprpub_pr_src_pthreads_ptsynch.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mail/thunderbird52/Makefile
diff -u pkgsrc/mail/thunderbird52/Makefile:1.7 pkgsrc/mail/thunderbird52/Makefile:1.8
--- pkgsrc/mail/thunderbird52/Makefile:1.7      Sat Jan 18 21:49:55 2020
+++ pkgsrc/mail/thunderbird52/Makefile  Sat Feb  8 22:20:26 2020
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.7 2020/01/18 21:49:55 jperkin Exp $
+# $NetBSD: Makefile,v 1.8 2020/02/08 22:20:26 kamil Exp $
 
 DISTNAME=      thunderbird-${TB_VER}.source
 PKGNAME=       thunderbird${TB_VER:C/\..*$//}-${TB_VER}
-PKGREVISION=   6
+PKGREVISION=   7
 TB_VER=                52.9.1
 CATEGORIES=    mail
 MASTER_SITES=  ${MASTER_SITE_MOZILLA:=thunderbird/releases/${TB_VER}/source/}

Index: pkgsrc/mail/thunderbird52/distinfo
diff -u pkgsrc/mail/thunderbird52/distinfo:1.1 pkgsrc/mail/thunderbird52/distinfo:1.2
--- pkgsrc/mail/thunderbird52/distinfo:1.1      Sun Dec 16 08:29:48 2018
+++ pkgsrc/mail/thunderbird52/distinfo  Sat Feb  8 22:20:26 2020
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.1 2018/12/16 08:29:48 ryoon Exp $
+$NetBSD: distinfo,v 1.2 2020/02/08 22:20:26 kamil Exp $
 
 SHA1 (thunderbird-52.9.1.source.tar.xz) = 9970d78084fe979f568ea00bf06b8e81a738e630
 RMD160 (thunderbird-52.9.1.source.tar.xz) = b3169a0154fa85648a98ba0d74f264abd224b323
@@ -93,6 +93,7 @@ SHA1 (patch-mozilla_modules_libjar_nsZip
 SHA1 (patch-mozilla_mozglue_build_arm.cpp) = fcaf79cb25eef5d36e793d54ce5c1fff188bf951
 SHA1 (patch-mozilla_mozglue_build_arm.h) = 40d8d2039c68fc825857a3c970eec2f296275cc5
 SHA1 (patch-mozilla_netwerk_dns_moz.build) = 4ee9fa2a3b33a0fb9ad4c0f883b084f6417b993f
+SHA1 (patch-mozilla_nsprpub_pr_src_pthreads_ptsynch.c) = 389f94db5adf882d43c5cb601ec00659b460584b
 SHA1 (patch-mozilla_old-configure.in) = 651bc7aed6cea83ae21a1ac8febf13374ae8c854
 SHA1 (patch-mozilla_toolkit_components_osfile_modules_osfile__unix__back.jsm) = ba8e6e427374dbf9f5de695ead6014f560fb305e
 SHA1 (patch-mozilla_toolkit_components_osfile_modules_osfile__unix__front.jsm) = 005ad5608501fdcdeb042715a69ea3073d62fc75

Added files:

Index: pkgsrc/mail/thunderbird52/patches/patch-mozilla_nsprpub_pr_src_pthreads_ptsynch.c
diff -u /dev/null pkgsrc/mail/thunderbird52/patches/patch-mozilla_nsprpub_pr_src_pthreads_ptsynch.c:1.1
--- /dev/null   Sat Feb  8 22:20:26 2020
+++ pkgsrc/mail/thunderbird52/patches/patch-mozilla_nsprpub_pr_src_pthreads_ptsynch.c   Sat Feb  8 22:20:26 2020
@@ -0,0 +1,106 @@
+$NetBSD: patch-mozilla_nsprpub_pr_src_pthreads_ptsynch.c,v 1.1 2020/02/08 22:20:26 kamil Exp $
+
+Workaround buggy usage of pthread_equal().
+
+--- mozilla/nsprpub/pr/src/pthreads/ptsynch.c.orig     2018-07-09 19:54:54.000000000 +0000
++++ mozilla/nsprpub/pr/src/pthreads/ptsynch.c
+@@ -30,6 +30,13 @@ static pthread_t pt_zero_tid;  /* a null
+ #endif  /* defined(_PR_DCETHREADS) */
+ #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.
+@@ -198,9 +205,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;
+@@ -223,7 +230,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()));
+ }
+ 
+ /**************************************************************/
+@@ -284,7 +291,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)
+@@ -367,7 +374,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;
+ 
+@@ -565,7 +572,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);
+@@ -580,7 +587,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
+@@ -596,7 +603,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)
+         {
+@@ -627,8 +634,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);
+@@ -675,7 +682,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