Compare commits
13 Commits
Author | SHA1 | Date |
---|---|---|
Fedora Release Engineering | e313732da7 | |
Fedora Release Engineering | 2b649ba73f | |
Jitka Plesnikova | e614c4c0dd | |
Jitka Plesnikova | f2a5d85988 | |
Jitka Plesnikova | 057e5879a4 | |
Jitka Plesnikova | 9ddf9accf9 | |
Jitka Plesnikova | c62da7f21d | |
Jitka Plesnikova | e16868896d | |
Jitka Plesnikova | 54f1640984 | |
Jitka Plesnikova | 0a8deb9fc8 | |
Fedora Release Engineering | ba0c761b02 | |
Petr Písař | 126ad9fb2f | |
Fedora Release Engineering | 86fcb5e476 |
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -9,3 +9,7 @@
|
|||
/Data-Dumper-2.161.tar.gz
|
||||
/Data-Dumper-2.172.tar.gz
|
||||
/Data-Dumper-2.173.tar.gz
|
||||
/Data-Dumper-2.180.tar.gz
|
||||
/Data-Dumper-2.181.tar.gz
|
||||
/Data-Dumper-2.182.tar.gz
|
||||
/Data-Dumper-2.183.tar.gz
|
||||
|
|
|
@ -1,167 +0,0 @@
|
|||
From d9c4b4ae5a1a17347ff5e3ecbf8e1d9da481f476 Mon Sep 17 00:00:00 2001
|
||||
From: David Mitchell <davem@iabyn.com>
|
||||
Date: Wed, 3 Apr 2019 13:23:24 +0100
|
||||
Subject: [PATCH] Data::Dumper - avoid leak on croak
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
v5.21.3-742-g19be3be696 added a facility to Dumper.xs to croak if the
|
||||
recursion level became too deep (1000 by default).
|
||||
|
||||
The trouble with this is that various parts of DD_dump() allocate
|
||||
temporary SVs and buffers, which will leak if DD_dump() unceremoniously
|
||||
just croaks().
|
||||
|
||||
This currently manifests as dist/Data-Dumper/t/recurse.t failing under
|
||||
Address Sanitiser.
|
||||
|
||||
This commit makes the depth checking code just set a sticky 'too deep'
|
||||
boolean flag, and
|
||||
a) on entry, DD_dump() just returns immediately if the flag is set;
|
||||
b) the flag is checked by the top-level called of DD_dump() and croaks
|
||||
if set.
|
||||
|
||||
So the net effect is to defer croaking until the dump is complete,
|
||||
and avoid any further recursion once the flag is set.
|
||||
|
||||
This is a bit of a quick fix. More long-term solutions would be to
|
||||
convert DD_dump() to be iterative rather than recursive, and/or make
|
||||
sure all temporary SVs and buffers are suitably anchored somewhere so
|
||||
that they get cleaned up on croak.
|
||||
|
||||
Petr Písař: Ported from 6d65cb5d847ac93680949c4fa02111808207fbdc in
|
||||
perl git tree.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
Dumper.pm | 6 +++---
|
||||
Dumper.xs | 27 ++++++++++++++++++++-------
|
||||
2 files changed, 23 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/Dumper.pm b/Dumper.pm
|
||||
index 40aeb7d..06af4c4 100644
|
||||
--- a/Dumper.pm
|
||||
+++ b/Dumper.pm
|
||||
@@ -10,7 +10,7 @@
|
||||
package Data::Dumper;
|
||||
|
||||
BEGIN {
|
||||
- $VERSION = '2.173'; # Don't forget to set version and release
|
||||
+ $VERSION = '2.174'; # Don't forget to set version and release
|
||||
} # date in POD below!
|
||||
|
||||
#$| = 1;
|
||||
@@ -1461,13 +1461,13 @@ be to use the C<Sortkeys> filter of Data::Dumper.
|
||||
|
||||
Gurusamy Sarathy gsar@activestate.com
|
||||
|
||||
-Copyright (c) 1996-2017 Gurusamy Sarathy. All rights reserved.
|
||||
+Copyright (c) 1996-2019 Gurusamy Sarathy. All rights reserved.
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
-Version 2.173
|
||||
+Version 2.174
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
diff --git a/Dumper.xs b/Dumper.xs
|
||||
index 7f0b027..a324cb6 100644
|
||||
--- a/Dumper.xs
|
||||
+++ b/Dumper.xs
|
||||
@@ -61,9 +61,10 @@
|
||||
#endif
|
||||
|
||||
/* This struct contains almost all the user's desired configuration, and it
|
||||
- * is treated as constant by the recursive function. This arrangement has
|
||||
- * the advantage of needing less memory than passing all of them on the
|
||||
- * stack all the time (as was the case in an earlier implementation). */
|
||||
+ * is treated as mostly constant (except for maxrecursed) by the recursive
|
||||
+ * function. This arrangement has the advantage of needing less memory
|
||||
+ * than passing all of them on the stack all the time (as was the case in
|
||||
+ * an earlier implementation). */
|
||||
typedef struct {
|
||||
SV *pad;
|
||||
SV *xpad;
|
||||
@@ -74,6 +75,7 @@ typedef struct {
|
||||
SV *toaster;
|
||||
SV *bless;
|
||||
IV maxrecurse;
|
||||
+ bool maxrecursed; /* at some point we exceeded the maximum recursion level */
|
||||
I32 indent;
|
||||
I32 purity;
|
||||
I32 deepcopy;
|
||||
@@ -97,7 +99,7 @@ static bool safe_decimal_number(const char *p, STRLEN len);
|
||||
static SV *sv_x (pTHX_ SV *sv, const char *str, STRLEN len, I32 n);
|
||||
static I32 DD_dump (pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval,
|
||||
HV *seenhv, AV *postav, const I32 level, SV *apad,
|
||||
- const Style *style);
|
||||
+ Style *style);
|
||||
|
||||
#ifndef HvNAME_get
|
||||
#define HvNAME_get HvNAME
|
||||
@@ -615,7 +617,7 @@ deparsed_output(pTHX_ SV *val)
|
||||
*/
|
||||
static I32
|
||||
DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
- AV *postav, const I32 level, SV *apad, const Style *style)
|
||||
+ AV *postav, const I32 level, SV *apad, Style *style)
|
||||
{
|
||||
char tmpbuf[128];
|
||||
Size_t i;
|
||||
@@ -642,6 +644,9 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
if (!val)
|
||||
return 0;
|
||||
|
||||
+ if (style->maxrecursed)
|
||||
+ return 0;
|
||||
+
|
||||
/* If the output buffer has less than some arbitrary amount of space
|
||||
remaining, then enlarge it. For the test case (25M of output),
|
||||
*1.1 was slower, *2.0 was the same, so the first guess of 1.5 is
|
||||
@@ -793,7 +798,7 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
}
|
||||
|
||||
if (style->maxrecurse > 0 && level >= style->maxrecurse) {
|
||||
- croak("Recursion limit of %" IVdf " exceeded", style->maxrecurse);
|
||||
+ style->maxrecursed = TRUE;
|
||||
}
|
||||
|
||||
if (realpack && !no_bless) { /* we have a blessed ref */
|
||||
@@ -1528,6 +1533,7 @@ Data_Dumper_Dumpxs(href, ...)
|
||||
style.indent = 2;
|
||||
style.quotekeys = 1;
|
||||
style.maxrecurse = 1000;
|
||||
+ style.maxrecursed = FALSE;
|
||||
style.purity = style.deepcopy = style.useqq = style.maxdepth
|
||||
= style.use_sparse_seen_hash = style.trailingcomma = 0;
|
||||
style.pad = style.xpad = style.sep = style.pair = style.sortkeys
|
||||
@@ -1675,7 +1681,7 @@ Data_Dumper_Dumpxs(href, ...)
|
||||
DD_dump(aTHX_ val, SvPVX_const(name), SvCUR(name), valstr, seenhv,
|
||||
postav, 0, newapad, &style);
|
||||
SPAGAIN;
|
||||
-
|
||||
+
|
||||
if (style.indent >= 2 && !terse)
|
||||
SvREFCNT_dec(newapad);
|
||||
|
||||
@@ -1715,6 +1721,13 @@ Data_Dumper_Dumpxs(href, ...)
|
||||
}
|
||||
SvREFCNT_dec(postav);
|
||||
SvREFCNT_dec(valstr);
|
||||
+
|
||||
+ /* we defer croaking until here so that temporary SVs and
|
||||
+ * buffers won't be leaked */
|
||||
+ if (style.maxrecursed)
|
||||
+ croak("Recursion limit of %" IVdf " exceeded",
|
||||
+ style.maxrecurse);
|
||||
+
|
||||
}
|
||||
else
|
||||
croak("Call to new() method failed to return HASH ref");
|
||||
--
|
||||
2.20.1
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
--- !Policy
|
||||
product_versions:
|
||||
- fedora-*
|
||||
decision_context: bodhi_update_push_stable
|
||||
subject_type: koji_build
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
|
|
@ -1,15 +1,13 @@
|
|||
%global base_version 2.173
|
||||
%global base_version 2.183
|
||||
|
||||
Name: perl-Data-Dumper
|
||||
Version: 2.174
|
||||
Release: 457%{?dist}
|
||||
Version: 2.183
|
||||
Release: 3%{?dist}
|
||||
Summary: Stringify perl data structures, suitable for printing and eval
|
||||
License: GPL+ or Artistic
|
||||
URL: https://metacpan.org/release/Data-Dumper
|
||||
Source0: https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX/Data-Dumper-%{base_version}.tar.gz
|
||||
# Fix a memory leak when croaking about a too deep recursion,
|
||||
# fixed in perl after 5.29.9
|
||||
Patch0: Data-Dumper-2.173-Data-Dumper-avoid-leak-on-croak.patch
|
||||
Source0: https://cpan.metacpan.org/authors/id/N/NW/NWCLARK/Data-Dumper-%{base_version}.tar.gz
|
||||
BuildRequires: coreutils
|
||||
BuildRequires: findutils
|
||||
BuildRequires: gcc
|
||||
BuildRequires: make
|
||||
|
@ -19,6 +17,7 @@ BuildRequires: perl-interpreter
|
|||
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
|
||||
BuildRequires: perl(File::Copy)
|
||||
BuildRequires: perl(strict)
|
||||
BuildRequires: perl(warnings)
|
||||
# perl-Test-Simple is in cycle with perl-Data-Dumper
|
||||
%if !%{defined perl_bootstrap}
|
||||
# Run-time:
|
||||
|
@ -37,7 +36,6 @@ BuildRequires: perl(overload)
|
|||
BuildRequires: perl(strict)
|
||||
BuildRequires: perl(Test::More) >= 0.98
|
||||
BuildRequires: perl(vars)
|
||||
BuildRequires: perl(warnings)
|
||||
# Optional tests:
|
||||
BuildRequires: perl(Encode)
|
||||
%endif
|
||||
|
@ -49,15 +47,34 @@ Requires: perl(XSLoader)
|
|||
|
||||
%{?perl_default_filter}
|
||||
|
||||
# Filter modules bundled for tests
|
||||
%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir}
|
||||
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}perl\\(Testing\\)
|
||||
|
||||
%description
|
||||
Given a list of scalars or reference variables, writes out their contents
|
||||
in perl syntax. The references can also be objects. The content of each
|
||||
variable is output in a single Perl statement. Handles self-referential
|
||||
structures correctly.
|
||||
|
||||
%package tests
|
||||
Summary: Tests for %{name}
|
||||
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
Requires: perl(Encode)
|
||||
Requires: perl-Test-Harness
|
||||
|
||||
%description tests
|
||||
Tests from %{name}. Execute them
|
||||
with "%{_libexecdir}/%{name}/test".
|
||||
|
||||
%prep
|
||||
%setup -q -n Data-Dumper-%{base_version}
|
||||
%patch0 -p1
|
||||
|
||||
# Help file to recognise the Perl scripts
|
||||
for F in t/*.t; do
|
||||
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F"
|
||||
chmod +x "$F"
|
||||
done
|
||||
|
||||
%build
|
||||
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_OPT_FLAGS"
|
||||
|
@ -65,11 +82,21 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_
|
|||
|
||||
%install
|
||||
%{make_install}
|
||||
find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete
|
||||
%{_fixperms} $RPM_BUILD_ROOT/*
|
||||
find %{buildroot} -type f -name '*.bs' -size 0 -delete
|
||||
%{_fixperms} %{buildroot}/*
|
||||
|
||||
# Install tests
|
||||
mkdir -p %{buildroot}%{_libexecdir}/%{name}
|
||||
cp -a t %{buildroot}%{_libexecdir}/%{name}
|
||||
cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
|
||||
#!/bin/sh
|
||||
cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
|
||||
EOF
|
||||
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
|
||||
|
||||
%check
|
||||
%if !%{defined perl_bootstrap}
|
||||
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
|
||||
make test
|
||||
%endif
|
||||
|
||||
|
@ -79,7 +106,47 @@ make test
|
|||
%{perl_vendorarch}/Data*
|
||||
%{_mandir}/man3/*
|
||||
|
||||
%files tests
|
||||
%{_libexecdir}/%{name}
|
||||
|
||||
%changelog
|
||||
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.183-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.183-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Thu Jul 08 2021 Jitka Plesnikova <jplesnik@redhat.com> - 2.183-1
|
||||
- 2.183 bump
|
||||
|
||||
* Thu Jul 01 2021 Jitka Plesnikova <jplesnik@redhat.com> - 2.182-1
|
||||
- 2.182 bump
|
||||
|
||||
* Mon May 31 2021 Jitka Plesnikova <jplesnik@redhat.com> - 2.181-1
|
||||
- 2.181 bump
|
||||
|
||||
* Mon May 24 2021 Jitka Plesnikova <jplesnik@redhat.com> - 2.180-4
|
||||
- Perl 5.34 re-rebuild of bootstrapped packages
|
||||
|
||||
* Mon May 24 2021 Jitka Plesnikova <jplesnik@redhat.com> - 2.180-3
|
||||
- Perl 5.34 re-rebuild of bootstrapped packages
|
||||
|
||||
* Fri May 21 2021 Jitka Plesnikova <jplesnik@redhat.com> - 2.180-2
|
||||
- Perl 5.34 rebuild
|
||||
|
||||
* Mon May 17 2021 Jitka Plesnikova <jplesnik@redhat.com> - 2.180-1
|
||||
- 2.180 bump
|
||||
- Package tests
|
||||
|
||||
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.174-460
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Thu Aug 20 2020 Petr Pisar <ppisar@redhat.com> - 2.174-459
|
||||
- Fix a memory leak when a magic throws an exception
|
||||
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.174-458
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Fri Jun 26 2020 Jitka Plesnikova <jplesnik@redhat.com> - 2.174-457
|
||||
- Perl 5.32 re-rebuild of bootstrapped packages
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
summary: Sanity tests
|
||||
discover:
|
||||
how: fmf
|
||||
execute:
|
||||
how: tmt
|
2
sources
2
sources
|
@ -1 +1 @@
|
|||
SHA512 (Data-Dumper-2.173.tar.gz) = a8d45fdce075bfe8752d423d535cc5279c012c733b0219884204119c9365e93c971858331e74c20df7beaa9b24ad54e1bf9eeb8d8bff53cf21fb88889d7602c2
|
||||
SHA512 (Data-Dumper-2.183.tar.gz) = b78ff820b9e4a873c69a2097dbe2d7eaeccfab0af4d5d262281a500d42d75abc28943fe671a203a715e31568164da7b6d33825b92ebc92f99e8242efd1e7f65b
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
summary: Upstream tests
|
||||
component: perl-Data-Dumper
|
||||
require: perl-Data-Dumper-tests
|
||||
test: /usr/libexec/perl-Data-Dumper/test
|
Loading…
Reference in New Issue