This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
5 years agoupdate GNUmakefile for Test2 too
Tony Cook [Wed, 11 May 2016 04:54:02 +0000 (14:54 +1000)]
update GNUmakefile for Test2 too

5 years agoUpdate to the latest Test-Simple cpan dist
Chad Granum [Tue, 10 May 2016 14:44:27 +0000 (07:44 -0700)]
Update to the latest Test-Simple cpan dist

5 years agofix link to crosby paper on hash complexity attack
Doug Bell [Wed, 11 May 2016 16:10:40 +0000 (11:10 -0500)]
fix link to crosby paper on hash complexity attack

5 years agodocument the ?pair option to beforemaintrelease
Ricardo Signes [Wed, 11 May 2016 19:27:46 +0000 (15:27 -0400)]
document the ?pair option to beforemaintrelease

5 years ago[perl #128106] Fix reset with non-globs
Father Chrysostomos [Tue, 10 May 2016 21:14:40 +0000 (14:14 -0700)]
[perl #128106] Fix reset with non-globs

reset with a string argument was assuming that anything in a
stash would be a glob.  It crashed on anything else.

5 years agoSync Config::Perl::V with release 0.26
H.Merijn Brand [Tue, 10 May 2016 14:45:12 +0000 (16:45 +0200)]
Sync Config::Perl::V with release 0.26

5 years agoUpdate Archive-Tar to CPAN version 2.06
Chris 'BinGOs' Williams [Tue, 10 May 2016 11:05:38 +0000 (12:05 +0100)]
Update Archive-Tar to CPAN version 2.06

  [DELTA]

2.06  24/04/2016 (ISHIGAKI && BOOK)
- changed some of the "A"s in the UNPACK constant to "a"
  to allow trailing whitespaces in an archived filename
- roundtrip tests

5 years agoUpdate perlfaq to CPAN version 5.021011
Chris 'BinGOs' Williams [Tue, 10 May 2016 11:03:25 +0000 (12:03 +0100)]
Update perlfaq to CPAN version 5.021011

  [DELTA]

5.021011    20162016-03-04 20:04:08Z
  * update info on Perl 6
  * fix LICENSE address and update prereq for its content
  * excluded README.pod from the shipped tarball distribution

5 years agoUpdate Locale-Codes to CPAN version 3.38
Chris 'BinGOs' Williams [Tue, 10 May 2016 11:02:32 +0000 (12:02 +0100)]
Update Locale-Codes to CPAN version 3.38

5 years ago[MERGE] disallow 'require ::Foo::Bar' etc
David Mitchell [Tue, 10 May 2016 10:16:00 +0000 (11:16 +0100)]
[MERGE] disallow 'require ::Foo::Bar' etc

5 years agoload-module.t: re-indent and add some comments.
David Mitchell [Tue, 10 May 2016 09:48:18 +0000 (10:48 +0100)]
load-module.t: re-indent and add some comments.

No functional changes.

5 years agomake 'require ::Foo::Bar' die
David Mitchell [Sat, 19 Mar 2016 20:16:22 +0000 (20:16 +0000)]
make 'require ::Foo::Bar' die

Originally, 'require ::Foo::Bar' would try to load /Foo/Bar.pm.

The previous commit changed it so that  ::Foo::Bar mapped to Foo::Bar,
and so loaded Foo/Bar.pm in the @INC path.

This commit takes the different approach of, instead of mapping, making
any bareword require that starts with '::' into an error instead.

It introduces a new error message:

    $ perl -e'require ::Foo::Bar'
    Bareword in require must not start with a double-colon: "::Foo::Bar"
    $

See the thread at:
    http://www.nntp.perl.org/group/perl.perl5.porters/2012/07/msg189909.html

( I originally used '"::"' rather than 'a double-colon', but that
made the message a bit unpenetrable:

    Bareword in require must not start with "::": "::Foo::Bar"
)

5 years agoValidate the 'require Bare::Word' pathname.
Nicholas Clark [Wed, 27 Jun 2012 21:34:04 +0000 (23:34 +0200)]
Validate the 'require Bare::Word' pathname.

At runtime in require, validate the generated filename after translation
of '::' to '/' (and possible conversion from VMS to Unix format) to keep
the code simpler.  Reject empty module names, module names starting with
'/' or '.'  (ie absolute paths, hidden files, and '..'), and module names
containing NUL bytes or '/.' (ie hidden files and '..').

Add a test for Perl_load_module(), and check that it now rejects module
names which fall foul of the above rules.

Most of these can't trigger for a sinple bareword require since the
illegal module name will already have been rejected during parsing. However,
the Perl_load_module() fakes up a rquire optree including a bareword
OP_CONST, which *isn't* restricted by the lexer.

Note that this doesn't apply to non-bareword pathnames: these are both
unaffected:

    require "/foo/bar.pm";
    $x =  "/foo/bar.pm"; require $x;

[ This is cherry-picked from a branch Nicholas wrote 4 years ago, but
which was never merged. I've kept the body of the diff the same, modulo
rebasing, but re-worded the commit title and message.
Only one test was changed: the final one in load-module.t, since a
\0 in a pathname is now trapped earlier and gives a "can't locate" error
instead. For the same reason, it also required the addition of
"no warnings 'syscalls';".
- DAPM ]

5 years agoTreat require ::foo::bar; the same as foo::bar;
Nicholas Clark [Thu, 28 Jun 2012 20:35:20 +0000 (22:35 +0200)]
Treat require ::foo::bar; the same as  foo::bar;

[ This is cherry-picked from a branch Nicholas wrote 4 years ago, but
which was never merged. In the meantime it was agreed that 'require
::foo' should die instead of doing 'require foo'; but I've pulled it in
anyway as an interim commit, to make later cherry-picks easier. The die
will come in a later commit.
]

5 years agoreindent S_require_version()
David Mitchell [Sat, 19 Mar 2016 15:24:49 +0000 (15:24 +0000)]
reindent S_require_version()

Whitespace-only change.

5 years agoSplit the guts of pp_require into two static fns
David Mitchell [Sat, 19 Mar 2016 15:16:50 +0000 (15:16 +0000)]
Split the guts of pp_require into two static fns

S_require_version() and S_require_file() do the 'require 5.010001'
and 'require Foo::Bar' actions respectively.

This makes it clear that pp_require is effectively 2 disjoint functions,
and that all the local variables previously declared at the start of
pp_require actually belong exclusively to the file loading functionality.

This is based on a patch by Nicholas from 4 years ago, except that
I did the split from scratch since pp_require has been touched quite a
bit since then.

This commit splits it in such a way that the diff is kept as small as
possible. The next commit will re-indent.

5 years agofix #128109 - do not move RExC_open_parens[0] in reginsert
Yves Orton [Tue, 10 May 2016 07:44:31 +0000 (09:44 +0200)]
fix #128109 - do not move RExC_open_parens[0] in reginsert

In d5a00e4af6b155495be31a35728b8fef8e671ebe I merged GOSUB and GOSTART,
part of which involved making RExC_open_parens[0] refer to the start of
the pattern, and RExC_close_parens[0] referring to the end of the pattern.

This tripped up in reginsert in a subtle way, the start of the pattern
cannot and should not move in reginsert(). Unlike a paren that might
be at the start of the pattern which should move when something is inserted
in front of it, the start is a fixed point and should never move.

This patches fixes this up, and adds an assert to check that reginsert()
is not called once study_chunk() starts, as reginsert() does not adjust
RExC_recurse.

This was noticed by hv while debugging [perl #128085], thanks hugo!

5 years agofix #128085 - SIGSEGV in S_regmatch with S_study_chunk: Assertion "!frame" failed.
Yves Orton [Mon, 9 May 2016 06:52:16 +0000 (08:52 +0200)]
fix #128085 - SIGSEGV in S_regmatch with S_study_chunk: Assertion "!frame" failed.

The goto target should have been before the if (frame) block.

Clearly this code is not well tested in our test suite. This patch
does NOT include tests.

5 years ago(perl #127923) add blacklists/whitelists to Locale::Maketext
Tony Cook [Tue, 10 May 2016 02:03:02 +0000 (12:03 +1000)]
(perl #127923) add blacklists/whitelists to Locale::Maketext

5 years ago(perl #127923) note priority between the white and blacklist
Tony Cook [Wed, 20 Apr 2016 06:30:05 +0000 (16:30 +1000)]
(perl #127923) note priority between the white and blacklist

5 years ago(perl #127923) pass porting tests
Tony Cook [Wed, 20 Apr 2016 06:27:09 +0000 (16:27 +1000)]
(perl #127923) pass porting tests

- update MANIFEST, AUTHORS
- bump $Locale::Maketext::VERSION

5 years agoAdd blacklist and whitelist support to Locale::Maketext.
John Lightsey [Thu, 17 Mar 2016 16:06:09 +0000 (16:06 +0000)]
Add blacklist and whitelist support to Locale::Maketext.

Format string attacks against Locale::Maketext have been discovered in
several popular web applications and addresed by pre-filtering maketext
strings before they are fed into the maketext() method. It is now
possible to restrict the allowed bracked notation methods directly in
Maketext.

This commit also introduces a default blacklist that prevents using the
object and class methods in the Locale::Maketext namespace that were not
intended as bracked notation methods.

5 years agoperldelta for e71f25b35412
Tony Cook [Tue, 10 May 2016 01:35:50 +0000 (11:35 +1000)]
perldelta for e71f25b35412

I'm not sure that's in the right section, but I think it's a better
fit than the others I considered.

5 years agofix make test failures in -Accflags=-DPERL_TRACE_OPS
Jim Cromie [Wed, 20 Jan 2016 23:11:34 +0000 (16:11 -0700)]
fix make test failures in -Accflags=-DPERL_TRACE_OPS

builds with -DPERL_TRACE_OPS currently fail make test, on ~124 files,
for both normal & -DDEBUGGING, and plain & threaded configs.  These
tests fail because they check STDERR content, and reject the extra
output issued by perl_destruct() in these builds.  It turns out that
"Trace of all OPs executed:" by itself is enough to cause the failures.

The easiest fix is to silence -DPERL_TRACE_OPS printing by default,
and enable it if $ENV{PERL_TRACE_OPS} > 0.  Due to various aspects of
the design, this is also the best fix.

 - OP-counting is only done in runops_debug(). runops_standard()
   avoids all counting overhead, so the only 'cost' then is the extra
   space in the interpreter structure.

 - use of runops_debug() vs runops_standard() varies at build, with -DDEBUGGING,
   and can be changed at runtime, with -MDevel::Peek -e 'BEGIN{runops_debug(0 or 1)}'

 - when runops_standard is used, perl_destruct() reports ALL-0s
   OP-exec-counts.  This is wrong, silence is better.

 - when runops_* is toggled, OP-counts will only reflect part of the work done.

Given the flexibilty of use, perl_destruct() cannot really know the
counts are good, and shouldnt just spew them to STDERR.  With this
patch, the user asks for the output at runtime.

 - with patch, the build is not noisy, more usable, no stderr to deal with.
   miniperl is also silent, reducing `make` output too.

 - via simple XS, data can be read, cleared, at any compilation phase.
   with this, data to stderr is just a convienience, not "the way" to get data.
   Ive got Devel::TraceOps on-deck.

I also took the liberty of suppressing "<optype>: 0" prints entirely.

 - no real info provided (0 count is inferrable by silence)
 - 0 is usually wrong, unless other OP-counts (from same interp) are non-0
 - `make test` on a non-debug threaded build emits 5 million of them

And now './perl -e 'print "foo\n"' becomes readably small:
foo
Trace of all OPs executed:
  pushmark: 1
  gvsv: 1
  nextstate: 1
  enter: 1
  leave: 1
  print: 1

NOTES:

Since the PERL_TRACE_OPs counting overhead is runtime selectable, it
seemed useful to measure and report it:

 function run_trace_overhead() {
    for i in seq 1 2; do
perf stat -r5 -- ./perl -Ilib -MDevel::Peek -e 'BEGIN{runops_debug(0)}' -e 'for (1..9_999_999){$i++}'
perf stat -r5 -- ./perl -Ilib -MDevel::Peek -e 'BEGIN{runops_debug(1)}' -e 'for (1..9_999_999){$i++}'
    done 2>&1 | grep -E 'Performance|instructions'
 }

bench.pl couldnt do this, not without different --perlargs per contestant.

[jimc@popeye perl]$ run_trace_overhead
 Performance counter stats for './perl -MDevel::Peek -e BEGIN{runops_debug(0)} -e for (1..9_999_999){$i++}' (5 runs):
     3,460,280,502      instructions              #    1.57  insns per cycle          (25.01%)
 Performance counter stats for './perl -MDevel::Peek -e BEGIN{runops_debug(1)} -e for (1..9_999_999){$i++}' (5 runs):
     3,857,253,945      instructions              #    2.00  insns per cycle          (25.07%)
 Performance counter stats for './perl -MDevel::Peek -e BEGIN{runops_debug(0)} -e for (1..9_999_999){$i++}' (5 runs):
     3,437,504,999      instructions              #    1.57  insns per cycle          (25.07%)
 Performance counter stats for './perl -MDevel::Peek -e BEGIN{runops_debug(1)} -e for (1..9_999_999){$i++}' (5 runs):
     3,859,640,318      instructions              #    2.00  insns per cycle          (25.09%)

IE: when swapping runops_debug for runops_standard, the instruction
count predictably goes up: by 3.8/3.4 = 1.12 in these results.
Subject to many caveats, this is a reasonable estimate of the
worst-case cost overhead of OP-counting.

NB: the insns per cycle above are garbage, on this older 32bit box.
but the instruction counts look plausible (I didnt look at the
assembly code), and the per-cycle numbers are sane on a 64bit cpu
(with a newer PMU).

5 years agoperldelta for 23695c073f41
Tony Cook [Tue, 10 May 2016 00:52:19 +0000 (10:52 +1000)]
perldelta for 23695c073f41

5 years agoFix the Configure escape with usecrosscompile but no targethost
Niko Tyni [Sun, 10 Jan 2016 20:35:53 +0000 (22:35 +0200)]
Fix the Configure escape with usecrosscompile but no targethost

Commit 97076f2 added a graceful exit to Configure when targethost is
not defined but usecrosscompile is. However, this is not reached because
there is a similar check a bit earlier that makes Configure bail out.

Make the earlier check warn instead of croaking.

The use case for this combination is supplying an external config.sh
suitable for the target platform, avoiding the need for configuration
probes.

5 years agoUpdate to IPC-SysV 2.07 from CPAN
Jarkko Hietaniemi [Mon, 9 May 2016 22:27:40 +0000 (18:27 -0400)]
Update to IPC-SysV 2.07 from CPAN

No functional changes (the customized 2.06_01 already had them).

5 years agoFix test failure in lib/perl5db.t when mandoc is installed
Andreas Voegele [Tue, 26 Apr 2016 07:08:50 +0000 (09:08 +0200)]
Fix test failure in lib/perl5db.t when mandoc is installed

5 years agolocale.c, sv.c: Add, fix some comments
Karl Williamson [Sat, 9 Apr 2016 21:03:48 +0000 (15:03 -0600)]
locale.c, sv.c: Add, fix some comments

And a couple empty lines

5 years agolocale.c: Some nano-optimizations
Karl Williamson [Sat, 9 Apr 2016 21:16:59 +0000 (15:16 -0600)]
locale.c: Some nano-optimizations

Reorder two branches so the most likely is tested before the much less
likely, and add some UNLIKELY()

5 years agolocale.c: Clarify a debugging statement
Karl Williamson [Sat, 9 Apr 2016 20:47:21 +0000 (14:47 -0600)]
locale.c: Clarify a debugging statement

5 years agoPOSIX.pod: Add some caveats about strcoll(), strxfrm()
Karl Williamson [Fri, 8 Apr 2016 19:46:24 +0000 (13:46 -0600)]
POSIX.pod: Add some caveats about strcoll(), strxfrm()

5 years agoFinish mathomizing Perl_instr.
Craig A. Berry [Thu, 7 Apr 2016 01:59:12 +0000 (20:59 -0500)]
Finish mathomizing Perl_instr.

fea1d2dd5d210564d4 turned instr into a macro.  It also left the
actual function in util.c while commenting out the prototype
in proto.h (via the m flag in embed.fnc).

A function compiled without a prototype under C++ does not get
declared with extern "C" and thus gets mangled, which breaks the
build with a strict linker (VMS, possibly AIX) because the
expected symbol name is no longer produced.  Without a strict
linker, it just breaks the binary compatibility that was presumably
the nominal reason for leaving the function around in the first
place.

So move the function into mathoms.c and put its prototype in the
extern "C"-guarded section at the top of the same file.

We also have to fake the PERL_ARGS_ASSERT_INSTR macro since its
original declaration in proto.h is commented out but the porting
test t/porting/args_assert.t will take revenge if it doesn't
find the macro being used somewhere.

5 years agoReinstate "Make instr() a macro"
Karl Williamson [Fri, 8 Apr 2016 18:34:09 +0000 (12:34 -0600)]
Reinstate "Make instr() a macro"

This reverts commit 2e08dfb2b133af0fbcb4346f8d096ca68454ca54, thus
reinstating the commit it reverted.   This was delayed until 5.25.  The
next commit will solve some problems with c++ that this commit causes

5 years agoRequire literal '{' in patterns to be escaped
Karl Williamson [Fri, 8 Apr 2016 18:13:06 +0000 (12:13 -0600)]
Require literal '{' in patterns to be escaped

This has been deprecated since v5.16, with a deprecation message
displayed starting in v5.22.

5 years agoext/B/t/OptreeCheck.pm: Escape literal pattern '{'
Karl Williamson [Fri, 8 Apr 2016 18:07:05 +0000 (12:07 -0600)]
ext/B/t/OptreeCheck.pm: Escape literal pattern '{'

The deprecated warnings were getting suppressed, but literal '{' in
patterns needs to be escaped.

5 years agoMake deprecated qr//xx fatal
Karl Williamson [Tue, 29 Mar 2016 03:26:41 +0000 (21:26 -0600)]
Make deprecated qr//xx fatal

This has been deprecated since v5.22

5 years agoRemove deprecated literal control char variable names
Karl Williamson [Tue, 29 Mar 2016 03:15:50 +0000 (21:15 -0600)]
Remove deprecated literal control char variable names

These were deprecated in v5.20

5 years agotoke.c: Fix comment
Karl Williamson [Tue, 29 Mar 2016 03:14:58 +0000 (21:14 -0600)]
toke.c: Fix comment

5 years agoStop accepting deprecated NBSP in \N{}
Karl Williamson [Tue, 29 Mar 2016 03:04:40 +0000 (21:04 -0600)]
Stop accepting deprecated NBSP in \N{}

As scheduled for 5.26, this construct will no longer be accepted.

5 years agomktables: Don't destroy a data structure too soon.
Karl Williamson [Mon, 28 Mar 2016 03:39:28 +0000 (21:39 -0600)]
mktables: Don't destroy a data structure too soon.

It can happen that one table depends on another table for its
contents.  This adds a crude mechanism to prevent the depended-upon
table from being destroyed prematurely.  So far this has only shown up
during debugging, but it could have happened generally.

5 years agomktables: Add info under -annotate option
Karl Williamson [Tue, 5 Jan 2016 05:09:55 +0000 (22:09 -0700)]
mktables: Add info under -annotate option

This adds some helpful text when this option is used, which is for examining the Unicode database in great detail

5 years agomktables: Add stack trace facility
Karl Williamson [Mon, 28 Mar 2016 03:36:05 +0000 (21:36 -0600)]
mktables: Add stack trace facility

This can be used for debugging.

5 years agoCall PERL_ASYNC_CHECK when we backtrack in the regex engine
Yves Orton [Tue, 15 Mar 2016 20:07:05 +0000 (21:07 +0100)]
Call PERL_ASYNC_CHECK when we backtrack in the regex engine

5 years ago[perl #127877] Emit undef warning on sassign+concat
Aaron Crane [Sun, 8 May 2016 17:13:30 +0000 (18:13 +0100)]
[perl #127877] Emit undef warning on sassign+concat

Code like this:

    my $x;
    $x .= 'a';

is specifically exempted from "use of uninitialized value" warnings,
according to the "Declarations" section of perlsyn, to allow the idiom of
building up a value piecemeal. The same is true of the += and -= operators.
However, breaking the combined assignment up into the underlying operator
and a simple assignment, as in this code:

    my $x;
    $x = $x . 'a';

*should* produce a warning.

That warning was correctly being emitted for addition and subtraction, but
concatenation was behaving as the ".=" case, because "$x = $x . EXPR" is
optimized to the equivalent of "$x .= EXPR".

So we now explicitly detect this case, and emit the desired warning.

5 years agoepigraphs: add v5.24.0-related epigraphs
Ricardo Signes [Mon, 9 May 2016 12:28:13 +0000 (08:28 -0400)]
epigraphs: add v5.24.0-related epigraphs

5 years agoM-CL now 5.20160507 on CPAN
Chris 'BinGOs' Williams [Mon, 9 May 2016 12:22:13 +0000 (13:22 +0100)]
M-CL now 5.20160507 on CPAN

5 years agoPorting/release_schedule.pod: fix typo
Aaron Crane [Mon, 9 May 2016 12:19:28 +0000 (13:19 +0100)]
Porting/release_schedule.pod: fix typo

5 years agoupdate release schedule
Ricardo Signes [Mon, 9 May 2016 12:17:33 +0000 (08:17 -0400)]
update release schedule

5 years agocorelist: update for v5.25.1
Ricardo Signes [Sun, 8 May 2016 11:58:09 +0000 (07:58 -0400)]
corelist: update for v5.25.1

5 years agoperldelta: new v5.25.1 perldelta
Ricardo Signes [Sun, 8 May 2016 11:51:05 +0000 (07:51 -0400)]
perldelta: new v5.25.1 perldelta

5 years agobump version to v5.25.1: now open for business
Ricardo Signes [Sun, 8 May 2016 11:44:44 +0000 (07:44 -0400)]
bump version to v5.25.1: now open for business

5 years agofeature.pm: add the v5.25 bundle v5.25.0
Ricardo Signes [Sun, 8 May 2016 12:15:38 +0000 (08:15 -0400)]
feature.pm: add the v5.25 bundle

5 years agocorelist: update for v5.25.0
Ricardo Signes [Wed, 27 Apr 2016 00:21:39 +0000 (20:21 -0400)]
corelist: update for v5.25.0

5 years agoregen: make regen!
Ricardo Signes [Wed, 27 Apr 2016 00:23:46 +0000 (20:23 -0400)]
regen: make regen!

Could this be the last time I run "make regen"?

Worse things have happened.

5 years agoMETA.json: regenerate for v5.25.0
Ricardo Signes [Wed, 27 Apr 2016 00:12:24 +0000 (20:12 -0400)]
META.json: regenerate for v5.25.0

5 years agoperlhist: add v5.25.0 block
Ricardo Signes [Wed, 27 Apr 2016 00:10:15 +0000 (20:10 -0400)]
perlhist: add v5.25.0 block

5 years agoperldelta: add perl5250delta
Ricardo Signes [Wed, 27 Apr 2016 00:03:18 +0000 (20:03 -0400)]
perldelta: add perl5250delta

5 years agobump version to v5.25.0
Ricardo Signes [Tue, 26 Apr 2016 23:58:26 +0000 (19:58 -0400)]
bump version to v5.25.0

5 years agofinal commit for v5.24.0! v5.24.0
Ricardo Signes [Tue, 26 Apr 2016 22:16:10 +0000 (18:16 -0400)]
final commit for v5.24.0!

5 years agoperldelta: add Data::Alias to known broken list
Ricardo Signes [Sun, 8 May 2016 11:35:23 +0000 (07:35 -0400)]
perldelta: add Data::Alias to known broken list

5 years agoperldelta: known problems
Ricardo Signes [Sat, 7 May 2016 12:54:44 +0000 (08:54 -0400)]
perldelta: known problems

5 years agoCoreList: fix release date on v5.24.0
Ricardo Signes [Thu, 5 May 2016 16:10:32 +0000 (12:10 -0400)]
CoreList: fix release date on v5.24.0

5 years agoRC5: bump release date out for v5.24.0 v5.24.0-RC5
Ricardo Signes [Wed, 4 May 2016 12:31:32 +0000 (08:31 -0400)]
RC5: bump release date out for v5.24.0

5 years agocorelist: fix a typo
Ricardo Signes [Tue, 3 May 2016 17:35:27 +0000 (13:35 -0400)]
corelist: fix a typo

5 years agopatchlevel, perlhist: another day, another RC
Ricardo Signes [Tue, 3 May 2016 15:38:36 +0000 (11:38 -0400)]
patchlevel, perlhist: another day, another RC

5 years agoRT #127855] Slowdown in m//g on COW strings
David Mitchell [Mon, 2 May 2016 13:46:49 +0000 (14:46 +0100)]
RT #127855] Slowdown in m//g on COW strings

Better fix for this issue. The previous couple of commits revert an
earlier fix for this, which basically modified SvGROW or a particular
one of its callers to add 1 to the requested length to ensure that there
was space for any future COW reference count (which is stored in  spare
byte off the end of the string if SvCUR + null byte < SvLEN).

It turns out that sv_grow() already does a +1 over-allocation (added by me
with v5.19.0-442-gcbcb2a1), *except* that I made it skip the +1 if the
request size seemed to be a large power of two: with the idea being that
if someone had requested an exact big power of two then they were probably
doing something with buffers, and wouldn't want an 0x10000001 byte buffer
when they requested 0x10000000 bytes.  This was me basically being
conservative. However, I was probably too conservative: the simple test I
added just checked that bottom 8 bits were zero and if so, assumed that it
was a big buffer request. So as a side effect of this over-simple test,
something like 0x13d57f00 wouldn't be incremented to 0x13d57f01.

This is what was discovered in the original report in the the RT ticket:
strings allocated with lengths whose lower 8 bits were zero wouldn't have
space for a COW refcount, so would become much slower on things like

    while $g =~ m/0/g.

This commit improves the test so it only skips the +1 on lengths that
are an exact power of 2 and are greater than  0xfff.

5 years agotest lexical $foo = "$foo"
David Mitchell [Mon, 2 May 2016 12:59:28 +0000 (13:59 +0100)]
test lexical $foo = "$foo"

There were some issues with this and SvGROW().
This only occured under valgrind or similar, and only when the first of
two reverts had been done - those revertd being two preceding commits.

See RT #127855.

5 years agoRevert "fix #127855, in Perl_sv_setpvn() we have to overallocate to enable COW"
David Mitchell [Mon, 2 May 2016 13:02:51 +0000 (14:02 +0100)]
Revert "fix #127855, in Perl_sv_setpvn() we have to overallocate to enable COW"

This reverts commit e19cb11142087974d956f263d24e146b968025d5.

This and the previous commit revert the two commits that were an original
fix for RT #127855, but which is fixed in a different way in a following
commit.  See the ticket for more details.

5 years agoRevert "More generalized fix for #127855"
David Mitchell [Mon, 2 May 2016 08:30:40 +0000 (09:30 +0100)]
Revert "More generalized fix for #127855"

This reverts commit bcc9f606509ad2fad50e16f081103451b7dc49e1.

This and the next commit revert the two commits that were an original fix
for RT #127855, but which is fixed in a different way in a following
commit.  See the ticket for more details.

5 years agoperldelta: update module versions v5.24.0-RC4
Ricardo Signes [Mon, 2 May 2016 14:14:39 +0000 (10:14 -0400)]
perldelta: update module versions

5 years agocorelist: bump version past v5.22.2
Ricardo Signes [Mon, 2 May 2016 13:41:35 +0000 (09:41 -0400)]
corelist: bump version past v5.22.2

5 years agoprepare v5.24.0-RC4
Ricardo Signes [Mon, 2 May 2016 12:06:05 +0000 (08:06 -0400)]
prepare v5.24.0-RC4

5 years agoMaintainers.pl: bump versions for threads dists
jdhedden [Sat, 30 Apr 2016 21:25:44 +0000 (17:25 -0400)]
Maintainers.pl: bump versions for threads dists

5 years agoperllol: remove docs about the removed autoderef feature
reneeb [Wed, 27 Apr 2016 14:00:02 +0000 (16:00 +0200)]
perllol: remove docs about the removed autoderef feature

5 years agocorelist: updated for threads libraries
Ricardo Signes [Sat, 30 Apr 2016 18:32:31 +0000 (14:32 -0400)]
corelist: updated for threads libraries

5 years agoThread-Queue: bump version (again) because content changed
Ricardo Signes [Sat, 30 Apr 2016 18:53:22 +0000 (14:53 -0400)]
Thread-Queue: bump version (again) because content changed

5 years agothreads: bump version (again) because content changed
Ricardo Signes [Sat, 30 Apr 2016 18:52:02 +0000 (14:52 -0400)]
threads: bump version (again) because content changed

5 years agoUpgrade to Thread::Queue 3.08
jdhedden [Fri, 22 Apr 2016 20:13:10 +0000 (16:13 -0400)]
Upgrade to Thread::Queue 3.08

5 years agoUpgrade to threads::shared 1.51
jdhedden [Fri, 22 Apr 2016 23:23:01 +0000 (19:23 -0400)]
Upgrade to threads::shared 1.51

5 years agoUpgrade to threads 2.06
jdhedden [Fri, 22 Apr 2016 18:28:09 +0000 (14:28 -0400)]
Upgrade to threads 2.06

5 years agocorelist: updated for File::Copy doc updates
Ricardo Signes [Sat, 30 Apr 2016 18:26:42 +0000 (14:26 -0400)]
corelist: updated for File::Copy doc updates

5 years agoAdd cross-reference to perldata in scalar's documentation origin/dom/doc-fixes
Dominic Hargreaves [Sat, 30 Apr 2016 18:01:19 +0000 (19:01 +0100)]
Add cross-reference to perldata in scalar's documentation

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=810156

5 years agoperlrun: note the existence of find's -delete switch
Dominic Hargreaves [Sat, 30 Apr 2016 17:58:06 +0000 (18:58 +0100)]
perlrun: note the existence of find's -delete switch

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776614

5 years agoBump $File::Copy::VERSION
Dominic Hargreaves [Sat, 30 Apr 2016 17:53:13 +0000 (18:53 +0100)]
Bump $File::Copy::VERSION

5 years agoFile::Copy: add a warning about flushing writes
Dominic Hargreaves [Sat, 30 Apr 2016 17:03:01 +0000 (18:03 +0100)]
File::Copy: add a warning about flushing writes

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=494590

5 years agoperl.pod: @INC is being displayed as intended
Dominic Hargreaves [Sat, 30 Apr 2016 16:49:04 +0000 (17:49 +0100)]
perl.pod: @INC is being displayed as intended

The previous presentation looked a bit like an incomplete placeholder
expansion.

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=246542

5 years agoTick off 5.22.2
Steve Hay [Fri, 29 Apr 2016 23:09:15 +0000 (00:09 +0100)]
Tick off 5.22.2

5 years ago5.22.2 today
Steve Hay [Fri, 29 Apr 2016 23:07:42 +0000 (00:07 +0100)]
5.22.2 today

(Manually cherry picked from commit 72ccbefa77099a0bf1b7c2cb9f29685ed7d9938d)

5 years agoImport 5.22.2's perldelta
Steve Hay [Fri, 29 Apr 2016 23:05:46 +0000 (00:05 +0100)]
Import 5.22.2's perldelta

5 years agoImport 5.22.2's Module::CoreList data
Steve Hay [Fri, 29 Apr 2016 23:02:05 +0000 (00:02 +0100)]
Import 5.22.2's Module::CoreList data

5 years agotrivial s/or/of/ doc patch
Jim Cromie [Wed, 27 Apr 2016 12:22:22 +0000 (06:22 -0600)]
trivial s/or/of/ doc patch

5 years agoperlpolicy: add Sawyer X to list moderators
Ricardo Signes [Thu, 28 Apr 2016 20:56:06 +0000 (16:56 -0400)]
perlpolicy: add Sawyer X to list moderators

5 years agobump version to v5.24.0-RC3 v5.24.0-RC3
Ricardo Signes [Tue, 26 Apr 2016 22:10:34 +0000 (18:10 -0400)]
bump version to v5.24.0-RC3

5 years agocorelist: silence deep recursion warning with %version
Niko Tyni [Tue, 26 Apr 2016 21:34:51 +0000 (17:34 -0400)]
corelist: silence deep recursion warning with %version

5 years agoRemove some data detritus from CoreList
Aristotle Pagaltzis [Tue, 26 Apr 2016 21:32:43 +0000 (17:32 -0400)]
Remove some data detritus from CoreList

5 years agoDocument exports policy within POSIX
Aristotle Pagaltzis [Tue, 26 Apr 2016 09:53:54 +0000 (11:53 +0200)]
Document exports policy within POSIX

5 years agoCorrect lround situation comment in POSIX
Aristotle Pagaltzis [Tue, 26 Apr 2016 09:53:21 +0000 (11:53 +0200)]
Correct lround situation comment in POSIX

5 years agobump perl version to v5.24.0-RC2 v5.24.0-RC2
Ricardo Signes [Sat, 23 Apr 2016 17:51:26 +0000 (18:51 +0100)]
bump perl version to v5.24.0-RC2

5 years agocorelist: update Time::HiRes for v5.24.0
Ricardo Signes [Sat, 23 Apr 2016 17:38:01 +0000 (18:38 +0100)]
corelist: update Time::HiRes for v5.24.0