Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
Petr Písař | cd6fd55c5d | |
Petr Písař | e2a9d13df5 | |
Petr Písař | ca4f4c98ba |
|
@ -14,3 +14,5 @@
|
|||
/threads-shared-1.52.tar.gz
|
||||
/threads-shared-1.54.tar.gz
|
||||
/threads-shared-1.55.tar.gz
|
||||
/threads-shared-1.57.tar.gz
|
||||
/threads-shared-1.58.tar.gz
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
%global cpan_version 1.55
|
||||
Name: perl-threads-shared
|
||||
Version: 1.56
|
||||
Version: 1.58
|
||||
Release: 1%{?dist}
|
||||
Summary: Perl extension for sharing data structures between threads
|
||||
License: GPL+ or Artistic
|
||||
URL: http://search.cpan.org/dist/threads-shared/
|
||||
Source0: http://www.cpan.org/authors/id/J/JD/JDHEDDEN/threads-shared-%{cpan_version}.tar.gz
|
||||
# Unbudled from perl-5.25.12
|
||||
Patch0: threads-shared-1.55-Upgrade-to-1.56.patch
|
||||
Source0: http://www.cpan.org/authors/id/J/JD/JDHEDDEN/threads-shared-%{version}.tar.gz
|
||||
BuildRequires: findutils
|
||||
BuildRequires: gcc
|
||||
BuildRequires: make
|
||||
BuildRequires: perl
|
||||
BuildRequires: perl-devel
|
||||
BuildRequires: perl-generators
|
||||
BuildRequires: perl-interpreter
|
||||
BuildRequires: perl(Config)
|
||||
# Config_m not needed
|
||||
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
|
||||
|
@ -47,8 +44,7 @@ you to share variables across different threads (and pseudo-forks on
|
|||
Win32). It is used together with the threads module.
|
||||
|
||||
%prep
|
||||
%setup -q -n threads-shared-%{cpan_version}
|
||||
%patch0 -p1
|
||||
%setup -q -n threads-shared-%{version}
|
||||
|
||||
%build
|
||||
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 OPTIMIZE="$RPM_OPT_FLAGS"
|
||||
|
@ -69,6 +65,12 @@ make test
|
|||
%{_mandir}/man3/*
|
||||
|
||||
%changelog
|
||||
* Wed Jan 24 2018 Petr Pisar <ppisar@redhat.com> - 1.58-1
|
||||
- 1.58 bump
|
||||
|
||||
* Mon Jun 05 2017 Petr Pisar <ppisar@redhat.com> - 1.57-1
|
||||
- 1.57 bump
|
||||
|
||||
* Thu May 11 2017 Petr Pisar <ppisar@redhat.com> - 1.56-1
|
||||
- Upgrade to 1.56 as provided in perl-5.25.12
|
||||
|
||||
|
|
2
sources
2
sources
|
@ -1 +1 @@
|
|||
SHA512 (threads-shared-1.55.tar.gz) = 60fe568616cad49e7e453b8a2647f4f62383fb6538c905b870c363ad8964207214757044f05a8565b8bdbdfb02df3c5f450c20f60a6d0392c9c251003e30e7df
|
||||
SHA512 (threads-shared-1.58.tar.gz) = 918e42c61c1ae6340b4651a30fa28c58a29c2b04afdbd0a1d6162a3763068ef806b638569f49fbb7d6acf309bc340d1f79ebd0d946ed4054b3972576fa792f4e
|
||||
|
|
|
@ -1,110 +0,0 @@
|
|||
From c7f8a613ce96ab9eb7472dfce9beba86c28a4031 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Thu, 11 May 2017 13:03:59 +0200
|
||||
Subject: [PATCH] Upgrade to 1.56
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Unbundled from perl-5.25.12.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
lib/threads/shared.pm | 4 ++--
|
||||
shared.xs | 6 ++++--
|
||||
t/object2.t | 24 +++++++++++++++++++++++-
|
||||
3 files changed, 29 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/lib/threads/shared.pm b/lib/threads/shared.pm
|
||||
index 5a203b0..73c4dd9 100644
|
||||
--- a/lib/threads/shared.pm
|
||||
+++ b/lib/threads/shared.pm
|
||||
@@ -7,7 +7,7 @@ use warnings;
|
||||
|
||||
use Scalar::Util qw(reftype refaddr blessed);
|
||||
|
||||
-our $VERSION = '1.55'; # Please update the pod, too.
|
||||
+our $VERSION = '1.56'; # Please update the pod, too.
|
||||
my $XS_VERSION = $VERSION;
|
||||
$VERSION = eval $VERSION;
|
||||
|
||||
@@ -195,7 +195,7 @@ threads::shared - Perl extension for sharing data structures between threads
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
-This document describes threads::shared version 1.55
|
||||
+This document describes threads::shared version 1.56
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
diff --git a/shared.xs b/shared.xs
|
||||
index dab5e36..3c1b5e6 100644
|
||||
--- a/shared.xs
|
||||
+++ b/shared.xs
|
||||
@@ -1104,8 +1104,9 @@ sharedsv_array_mg_CLEAR(pTHX_ SV *sv, MAGIC *mg)
|
||||
if (!sv) continue;
|
||||
if ( (SvOBJECT(sv) || (SvROK(sv) && (sv = SvRV(sv))))
|
||||
&& SvREFCNT(sv) == 1 ) {
|
||||
- SV *tmp = Perl_sv_newmortal(caller_perl);
|
||||
+ SV *tmp;
|
||||
PERL_SET_CONTEXT((aTHX = caller_perl));
|
||||
+ tmp = sv_newmortal();
|
||||
sv_upgrade(tmp, SVt_RV);
|
||||
get_RV(tmp, sv);
|
||||
PERL_SET_CONTEXT((aTHX = PL_sharedsv_space));
|
||||
@@ -1384,8 +1385,9 @@ STORESIZE(SV *obj,IV count)
|
||||
if ( (SvOBJECT(sv) || (SvROK(sv) && (sv = SvRV(sv))))
|
||||
&& SvREFCNT(sv) == 1 )
|
||||
{
|
||||
- SV *tmp = Perl_sv_newmortal(caller_perl);
|
||||
+ SV *tmp;
|
||||
PERL_SET_CONTEXT((aTHX = caller_perl));
|
||||
+ tmp = sv_newmortal();
|
||||
sv_upgrade(tmp, SVt_RV);
|
||||
get_RV(tmp, sv);
|
||||
PERL_SET_CONTEXT((aTHX = PL_sharedsv_space));
|
||||
diff --git a/t/object2.t b/t/object2.t
|
||||
index 3d795b9..31c3797 100644
|
||||
--- a/t/object2.t
|
||||
+++ b/t/object2.t
|
||||
@@ -17,7 +17,7 @@ use ExtUtils::testlib;
|
||||
|
||||
BEGIN {
|
||||
$| = 1;
|
||||
- print("1..131\n"); ### Number of tests that will be run ###
|
||||
+ print("1..133\n"); ### Number of tests that will be run ###
|
||||
};
|
||||
|
||||
use threads;
|
||||
@@ -445,6 +445,28 @@ ok($destroyed[$ID], 'Scalar object removed from shared scalar');
|
||||
::ok($count == $n, "remove array object by undef");
|
||||
}
|
||||
|
||||
+# RT #131124
|
||||
+# Emptying a shared array creates new temp SVs. If there are no spare
|
||||
+# SVs, a new arena is allocated. shared.xs was mallocing a new arena
|
||||
+# with the wrong perl context set, meaning that when the arena was later
|
||||
+# freed, it would "panic: realloc from wrong pool"
|
||||
+#
|
||||
+
|
||||
+{
|
||||
+ threads->new(sub {
|
||||
+ my @a :shared;
|
||||
+ push @a, bless &threads::shared::share({}) for 1..1000;
|
||||
+ undef @a; # this creates lots of temp SVs
|
||||
+ })->join;
|
||||
+ ok(1, "#131124 undef array doesnt panic");
|
||||
+
|
||||
+ threads->new(sub {
|
||||
+ my @a :shared;
|
||||
+ push @a, bless &threads::shared::share({}) for 1..1000;
|
||||
+ @a = (); # this creates lots of temp SVs
|
||||
+ })->join;
|
||||
+ ok(1, "#131124 clear array doesnt panic");
|
||||
+}
|
||||
|
||||
|
||||
# EOF
|
||||
--
|
||||
2.9.3
|
||||
|
Loading…
Reference in New Issue