pkgsrc-Changes archive

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

CVS commit: pkgsrc/mail/thunderbird



Module Name:    pkgsrc
Committed By:   kamil
Date:           Sat Feb  8 22:36:24 UTC 2020

Modified Files:
        pkgsrc/mail/thunderbird: Makefile distinfo
Added Files:
        pkgsrc/mail/thunderbird/patches:
            patch-nsprpub_pr_src_pthreads_ptsynch.c

Log Message:
thunderbird: 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.239 -r1.240 pkgsrc/mail/thunderbird/Makefile
cvs rdiff -u -r1.221 -r1.222 pkgsrc/mail/thunderbird/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/mail/thunderbird/patches/patch-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/thunderbird/Makefile
diff -u pkgsrc/mail/thunderbird/Makefile:1.239 pkgsrc/mail/thunderbird/Makefile:1.240
--- pkgsrc/mail/thunderbird/Makefile:1.239      Wed Feb  5 14:29:56 2020
+++ pkgsrc/mail/thunderbird/Makefile    Sat Feb  8 22:36:24 2020
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.239 2020/02/05 14:29:56 ryoon Exp $
+# $NetBSD: Makefile,v 1.240 2020/02/08 22:36:24 kamil Exp $
 
 DISTNAME=      thunderbird-${TB_VER}.source
 PKGNAME=       thunderbird-${TB_VER}
+PKGREVISION=   1
 TB_VER=                68.4.2
 CATEGORIES=    mail
 MASTER_SITES=  ${MASTER_SITE_MOZILLA:=thunderbird/releases/${TB_VER}/source/}

Index: pkgsrc/mail/thunderbird/distinfo
diff -u pkgsrc/mail/thunderbird/distinfo:1.221 pkgsrc/mail/thunderbird/distinfo:1.222
--- pkgsrc/mail/thunderbird/distinfo:1.221      Wed Feb  5 14:29:56 2020
+++ pkgsrc/mail/thunderbird/distinfo    Sat Feb  8 22:36:24 2020
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.221 2020/02/05 14:29:56 ryoon Exp $
+$NetBSD: distinfo,v 1.222 2020/02/08 22:36:24 kamil Exp $
 
 SHA1 (thunderbird-68.4.2.source.tar.xz) = 699b9b7d9d02542e4a7eca2a145e300ad316223d
 RMD160 (thunderbird-68.4.2.source.tar.xz) = c26a9f61932dc8d596944b4aacb65e10782c7d00
@@ -30,6 +30,7 @@ SHA1 (patch-media_libcubeb_src_cubeb__os
 SHA1 (patch-media_libcubeb_src_moz.build) = fd3b036b3ba4105949c6b0f46bf72c89184e777d
 SHA1 (patch-media_libcubeb_update.sh) = f8d0f674987519a1a1738be158e8cd4296f6def0
 SHA1 (patch-media_libpng_pngpriv.h) = dfd4d345e10f6f74d3a3546732a868481c1d5818
+SHA1 (patch-nsprpub_pr_src_pthreads_ptsynch.c) = cd0639f97f2135980bc3036cc858ac061107bc75
 SHA1 (patch-old-configure.in) = 24c2f64250160c9e4c4cdc3b5ff2e6d33a5d6aad
 SHA1 (patch-toolkit_components_terminator_nsTerminator.cpp) = cd4d65d6e6358b5b77b6b63441a8550f2d1e97c7
 SHA1 (patch-toolkit_library_moz.build) = 429745ec028ce71d8ba2457679b715ac14b6e2d3

Added files:

Index: pkgsrc/mail/thunderbird/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c
diff -u /dev/null pkgsrc/mail/thunderbird/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c:1.1
--- /dev/null   Sat Feb  8 22:36:24 2020
+++ pkgsrc/mail/thunderbird/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c     Sat Feb  8 22:36:24 2020
@@ -0,0 +1,106 @@
+$NetBSD: patch-nsprpub_pr_src_pthreads_ptsynch.c,v 1.1 2020/02/08 22:36:24 kamil Exp $
+
+Workaround buggy usage of pthread_equal().
+
+--- nsprpub/pr/src/pthreads/ptsynch.c.orig     2020-01-09 03:29:25.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