Projects
openEuler:Mainline
perl-Devel-Size
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 10
View file
_service:tar_scm:perl-Devel-Size.spec
Changed
@@ -1,13 +1,11 @@ Name: perl-Devel-Size -Version: 0.82 -Release: 6 +Version: 0.83 +Release: 1 Summary: Perl extension for finding the memory usage of Perl variables License: GPL+ or Artistic URL: https://metacpan.org/release/Devel-Size Source0: https://cpan.metacpan.org/modules/by-module/Devel/Devel-Size-%{version}.tar.gz -Patch1: backport-Fix-for-uninitialised-reads-from-MULTICONCAT-uncover.patch - BuildRequires: findutils gcc make perl-interpreter perl-generators perl(ExtUtils::MakeMaker) perl(Test::More) BuildRequires: perl-devel Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) @@ -23,7 +21,6 @@ %package_help %prep -%setup -q -n Devel-Size-%{version} %autosetup -n Devel-Size-%{version} -p1 %build @@ -46,6 +43,12 @@ %{_mandir}/man3/* %changelog +* Thu Jul 13 2023 wangjiang <wangjiang37@h-partners.com> - 0.83-1 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:upgrade version to 0.83 + * Thu Sep 22 2022 wangjiang <wangjiang37@h-partners.com> - 0.82-6 - Type:bugfix - ID:NA
View file
_service:tar_scm:backport-Fix-for-uninitialised-reads-from-MULTICONCAT-uncover.patch
Deleted
@@ -1,205 +0,0 @@ -From a8654aab512862133ac607ca3c97cc82f63f59cb Mon Sep 17 00:00:00 2001 -From: root <root@localhost.com> -Date: Wed, 21 Sep 2022 17:21:09 +0800 -Subject: * PATCH Fix for uninitialised reads from MULTICONCAT uncovered by - CPAN #127932 - * Handle allocations in MULTICONCAT's aux structure explicitly. - * Handle ARGCHECK and ARGELEM. - -Related Issue: https://rt.cpan.org/Public/Bug/Display.html?id=127932 -Patch Source : https://metacpan.org/release/NWCLARK/Devel-Size-0.82_50/diff/NWCLARK%2FDevel-Size-0.82 ---- - CHANGES | 5 +++++ - MANIFEST | 1 + - META.json | 6 +++--- - META.yml | 2 +- - Size.xs | 50 +++++++++++++++++++++++++++++++++++++++++++++-- - lib/Devel/Size.pm | 2 +- - t/basic.t | 2 +- - t/code.t | 15 +++++++++++++- - 8 files changed, 74 insertions(+), 9 deletions(-) - -diff --git a/CHANGES b/CHANGES -index 246c4d1..b09b661 100644 ---- a/CHANGES -+++ b/CHANGES -@@ -1,5 +1,10 @@ - Revision history for Perl extension Devel::Size. - -+0.82_50 2019-04-16 nicholas -+ * Fix for uninitialised reads from MULTICONCAT uncovered by CPAN #127932 -+ * Handle allocations in MULTICONCAT's aux structure explicitly. -+ * Handle ARGCHECK and ARGELEM. -+ - 0.82 2018-06-23 nicholas - * Improve comment describing the fix in cmp_array_ro(). - * Fix some dates in this file. -diff --git a/MANIFEST b/MANIFEST -index 54acc82..2a2e7c9 100644 ---- a/MANIFEST -+++ b/MANIFEST -@@ -15,6 +15,7 @@ t/pod.t - t/pod_cov.t - t/pvbm.t - t/recurse.t -+t/signatures.t - t/warnings.t A rather exhaustive test for the non-exceptional warnings - typemap The typemap for UV, missing from 5.005_xx - META.json Module JSON meta-data (added by MakeMaker) -diff --git a/META.json b/META.json -index d122214..5b5adb3 100644 ---- a/META.json -+++ b/META.json -@@ -38,7 +38,7 @@ - } - } - }, -- "release_status" : "stable", -- "version" : "0.82", -- "x_serialization_backend" : "JSON::PP version 2.97001" -+ "release_status" : "unstable", -+ "version" : "0.82_50", -+ "x_serialization_backend" : "JSON::PP version 4.02" - } -diff --git a/META.yml b/META.yml -index bf9125a..17d8bb6 100644 ---- a/META.yml -+++ b/META.yml -@@ -21,5 +21,5 @@ requires: - Test::More: '0' - XSLoader: '0' - perl: '5.005' --version: '0.82' -+version: 0.82_50 - x_serialization_backend: 'CPAN::Meta::YAML version 0.018' -diff --git a/Size.xs b/Size.xs -index e0ef024..4552707 100644 ---- a/Size.xs -+++ b/Size.xs -@@ -572,13 +572,15 @@ op_size(pTHX_ const OP * const baseop, struct state *st) - #endif - #ifdef OA_UNOP_AUX - case OPc_UNAUXOP: TAG; -- st->total_size += sizeof(struct unop_aux) + sizeof(UNOP_AUX_item) * (cUNOP_AUXx(baseop)->op_aux-1.uv+1); - op_size(aTHX_ ((UNOP *)baseop)->op_first, st); -- if (baseop->op_type == OP_MULTIDEREF) { -+ switch(baseop->op_type) { -+ case OP_MULTIDEREF: -+ { - UNOP_AUX_item *items = cUNOP_AUXx(baseop)->op_aux; - UV actions = items->uv; - bool last = 0; - bool is_hash = 0; -+ st->total_size += sizeof(struct unop_aux) + sizeof(UNOP_AUX_item) * (cUNOP_AUXx(baseop)->op_aux-1.uv+1); - while (!last) { - switch (actions & MDEREF_ACTION_MASK) { - case MDEREF_reload: -@@ -631,6 +633,50 @@ op_size(pTHX_ const OP * const baseop, struct state *st) - } - actions >>= MDEREF_SHIFT; - } -+ TAG;break; -+ } -+#ifdef OPpMULTICONCAT_STRINGIFY -+ case OP_MULTICONCAT: -+ { -+ UNOP_AUX_item *aux = cUNOP_AUXx(baseop)->op_aux; -+ SSize_t nargs = auxPERL_MULTICONCAT_IX_NARGS.ssize; -+ const char *plain_pv = auxPERL_MULTICONCAT_IX_PLAIN_PV.pv; -+ SSize_t plain_size = auxPERL_MULTICONCAT_IX_PLAIN_LEN.ssize; -+ const char *utf8_pv = auxPERL_MULTICONCAT_IX_UTF8_PV.pv; -+ SSize_t utf8_size = auxPERL_MULTICONCAT_IX_UTF8_LEN.ssize; -+ const int has_variant = plain_pv && utf8_pv && plain_pv != utf8_pv; -+ st->total_size += sizeof(UNOP_AUX_item) -+ * ( -+ PERL_MULTICONCAT_HEADER_SIZE -+ + ((nargs + 1) * (has_variant ? 2 : 1)) -+ ); -+ -+ if (has_variant) { -+ st->total_size += plain_size + utf8_size; -+ } else if (plain_pv) { -+ st->total_size += plain_size; -+ } else if (utf8_pv) { -+ st->total_size += utf8_size; -+ } /* else surely unreachable? */ -+ TAG;break; -+ } -+#endif -+#ifdef OPpARGELEM_MASK -+ case OP_ARGCHECK: -+ st->total_size += sizeof(UNOP_AUX_item) * 3; -+ TAG;break; -+ case OP_ARGELEM: -+ /* This OP is a sneaky hack, and stuffs an integer into the -+ pointer. So there is no allocation to total up. */ -+ TAG;break; -+#endif -+ default: -+ /* Unknown multiop */ -+ TAG; -+ if (st->go_yell) { -+ warn("Devel::Size: Can't calculate complete size for uknown UNOP_AUX %u\n", -+ baseop->op_type); -+ } - } - TAG;break; - #endif -diff --git a/lib/Devel/Size.pm b/lib/Devel/Size.pm -index 80f530b..3299224 100644 ---- a/lib/Devel/Size.pm -+++ b/lib/Devel/Size.pm -@@ -14,7 +14,7 @@ require XSLoader; - # This allows declaration use Devel::Size ':all'; - %EXPORT_TAGS = ( 'all' => \@EXPORT_OK ); - --$VERSION = '0.82'; -+$VERSION = '0.82_50'; - - XSLoader::load( __PACKAGE__); - -diff --git a/t/basic.t b/t/basic.t -index fd79c77..c3c0930 100644 ---- a/t/basic.t -+++ b/t/basic.t -@@ -31,7 +31,7 @@ can_ok ('Devel::Size', qw/ - /); - - die ("Uhoh, test uses an outdated version of Devel::Size") -- unless is ($Devel::Size::VERSION, '0.82', 'VERSION MATCHES'); -+ unless is ($Devel::Size::VERSION, '0.82_50', 'VERSION MATCHES'); - - ############################################################################# - # some basic checks: -diff --git a/t/code.t b/t/code.t -index 0cf3a4d..ae04070 100644 ---- a/t/code.t -+++ b/t/code.t -@@ -1,7 +1,7 @@ - #!/usr/bin/perl -w - - use strict; --use Test::More tests => 18; -+use Test::More tests => 20; - use Devel::Size ':all'; - - # For me, for some files locally, I'm seeing failures -@@ -145,3 +145,16 @@ my $ode_size = total_size(\&ode); - - cmp_ok($ode_size, '<', $two_lex_size + 768, - '&ode is bigger than a sub with two lexicals by less than 768 bytes'); -+ -+# This is a copy of the simplest multiconcat test from t/opbasic/concat.t -+# Like there, this is mostly intended for ASAN to hit: -+sub multiconcat { -+ my $s = chr 0x100; -+ my $t = "\x80" x 1024; -+ $s .= "-$t-"; -+ is(length($s), 1027, "utf8 dest with non-utf8 args"); -+}
View file
_service:tar_scm:Devel-Size-0.82.tar.gz/CHANGES -> _service:tar_scm:Devel-Size-0.83.tar.gz/CHANGES
Changed
@@ -1,5 +1,16 @@ Revision history for Perl extension Devel::Size. +0.83 2019-004-23 nicholas + no changes + +0.82_51 2019-04-17 nicholas + * Add a CONTRIBUTING file. + +0.82_50 2019-04-16 nicholas + * Fix for uninitialised reads from MULTICONCAT uncovered by CPAN #127932 + * Handle allocations in MULTICONCAT's aux structure explicitly. + * Handle ARGCHECK and ARGELEM. + 0.82 2018-06-23 nicholas * Improve comment describing the fix in cmp_array_ro(). * Fix some dates in this file.
View file
_service:tar_scm:Devel-Size-0.83.tar.gz/CONTRIBUTING
Added
@@ -0,0 +1,66 @@ +So you'd like to help? Cool. + +Bug tracking is via CPAN RT at +https://rt.cpan.org/Dist/Display.html?Name=Devel-Size + +If you want to send a patch, attaching it to an RT ticket is useful. Don't worry +if it's not perfect - it's much easier to review an adapt a patch that than to +start from scratch. But patching this module is often hard - there are easier +ways to help: + +Bug reports also useful. Please include the full `perl -V` output to give not +just version and platform, but also the specific build options. + +The module is purposely relying on implementation details that may change +underneath it, and hence is often sensitive to obscure details of the build +choices. It has to make a lot of (naughty) assumptions about the core internals, +so regressions happen when the core changes and the module doesn't keep up. +This is the most frequent cause of failing tests. In this case, it's helpful to +know what particular commit in the core caused it to break. If you have a +suitably powerful machine, can run this automatically. + +If you don't have a copy yet: + + git clone https://perl5.git.perl.org/perl.git + +(currently about 160M of download) + +then from the inside the checkout run a bisect. For example, if on your system +the regression tests for Devel::Size are now failing on the current development +version of perl but the pass with an earlier stable release version, you can run this to +automatically find which commit broke the tests: + + ./Porting/bisect.pl --module=Devel::Size + +See `./Porting/bisect.pl --help` for all the options; --with-module=Devel::Size +might also be useful if you have a specific test case. + +Beware - even on a modern machine this might take a couple of hours. If you +have a laptop plug it in, and best to let it run overnight or when the machine +would otherwise be idle. + +If you aren't able to do this, don't worry, but if you are, awesome - sometimes +from this it's immediately obvious what the likely cause is, which is a great +morale boost for starting to figure out a fix. + +If you *are* able to do this, and want to actively help, go look to see if there +are other open tickets without any indication of which core commit might have +broken it, and see if you can replicate the problem locally, and if so run a +bisect to try to find the cause. + +Two tools that can be very useful for diagnosing problems + +1) valgrind - a tool you can usually install using your OS package manager +2) Address Sanitizer (ASAN) - options for the C compilers gcc and clang + +valgrind can be used to run your existing built perl binary and Devel::Size and +report on illegal memory accesses that would otherwise would silently return +garbage data. It's great for a quick test of an existing problematic test case, +but slows execution down massively, and is not (yet) that useful for automatic +bisecting. + +ASAN requires you to (re)build perl from source with it, which in turn requires +invoking perl's ./Configure with non-default options, so it's a bit more +involved. However, the slowdown is not as severe as valgrind, and it is possible +to use it for automated bisecting. +
View file
_service:tar_scm:Devel-Size-0.82.tar.gz/MANIFEST -> _service:tar_scm:Devel-Size-0.83.tar.gz/MANIFEST
Changed
@@ -1,9 +1,9 @@ CHANGES +CONTRIBUTING lib/Devel/Size.pm Makefile.PL MANIFEST MANIFEST.SKIP -META.yml Module meta-data (added by MakeMaker) README Size.xs ppport.h @@ -15,6 +15,8 @@ t/pod_cov.t t/pvbm.t t/recurse.t +t/signatures.t t/warnings.t A rather exhaustive test for the non-exceptional warnings typemap The typemap for UV, missing from 5.005_xx +META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker)
View file
_service:tar_scm:Devel-Size-0.82.tar.gz/META.json -> _service:tar_scm:Devel-Size-0.83.tar.gz/META.json
Changed
@@ -39,6 +39,6 @@ } }, "release_status" : "stable", - "version" : "0.82", - "x_serialization_backend" : "JSON::PP version 2.97001" + "version" : "0.83", + "x_serialization_backend" : "JSON::PP version 4.02" }
View file
_service:tar_scm:Devel-Size-0.82.tar.gz/META.yml -> _service:tar_scm:Devel-Size-0.83.tar.gz/META.yml
Changed
@@ -21,5 +21,5 @@ Test::More: '0' XSLoader: '0' perl: '5.005' -version: '0.82' +version: '0.83' x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
View file
_service:tar_scm:Devel-Size-0.82.tar.gz/Size.xs -> _service:tar_scm:Devel-Size-0.83.tar.gz/Size.xs
Changed
@@ -572,13 +572,15 @@ #endif #ifdef OA_UNOP_AUX case OPc_UNAUXOP: TAG; - st->total_size += sizeof(struct unop_aux) + sizeof(UNOP_AUX_item) * (cUNOP_AUXx(baseop)->op_aux-1.uv+1); op_size(aTHX_ ((UNOP *)baseop)->op_first, st); - if (baseop->op_type == OP_MULTIDEREF) { + switch(baseop->op_type) { + case OP_MULTIDEREF: + { UNOP_AUX_item *items = cUNOP_AUXx(baseop)->op_aux; UV actions = items->uv; bool last = 0; bool is_hash = 0; + st->total_size += sizeof(struct unop_aux) + sizeof(UNOP_AUX_item) * (cUNOP_AUXx(baseop)->op_aux-1.uv+1); while (!last) { switch (actions & MDEREF_ACTION_MASK) { case MDEREF_reload: @@ -631,6 +633,50 @@ } actions >>= MDEREF_SHIFT; } + TAG;break; + } +#ifdef OPpMULTICONCAT_STRINGIFY + case OP_MULTICONCAT: + { + UNOP_AUX_item *aux = cUNOP_AUXx(baseop)->op_aux; + SSize_t nargs = auxPERL_MULTICONCAT_IX_NARGS.ssize; + const char *plain_pv = auxPERL_MULTICONCAT_IX_PLAIN_PV.pv; + SSize_t plain_size = auxPERL_MULTICONCAT_IX_PLAIN_LEN.ssize; + const char *utf8_pv = auxPERL_MULTICONCAT_IX_UTF8_PV.pv; + SSize_t utf8_size = auxPERL_MULTICONCAT_IX_UTF8_LEN.ssize; + const int has_variant = plain_pv && utf8_pv && plain_pv != utf8_pv; + st->total_size += sizeof(UNOP_AUX_item) + * ( + PERL_MULTICONCAT_HEADER_SIZE + + ((nargs + 1) * (has_variant ? 2 : 1)) + ); + + if (has_variant) { + st->total_size += plain_size + utf8_size; + } else if (plain_pv) { + st->total_size += plain_size; + } else if (utf8_pv) { + st->total_size += utf8_size; + } /* else surely unreachable? */ + TAG;break; + } +#endif +#ifdef OPpARGELEM_MASK + case OP_ARGCHECK: + st->total_size += sizeof(UNOP_AUX_item) * 3; + TAG;break; + case OP_ARGELEM: + /* This OP is a sneaky hack, and stuffs an integer into the + pointer. So there is no allocation to total up. */ + TAG;break; +#endif + default: + /* Unknown multiop */ + TAG; + if (st->go_yell) { + warn("Devel::Size: Can't calculate complete size for uknown UNOP_AUX %u\n", + baseop->op_type); + } } TAG;break; #endif
View file
_service:tar_scm:Devel-Size-0.82.tar.gz/lib/Devel/Size.pm -> _service:tar_scm:Devel-Size-0.83.tar.gz/lib/Devel/Size.pm
Changed
@@ -14,7 +14,7 @@ # This allows declaration use Devel::Size ':all'; %EXPORT_TAGS = ( 'all' => \@EXPORT_OK ); -$VERSION = '0.82'; +$VERSION = '0.83'; XSLoader::load( __PACKAGE__);
View file
_service:tar_scm:Devel-Size-0.82.tar.gz/t/basic.t -> _service:tar_scm:Devel-Size-0.83.tar.gz/t/basic.t
Changed
@@ -31,7 +31,7 @@ /); die ("Uhoh, test uses an outdated version of Devel::Size") - unless is ($Devel::Size::VERSION, '0.82', 'VERSION MATCHES'); + unless is ($Devel::Size::VERSION, '0.83', 'VERSION MATCHES'); ############################################################################# # some basic checks:
View file
_service:tar_scm:Devel-Size-0.82.tar.gz/t/code.t -> _service:tar_scm:Devel-Size-0.83.tar.gz/t/code.t
Changed
@@ -1,7 +1,7 @@ #!/usr/bin/perl -w use strict; -use Test::More tests => 18; +use Test::More tests => 20; use Devel::Size ':all'; # For me, for some files locally, I'm seeing failures @@ -145,3 +145,16 @@ cmp_ok($ode_size, '<', $two_lex_size + 768, '&ode is bigger than a sub with two lexicals by less than 768 bytes'); + +# This is a copy of the simplest multiconcat test from t/opbasic/concat.t +# Like there, this is mostly intended for ASAN to hit: +sub multiconcat { + my $s = chr 0x100; + my $t = "\x80" x 1024; + $s .= "-$t-"; + is(length($s), 1027, "utf8 dest with non-utf8 args"); +} + +multiconcat(); +cmp_ok(total_size(\&multiconcat), '>', 1024, + "pad constant makes this at least 1K");
View file
_service:tar_scm:Devel-Size-0.83.tar.gz/t/signatures.t
Added
@@ -0,0 +1,38 @@ +#!/usr/bin/perl -w + +use strict; + + +BEGIN { + require Test::More; + unless (eval "no warnings 'experimental::signatures'; 1") { + Test::More->import(skip_all => "No signatures"); + } + # Ho ho, this is going to need a better implementation once they are no + # longer experimental. + Test::More->import(); +} + +no warnings "experimental::signatures"; +use feature "signatures"; + +use Devel::Size qw(total_size); + +my $warn_count; + +$SIG{__WARN__} = sub { + return if $_0 eq "Devel::Size: Can't size up perlio layers yet\n"; + ++$warn_count; + warn @_; +}; + +# This is mostly a test for the benifit of taunting ASAN and the warnings code. + +cmp_ok(total_size(sub ($foo) {}), '>', 0, "basic signature"); +cmp_ok(total_size(sub ($bar = "x" x 1024) {}), '>', 1024, "signature with default"); +cmp_ok(total_size(sub ($foo, @bar) {}), '>', 0, "more signature"); +cmp_ok(total_size(sub (%baz) {}), '>', 0, "more slurpy"); + +is($warn_count, undef, 'No warnings emitted'); + +done_testing();
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2