Compare commits

...

No commits in common. 'c9' and 'i8c' have entirely different histories.
c9 ... i8c

2
.gitignore vendored

@ -1 +1 @@
SOURCES/threads-shared-1.59.tar.gz SOURCES/threads-shared-1.58.tar.gz

@ -1 +1 @@
ae80152e37290e7a85890d0180f964cb5a01f4c1 SOURCES/threads-shared-1.59.tar.gz f3ce7a3b5086eb614aee3aa13607fdd2ec8b86b4 SOURCES/threads-shared-1.58.tar.gz

@ -1,110 +0,0 @@
From 2ec58402d05eb12d0b9387963941f1e445d9aa5b Mon Sep 17 00:00:00 2001
From: Jitka Plesnikova <jplesnik@redhat.com>
Date: Fri, 26 Apr 2019 15:00:30 +0200
Subject: [PATCH] Upgrade to 1.60
---
lib/threads/shared.pm | 4 ++--
shared.xs | 39 +++++++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/lib/threads/shared.pm b/lib/threads/shared.pm
index f7e5ff8..45ad154 100644
--- a/lib/threads/shared.pm
+++ b/lib/threads/shared.pm
@@ -8,7 +8,7 @@ use Config;
use Scalar::Util qw(reftype refaddr blessed);
-our $VERSION = '1.59'; # Please update the pod, too.
+our $VERSION = '1.60'; # Please update the pod, too.
my $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@@ -196,7 +196,7 @@ threads::shared - Perl extension for sharing data structures between threads
=head1 VERSION
-This document describes threads::shared version 1.59
+This document describes threads::shared version 1.60
=head1 SYNOPSIS
diff --git a/shared.xs b/shared.xs
index d0f7d1e..6cdf094 100644
--- a/shared.xs
+++ b/shared.xs
@@ -115,6 +115,17 @@
* without the prefix (e.g., sv, tmp or obj).
*/
+/* this is lower overhead than warn() and less likely to interfere
+ with other parts of perl (like with the debugger.)
+*/
+#ifdef SHARED_TRACE_LOCKS
+# define TRACE_LOCK(x) DEBUG_U(x)
+# define TRACE_LOCKv(x) DEBUG_Uv(x)
+#else
+# define TRACE_LOCK(x)
+# define TRACE_LOCKv(x)
+#endif
+
#define PERL_NO_GET_CONTEXT
#include "EXTERN.h"
#include "perl.h"
@@ -211,8 +222,24 @@ recursive_lock_release(pTHX_ recursive_lock_t *lock)
if (--lock->locks == 0) {
lock->owner = NULL;
COND_SIGNAL(&lock->cond);
+ TRACE_LOCK(
+ PerlIO_printf(Perl_debug_log, "shared lock released %p for %p at %s:%d\n",
+ lock, aTHX, CopFILE(PL_curcop), CopLINE(PL_curcop))
+ );
+ }
+ else {
+ TRACE_LOCKv(
+ PerlIO_printf(Perl_debug_log, "shared lock unbump %p for %p at %s:%d\n",
+ lock, aTHX, CopFILE(PL_curcop), CopLINE(PL_curcop))
+ );
}
}
+ else {
+ TRACE_LOCK(
+ PerlIO_printf(Perl_debug_log, "bad shared lock release %p for %p (owned by %p) at %s:%d\n",
+ lock, aTHX, lock->owner, CopFILE(PL_curcop), CopLINE(PL_curcop))
+ );
+ }
MUTEX_UNLOCK(&lock->mutex);
}
@@ -224,8 +251,16 @@ recursive_lock_acquire(pTHX_ recursive_lock_t *lock, const char *file, int line)
assert(aTHX);
MUTEX_LOCK(&lock->mutex);
if (lock->owner == aTHX) {
+ TRACE_LOCKv(
+ PerlIO_printf(Perl_debug_log, "shared lock bump %p (%p) at %s:%d\n",
+ lock, lock->owner, CopFILE(PL_curcop), CopLINE(PL_curcop))
+ );
lock->locks++;
} else {
+ TRACE_LOCK(
+ PerlIO_printf(Perl_debug_log, "shared lock try %p for %p (owned by %p) at %s:%d\n",
+ lock, aTHX, lock->owner, CopFILE(PL_curcop), CopLINE(PL_curcop))
+ );
while (lock->owner) {
#ifdef DEBUG_LOCKS
Perl_warn(aTHX_ " %p waiting - owned by %p %s:%d\n",
@@ -233,6 +268,10 @@ recursive_lock_acquire(pTHX_ recursive_lock_t *lock, const char *file, int line)
#endif
COND_WAIT(&lock->cond,&lock->mutex);
}
+ TRACE_LOCK(
+ PerlIO_printf(Perl_debug_log, "shared lock got %p at %s:%d\n",
+ lock, CopFILE(PL_curcop), CopLINE(PL_curcop))
+ );
lock->locks = 1;
lock->owner = aTHX;
#ifdef DEBUG_LOCKS
--
2.20.1

@ -1,57 +0,0 @@
From c48ee9c79eb7c4a36b7758fc4c3209ca0e5d759b Mon Sep 17 00:00:00 2001
From: Jitka Plesnikova <jplesnik@redhat.com>
Date: Tue, 21 Apr 2020 12:52:31 +0200
Subject: [PATCH] Upgrade to 1.61
---
lib/threads/shared.pm | 4 ++--
t/stress.t | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/threads/shared.pm b/lib/threads/shared.pm
index 45ad154..bd0e437 100644
--- a/lib/threads/shared.pm
+++ b/lib/threads/shared.pm
@@ -8,7 +8,7 @@ use Config;
use Scalar::Util qw(reftype refaddr blessed);
-our $VERSION = '1.60'; # Please update the pod, too.
+our $VERSION = '1.61'; # Please update the pod, too.
my $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@@ -196,7 +196,7 @@ threads::shared - Perl extension for sharing data structures between threads
=head1 VERSION
-This document describes threads::shared version 1.60
+This document describes threads::shared version 1.61
=head1 SYNOPSIS
diff --git a/t/stress.t b/t/stress.t
index 1dd95e3..ccdeb0e 100644
--- a/t/stress.t
+++ b/t/stress.t
@@ -12,7 +12,7 @@ BEGIN {
exit(0);
}
- # http://lists.alioth.debian.org/pipermail/perl-maintainers/2011-June/002285.html
+ # https://lists.alioth.debian.org/pipermail/perl-maintainers/2011-June/002285.html
# There _is_ TLS support on m68k, but this stress test is overwhelming
# for the hardware
if ($^O eq 'linux' && $Config{archname} =~ /^m68k/) {
@@ -179,7 +179,7 @@ use threads::shared;
} elsif ($timeouts) {
# Frequently fails under MSWin32 due to deadlocking bug in Windows
# hence test is TODO under MSWin32
- # http://rt.perl.org/rt3/Public/Bug/Display.html?id=41574
+ # https://rt.perl.org/rt3/Public/Bug/Display.html?id=41574
# http://support.microsoft.com/kb/175332
if ($^O eq 'MSWin32') {
print("not ok 1 # TODO - not reliable under MSWin32\n")
--
2.21.1

@ -1,57 +0,0 @@
From b52cdd7a8525325deba04554d8a00a578c397d56 Mon Sep 17 00:00:00 2001
From: David Mitchell <davem@iabyn.com>
Date: Thu, 11 Jul 2019 15:17:48 +0100
Subject: [PATCH] threads::shared: fix leak
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When assigning a shared reference value to a variable containing a
shared string, the PV buffer in the shared space was leaked. For
example:
my $s :shared = "foo";
my $t :shared = shared_clone(\"bar");
$s = $t; # "foo" in shared space leaked
This was showing up as failed smokes under ASan.
Petr Písař: Ported to 1.60 from perl commit
59c73bd3d62c5096a6f9b2e3cbe05e1ab4c158cf.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
shared.xs | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/shared.xs b/shared.xs
index 6cdf094..858c6d6 100644
--- a/shared.xs
+++ b/shared.xs
@@ -818,12 +818,19 @@ sharedsv_scalar_store(pTHX_ SV *sv, SV *ssv)
SV *obj = SvRV(sv);
SV *sobj = Perl_sharedsv_find(aTHX_ obj);
if (sobj) {
+ SV* tmpref;
SHARED_CONTEXT;
- (void)SvUPGRADE(ssv, SVt_RV);
- sv_setsv_nomg(ssv, &PL_sv_undef);
+ /* Creating a tmp ref to sobj then assigning it to ssv ensures
+ * that any previous contents of ssv are correctly freed
+ * by sv_setsv(). Not sure if there is a better, API-legal way
+ * to achieve this */
+ tmpref = newSV_type(SVt_RV);
+ SvRV_set(tmpref, sobj);
+ SvROK_on(tmpref);
+ SvREFCNT_inc_simple_NN(sobj);
+ sv_setsv_nomg(ssv, tmpref);
+ SvREFCNT_dec_NN(tmpref);
- SvRV_set(ssv, SvREFCNT_inc(sobj));
- SvROK_on(ssv);
if (SvOBJECT(sobj)) {
/* Remove any old blessing */
SvREFCNT_dec(SvSTASH(sobj));
--
2.20.1

@ -1,19 +1,10 @@
%global base_version 1.59
Name: perl-threads-shared Name: perl-threads-shared
Version: 1.61 Version: 1.58
Release: 460%{?dist} Release: 2%{?dist}
Summary: Perl extension for sharing data structures between threads Summary: Perl extension for sharing data structures between threads
License: GPL+ or Artistic License: GPL+ or Artistic
URL: https://metacpan.org/release/threads-shared URL: http://search.cpan.org/dist/threads-shared/
Source0: https://cpan.metacpan.org/authors/id/J/JD/JDHEDDEN/threads-shared-%{base_version}.tar.gz Source0: http://www.cpan.org/authors/id/J/JD/JDHEDDEN/threads-shared-%{version}.tar.gz
# Unbundled from perl 5.29.10
Patch0: threads-shared-1.59-Upgrade-to-1.60.patch
# Fix a memory leak when assigning a shared reference to a shared string
# variable, in perl after 5.31.1
Patch1: threads-shared-1.60-threads-shared-fix-leak.patch
# Unbundled from perl 5.32.0
Patch2: threads-shared-1.59-Upgrade-to-1.61.patch
BuildRequires: findutils BuildRequires: findutils
BuildRequires: gcc BuildRequires: gcc
BuildRequires: make BuildRequires: make
@ -53,23 +44,18 @@ you to share variables across different threads (and pseudo-forks on
Win32). It is used together with the threads module. Win32). It is used together with the threads module.
%prep %prep
%setup -q -n threads-shared-%{base_version} %setup -q -n threads-shared-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build %build
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_OPT_FLAGS" perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 OPTIMIZE="$RPM_OPT_FLAGS"
%{make_build} make %{?_smp_mflags}
%install %install
%{make_install} make pure_install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete
%{_fixperms} $RPM_BUILD_ROOT/* %{_fixperms} $RPM_BUILD_ROOT/*
%check %check
unset GIT_DIR PERL_BUILD_PACKAGING PERL_CORE PERL_RUNPERL_DEBUG \
RUN_MAINTAINER_TESTS
make test make test
%files %files
@ -79,49 +65,8 @@ make test
%{_mandir}/man3/* %{_mandir}/man3/*
%changelog %changelog
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.61-460 * Wed Jul 26 2023 MSVSphere Packaging Team <packager@msvsphere.ru> - 1.58-2
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags - Rebuilt for MSVSphere 8.8
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.61-459
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.61-458
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.61-457
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jun 22 2020 Jitka Plesnikova <jplesnik@redhat.com> - 1.61-456
- Upgrade to 1.61 as provided in perl-5.32.0
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.60-441
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.60-440
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Jul 12 2019 Petr Pisar <ppisar@redhat.com> - 1.60-439
- Fix a memory leak when assigning a shared reference to a shared string
variable
* Thu May 30 2019 Jitka Plesnikova <jplesnik@redhat.com> - 1.60-438
- Increase release to favour standalone package
* Fri Apr 26 2019 Jitka Plesnikova <jplesnik@redhat.com> - 1.60-1
- Upgrade to 1.60 as provided in perl-5.29.10
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.59-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Nov 30 2018 Petr Pisar <ppisar@redhat.com> - 1.59-1
- 1.59 bump
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.58-417
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Jun 27 2018 Jitka Plesnikova <jplesnik@redhat.com> - 1.58-416
- Increase release to favour standalone package
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.58-2 * Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.58-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

Loading…
Cancel
Save