nspr: Update to 4.25

* Fix runtime error by pthread_equal() misuse.

Changelog:
NSPR 4.25 contains the following changes:
- fixed reading files larger than 4 GB on Win32
- changes to NSPR test tools to allow them to run on our CI
- added support for Xtensa architecture
This commit is contained in:
ryoon 2020-02-05 03:26:52 +00:00
parent 0f2a73b938
commit f6ed9a5f2f
3 changed files with 116 additions and 7 deletions

View file

@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.102 2019/12/04 12:53:18 ryoon Exp $
# $NetBSD: Makefile,v 1.103 2020/02/05 03:26:52 ryoon Exp $
DISTNAME= nspr-${NSPR_RELEASE:S/.0$//}
NSPR_RELEASE= 4.24.0
NSPR_RELEASE= 4.25.0
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_MOZILLA_ALL:=nspr/releases/v${NSPR_RELEASE:S/.0$//}/src/}

View file

@ -1,9 +1,9 @@
$NetBSD: distinfo,v 1.54 2019/12/04 12:53:18 ryoon Exp $
$NetBSD: distinfo,v 1.55 2020/02/05 03:26:52 ryoon Exp $
SHA1 (nspr-4.24.tar.gz) = adc1e76263bfd1da044df52229906363e6fd2f86
RMD160 (nspr-4.24.tar.gz) = ee0abfe8ea5fe9baa6b9f88f48dee8ba1d82bd8a
SHA512 (nspr-4.24.tar.gz) = b020031ed7a8997099c11e0772779c7b10d15b4f6b14e2b1832732943e8b8224afa952ce04a1914c1553af9d3973a6d9cacf08058ee6fff35102e3b2ec0943c1
Size (nspr-4.24.tar.gz) = 1078825 bytes
SHA1 (nspr-4.25.tar.gz) = fe02a9056ce867677401b3d6372cdb62f7c7aad4
RMD160 (nspr-4.25.tar.gz) = 29a3c17c3872478afaa13b4bf4b43b99d92a10a1
SHA512 (nspr-4.25.tar.gz) = b9aa576e0da37e8729088fe559d94030cf18f277c1f7a30104d3088a804913343ed884645c0adb62144da475e20934b359f897bf3ae9a6ebb5f9daf283d5a562
Size (nspr-4.25.tar.gz) = 1079633 bytes
SHA1 (patch-ab) = a24f80c2bab73c12b02d0aad7649da0ce4ca8d4f
SHA1 (patch-ac) = a3d2cef788393b84e833d9e33bdf40b10d8efbd0
SHA1 (patch-ae) = 28474b852325a37fb2a30717e9f7ffb77dad5deb
@ -11,6 +11,7 @@ SHA1 (patch-ag) = 653d4bc8cc4eced8f628cfb738c5d99cc1a6cf24
SHA1 (patch-ba) = 141b354b9ec0423a9c671d5eaca05cf16daac312
SHA1 (patch-nspr_pr_include_md___netbsd.cfg) = c7a652afc962e83cca49f451f6692bbc43644403
SHA1 (patch-nspr_pr_include_md___pth.h) = ef97e3a9c2dbde85a7c36152807217f962d2b4fa
SHA1 (patch-nspr_pr_src_pthreads_ptsynch.c) = 52e0e2bb1d1ddb282f92ce2df2c69684c0634dbe
SHA1 (patch-nspr_pr_src_pthreads_ptthread.c) = 1aaa1048399cc7a82a67b98ea2368033cb597ac6
SHA1 (patch-nsprpub_pr_include_md__dragonfly.cfg) = 54d3fbd4c515290395b66f6b9e736a01a8318244
SHA1 (patch-nsprpub_pr_include_md_prosdep.h) = dd90cda6251aeeb10f02ef594c02484237195155

View file

@ -0,0 +1,108 @@
$NetBSD: patch-nspr_pr_src_pthreads_ptsynch.c,v 1.1 2020/02/05 03:26:52 ryoon Exp $
* Do not use pthread_equal() for non-valid thread pointers.
From kamin@ on source-changes-d@NetBSD.org.
https://mail-index.netbsd.org/source-changes-d/2020/02/03/msg012143.html
--- nspr/pr/src/pthreads/ptsynch.c.orig 2020-01-31 20:37:50.000000000 +0000
+++ nspr/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.
@@ -197,9 +204,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;
}
@@ -225,7 +232,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()));
}
/**************************************************************/
@@ -281,7 +288,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)
@@ -369,7 +376,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;
@@ -582,7 +589,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);
@@ -598,7 +605,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
@@ -614,7 +621,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)
@@ -646,8 +653,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);
@@ -695,7 +702,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;