This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
4 years agoemit require module name err hint only when valid
David Mitchell [Sun, 16 Apr 2017 08:50:04 +0000 (09:50 +0100)]
emit require module name err hint only when valid

RT #131098

The helpful "you may need to install" hint which 'require' sometimes
includes in its error message these days (split across multiple lines for
clarity):

    $ perl -e'require Foo::Bar'
    Can't locate Foo/Bar.pm in @INC
        (you may need to install the Foo::Bar module)
        (@INC contains: ... ) at ...

is a bit over-enthusiastic when the pathname hasn't actually been derived
from a module name:

    $ perl -e'require "Foo.+/%#Bar.pm"'
    Can't locate Foo.+%#Bar.pm in @INC
        (you may need to install the Foo.+::%#Bar module)
        (@INC contains: ... ) at ...

This commit changes things so that the hint message is only emitted if the
reverse-mapped module name is legal as a bareword:

    $ perl -e'require "Foo.+/%#Bar.pm"'
    Can't locate Foo.+%#Bar.pm in @INC
        (@INC contains: ... ) at ...

4 years agorequire die msg: only mention @INC if used
David Mitchell [Thu, 13 Apr 2017 11:23:59 +0000 (12:23 +0100)]
require die msg: only mention @INC if used

RT #131098

5.8.0 introduced a change which as an inadvertent side-effect caused
this @INC-related require croak message:

    Can't locate foo in @INC (@INC contains: ...) at ...

to be emitted even when foo is a non-searchable pathname (like /foo or
./foo) and @INC isn't used.

This commit reverts the error message in these cases to be the simple

    Can't locate foo at ...

4 years agoS_require_file() : simplify an else if block
David Mitchell [Thu, 13 Apr 2017 10:53:35 +0000 (11:53 +0100)]
S_require_file() : simplify an else if block

change

    if (...) {
        ...
    }
    else {
      if (...) {
        ...
      }
    }
to

    if (...) {
        ...
    }
    else if (...) {
        ...
    }

Should make no functional difference

4 years agobetter comment require() source.
David Mitchell [Thu, 13 Apr 2017 10:50:39 +0000 (11:50 +0100)]
better comment require() source.

Add code more comments to S_require_file() and its helpder functions to
better understand what's going on.

4 years agoadd PERL_UTIL_H_ to util.h, not util.h
David Mitchell [Tue, 18 Apr 2017 08:21:17 +0000 (09:21 +0100)]
add PERL_UTIL_H_ to util.h, not util.h

With v5.25.11-59-g7335cb8 I added an include guard. PERL_UTIL_H_,
but added it to util.c rather than util.h.

I am not a smart man....

4 years agoWorkaround for GNU Autoconf unescaped left brace
Karl Williamson [Mon, 10 Apr 2017 16:41:40 +0000 (10:41 -0600)]
Workaround for GNU Autoconf unescaped left brace

See [perl #130497]

GNU Autoconf depends on Perl, and will not work on Blead (and the
forthcoming Perl 5.26), due to a single unescaped '{', that has
previously been deprecated and is now fatal.  A patch for it has been in
the Autoconf repository since early 2013, but there has not been a
release since before then.

Because this is depended on by so much code, and because it is simpler
than trying to revert to making the fatality merely deprecated, this
patch simply changes perl to not die when compiled with the exact
pattern that trips up Autoconf.  Thus Autoconf can continue to work, but
any other patterns that use the now illegal construct will continue to
die.  If other code uses the exact pattern, they too will not die, but
the deprecation message continues to get raised.  The use of the left
brace in this particular pattern is not one where we envision using the
construct to mean something else, so a deprecation is suitable for the
foreseeable future.

4 years agoNet-Ping udp not allowed in AIX or IRIX, either.
Jarkko Hietaniemi [Mon, 17 Apr 2017 13:57:51 +0000 (16:57 +0300)]
Net-Ping udp not allowed in AIX or IRIX, either.

4 years agoUpdate CPAN.pm to ANDK/CPAN-2.18-TRIAL.tar.gz
David Mitchell [Sun, 16 Apr 2017 20:04:01 +0000 (21:04 +0100)]
Update CPAN.pm to ANDK/CPAN-2.18-TRIAL.tar.gz

RT #131141

CPAN-2.17-TRIAL tried to narrow the scope to the phases prepare, make,
and test, but after some testing evidence took shape that
PERL_USE_UNSAFE_INC=1 is also needed for the install phase.

2.18 provides this change. The second issue fixed in 2.18 addresses
RT #120781, an ugly bug with a trivial fix.

4 years agoadd include guard to util.h
David Mitchell [Sun, 16 Apr 2017 19:49:45 +0000 (20:49 +0100)]
add include guard to util.h

see RT #131110 for the bikeshedding on what name to use.

Based on an original patch by Jim Schneider

4 years agothreads::shared: alloc arenas with correct context
David Mitchell [Fri, 14 Apr 2017 09:51:56 +0000 (10:51 +0100)]
threads::shared: alloc arenas with correct context

RT #131124

In a couple of places in shared.xs, it calls sv_newmortal() with
a perl context different from that currently set by PERL_SET_CONTEXT().
If sv_newmortal() happens to trigger the malloc of a new SV HEAD arena,
then under PERL_TRACK_MEMPOOL, this will cause panics when the arena is
freed or realloced.

4 years agofix perldiag entry for do '.' warning
David Mitchell [Thu, 13 Apr 2017 09:12:31 +0000 (10:12 +0100)]
fix perldiag entry for do '.' warning

Its an enabled-by-default deprecation warning

4 years agomore tweaks to 'do's pod
David Mitchell [Mon, 10 Apr 2017 11:43:02 +0000 (12:43 +0100)]
more tweaks to 'do's pod

Make it clear that both ./ and ../ are special-cased.

4 years agoperlunicode: Update text about malformed UTF-8
Karl Williamson [Tue, 11 Apr 2017 19:31:20 +0000 (13:31 -0600)]
perlunicode: Update text about malformed UTF-8

4 years agoPATCH: [perl #130801] perlapi: Clarify SvIV/SvUV/SvNV behavior
Pali [Sun, 5 Mar 2017 10:35:51 +0000 (11:35 +0100)]
PATCH: [perl #130801] perlapi: Clarify SvIV/SvUV/SvNV behavior

[The committer made a few changes for improved readability]

4 years agoperlunicode: Add link
Karl Williamson [Sat, 8 Apr 2017 18:52:05 +0000 (12:52 -0600)]
perlunicode: Add link

4 years agoPATCH: [perl #121292] wrong perlunicode BOM claims
Karl Williamson [Sat, 8 Apr 2017 18:36:32 +0000 (12:36 -0600)]
PATCH: [perl #121292] wrong perlunicode BOM claims

A BOM at the beginning of a UTF-8 file is ignored, and doesn't otherwise
do anything.

4 years agoSpelling corrections only.
James E Keenan [Fri, 7 Apr 2017 15:09:22 +0000 (11:09 -0400)]
Spelling corrections only.

4 years ago[MERGE] make tests run without '.' in @INC
David Mitchell [Fri, 7 Apr 2017 13:55:37 +0000 (14:55 +0100)]
[MERGE] make tests run without '.' in @INC

Update TestInuit.pm etc so that tests are no longer invoked with
'.' in @INC. Then fix up all the tests that break because of this.
Then fix up some bad usage of 'do' that's not detected by tests.

4 years agoSafe.pm: document rdo()'s usage of @INC
David Mitchell [Fri, 7 Apr 2017 11:51:19 +0000 (12:51 +0100)]
Safe.pm: document rdo()'s usage of @INC

4 years agofix and test execution of non-empty .bs files
David Mitchell [Fri, 7 Apr 2017 11:39:53 +0000 (12:39 +0100)]
fix and test execution of non-empty .bs files

During the build of XS modules, an empty Foo.bs file is normally created
for each Foo.so file. If a Foo_BS file is present, instead this triggers
the auto-generatation of a .bs file which may have executable perl
content.

However, nothing in core currently generates a non-empty .bs file.  So add
a test that this mechanism works, and fix up the three dynamic lib loaders
which implement the 'do $bs if -s $bs' mechanism to not rely on the
process having '.' present in @INC.

As it happens this already works currently, because the name of the
.bs file to load will usually be something like

    ../../lib/auto/Foo/Foo.bs

and the presence of the leading '..' causes 'do' to load the file directly
rather than via @INC.  But locally fix up @INC anyway, in case '../' isn't
always the case.

4 years agodist/Unicode-Normalize/Makefile.PL: fix 'do'
David Mitchell [Fri, 7 Apr 2017 11:05:34 +0000 (12:05 +0100)]
dist/Unicode-Normalize/Makefile.PL: fix 'do'

It 'do's a file in the current directory, which fails without '.' in @INC.
This doesn't matter in core at the moment, but CPAN releases should be
fixed.

4 years agofix cases where 'do file' should be 'do ./file'.
James E Keenan [Mon, 27 Mar 2017 23:31:34 +0000 (19:31 -0400)]
fix cases where 'do file' should be 'do ./file'.

These are some cases which weren't picked up by the test suite
[ This is a subset of a set of fixes originally submitted by James as
2 commits - DAPM]

4 years agoutils/libnetcfg: fix 'do' without '.' in @INC
David Mitchell [Mon, 3 Apr 2017 16:32:58 +0000 (17:32 +0100)]
utils/libnetcfg: fix 'do' without '.' in @INC

Note that this isn't normally executed during build, so it wasn't spotted
earlier.

4 years agoPorting/bench.pl: fix 'do' without '.' in @INC
David Mitchell [Mon, 3 Apr 2017 16:03:42 +0000 (17:03 +0100)]
Porting/bench.pl: fix 'do' without '.' in @INC

The --benchfile arg (default t/perf/benchmarks) is supposed to be loaded
via 'do'. With '.' no longer in @INC by default, it doesn't find files
with relative paths.

4 years agofixup regen/regcharclass.pl for no '.'in @INC
David Mitchell [Mon, 3 Apr 2017 15:20:22 +0000 (16:20 +0100)]
fixup regen/regcharclass.pl for no '.'in @INC

Note that this isn't normally executed during build, so it wasn't spotted
earlier.

4 years agofix dist/Safe/t/*.t that assumed '.' in @INC
David Mitchell [Fri, 7 Apr 2017 10:41:25 +0000 (11:41 +0100)]
fix dist/Safe/t/*.t that assumed '.' in @INC

4 years agofix dist/Time-HiRes/t/*.t that assumed '.' in @INC
David Mitchell [Fri, 7 Apr 2017 10:24:33 +0000 (11:24 +0100)]
fix dist/Time-HiRes/t/*.t that assumed '.' in @INC

4 years agofix ExtUtils-ParseXS/t/*.t that needed '.' in @INC
David Mitchell [Fri, 7 Apr 2017 10:18:22 +0000 (11:18 +0100)]
fix ExtUtils-ParseXS/t/*.t that needed '.' in @INC

4 years agofix dist/base/t/*.t that assumed '.' in @INC
David Mitchell [Fri, 7 Apr 2017 10:14:24 +0000 (11:14 +0100)]
fix dist/base/t/*.t that assumed '.' in @INC

4 years agofix lib/B/Deparse.t that assumed '.' in @INC
David Mitchell [Fri, 7 Apr 2017 10:12:22 +0000 (11:12 +0100)]
fix lib/B/Deparse.t that assumed '.' in @INC

4 years agofix ext/Pod-Html/t/*.t that assumed '.' in @INC
David Mitchell [Fri, 7 Apr 2017 08:57:12 +0000 (09:57 +0100)]
fix ext/Pod-Html/t/*.t that assumed '.' in @INC

4 years agofix ext/arybase/t/*.t that assumed '.' in @INC
David Mitchell [Fri, 7 Apr 2017 08:45:10 +0000 (09:45 +0100)]
fix ext/arybase/t/*.t that assumed '.' in @INC

4 years agofix ext/XS-APItest/t/*.t that assumed '.' in @INC
David Mitchell [Fri, 7 Apr 2017 08:42:37 +0000 (09:42 +0100)]
fix ext/XS-APItest/t/*.t that assumed '.' in @INC

4 years agofixup tests under t/ that assumed '.' in @INC
David Mitchell [Fri, 7 Apr 2017 08:32:01 +0000 (09:32 +0100)]
fixup tests under t/ that assumed '.' in @INC

4 years agostop passing '.' in @INC to tests
David Mitchell [Fri, 7 Apr 2017 07:46:13 +0000 (08:46 +0100)]
stop passing '.' in @INC to tests

Currently TestInit.pm adds '.' to @INC (except if running under taint).
Since *all* tests run from the perl core are invoked as

    perl -MTestInit[=arg,arg,..] some/test.t

this means that all test scripts (including those under cpan/ etc) are
excuted with dot present, regardless of the settings of
$PERL_USE_UNSAFE_INC and -Ddefault_inc_excludes_dot.

This commit changes it so that:

1) TestInit.pm transparently passes though a trailing dot in @INC
if present (so it now honours $PERL_USE_UNSAFE_INC and
-Ddefault_inc_excludes_dot)
2) Adds a 'DOT' arg (e.g. -MTestInit=DOT) which unconditionally adds '.';
3) Updates t/TEST so that it (and t/harness which requires t/TEST)
have a whitelist of cpan/ modules which need '.'; test scripts for these
are invoked with -MTestInit=DOT.
4) Removes the $PERL_USE_UNSAFE_INC unsetting in t/TEST and t/harness;
now that environmant variable is passed unchanged to all perl processes
involved in running the test suite.

As of this commit, lots of tests will fail on a dotless perl build; the
next few commits will fix up any tests scripts and non cpan/ distributions
which relied on dot being present.

4 years agopods: Add L<> for links missing them; a couple nits
Karl Williamson [Fri, 31 Mar 2017 04:10:46 +0000 (22:10 -0600)]
pods: Add L<> for links missing them; a couple nits

4 years agoperlfunc: 'do' synopsis: clarify when @INC used
David Mitchell [Mon, 3 Apr 2017 07:25:02 +0000 (08:25 +0100)]
perlfunc: 'do' synopsis: clarify when @INC used

4 years agovec(): defer lvalue out-of-range croaking
David Mitchell [Fri, 31 Mar 2017 12:44:58 +0000 (13:44 +0100)]
vec(): defer lvalue out-of-range croaking

RT #131083

Recent commits v5.25.10-81-gd69c430 and v5.25.10-82-g67dd6f3 added
out-of-range/overflow checks for the offset arg of vec().  However in
lvalue context, these croaks now happen before the SVt_PVLV was created,
rather than when its set magic was called. This means that something like

    sub f { $x = $_[0] }
    f(vec($s, -1, 8))

now croaks even though the out-of-range value never ended up getting used
in lvalue context.

This commit fixes things by, in pp_vec(), rather than croaking, just set
flag bits in LvFLAGS() to indicate that the offset is -Ve / out-of-range.

Then in Perl_magic_getvec(), return 0 if these flags are set, and in
Perl_magic_setvec() croak with a suitable error.

4 years agoMerge branch 'sawyerx/rmg-make-minitest' into blead
Sawyer X [Fri, 31 Mar 2017 10:02:29 +0000 (12:02 +0200)]
Merge branch 'sawyerx/rmg-make-minitest' into blead

4 years agoAlso check minitest when preparing the tarball:
Sawyer X [Fri, 31 Mar 2017 09:42:42 +0000 (11:42 +0200)]
Also check minitest when preparing the tarball:

This was noted by Jarkko was a missing instruction for something
that tends to fail but we usually don't notice. ("We" here excludes
Jarkko who randomly finds this broken without us noticing.)

I wasn't sure where to put this, but preparing the tarball seems
like an appropriate time.

4 years agofix perldiag entry for CORE::dump()
David Mitchell [Fri, 31 Mar 2017 08:18:48 +0000 (09:18 +0100)]
fix perldiag entry for  CORE::dump()

the bare form wasn't deprecated in 5.30

4 years agotweak 'do "%s" failed' message
David Mitchell [Fri, 31 Mar 2017 08:13:33 +0000 (09:13 +0100)]
tweak 'do "%s" failed' message

The warning

    do "%s" failed, '.' is no longer in @INC

was added in  the previous devel release; this commit enhances it to say

    do "%s" failed, '.' is no longer in @INC; did you mean do "./%s"

and updates the relevant docs.

See http://nntp.perl.org/group/perl.perl5.porters/243788.

4 years agoFix wrong text in Module-CoreList is_core test
Chris 'BinGOs' Williams [Sat, 25 Mar 2017 20:06:53 +0000 (20:06 +0000)]
Fix wrong text in Module-CoreList is_core test

4 years agoSlight comment enhancement.
Jarkko Hietaniemi [Sat, 25 Mar 2017 13:14:24 +0000 (09:14 -0400)]
Slight comment enhancement.

4 years agoInclude 'sh' in Configure invocations in INSTALL
Dagfinn Ilmari Mannsåker [Sat, 25 Mar 2017 09:40:06 +0000 (09:40 +0000)]
Include 'sh' in Configure invocations in INSTALL

Most invocation examples included it, but some were missing.
Add them for consistency.

4 years agoUse -Udefault_inc_excludes_dot in Configure example
Dagfinn Ilmari Mannsåker [Sat, 25 Mar 2017 09:37:56 +0000 (09:37 +0000)]
Use -Udefault_inc_excludes_dot in Configure example

While equivalent to to the -D…=n form, the -U form is more common.

4 years ago[MERGE] Test and document PERL_USE_UNSAFE_INC
Dagfinn Ilmari Mannsåker [Sat, 25 Mar 2017 09:35:25 +0000 (09:35 +0000)]
[MERGE] Test and document PERL_USE_UNSAFE_INC

Also remove it from the test environment in case it's set by the user.

4 years agoDocument PERL_USE_UNSAFE_INC in perlrun.pod
Dagfinn Ilmari Mannsåker [Tue, 21 Mar 2017 17:12:04 +0000 (17:12 +0000)]
Document PERL_USE_UNSAFE_INC in perlrun.pod

4 years agoTest PERL_USE_UNSAFE_INC
Dagfinn Ilmari Mannsåker [Tue, 21 Mar 2017 15:54:08 +0000 (15:54 +0000)]
Test PERL_USE_UNSAFE_INC

4 years agoDelete PERL_USE_UNSAFE_INC from test environment
Dagfinn Ilmari Mannsåker [Tue, 21 Mar 2017 15:53:32 +0000 (15:53 +0000)]
Delete PERL_USE_UNSAFE_INC from test environment

It intereferes with tests of @INC contents, and all core tests must work
without it.

4 years agoINSTALL: add entry for -Ddefault_inc_excludes_dot
David Mitchell [Fri, 24 Mar 2017 08:48:32 +0000 (08:48 +0000)]
INSTALL: add entry for -Ddefault_inc_excludes_dot

4 years agobump base.pm $VERSION and un-CUSTOMISE
David Mitchell [Fri, 24 Mar 2017 08:30:26 +0000 (08:30 +0000)]
bump base.pm $VERSION and un-CUSTOMISE

follow-up to the previous commit's reverting of base.pm @INC changes.

4 years agoRevert base.pm's dot-in-INC changes.
David Mitchell [Fri, 24 Mar 2017 08:10:12 +0000 (08:10 +0000)]
Revert base.pm's dot-in-INC changes.

This reverts:
    458470f62360040dcd4b5a55c8ba07503e1af5fc
    362f3f748cb84934a072fadbfb8b51090e2f9afe
    bca552795994a553e07b38a6f82a233533919926
and the base.pm part of
    8901ddee94b1bc3764b4278d1cb26bed30bc2605

This commit removes all the recent stuff that made base.pm localise
@INC and remove a trailing '.'.

This is because perl 5.26.0 will be released with  '.' in @INC disabled by
default.

See RT #128769.

4 years agoSkip %Config test under minitest.
Jarkko Hietaniemi [Wed, 22 Mar 2017 11:14:43 +0000 (07:14 -0400)]
Skip %Config test under minitest.

4 years agoskip an op/range.t test under -Dusemallocwrap=no
David Mitchell [Wed, 22 Mar 2017 08:35:33 +0000 (08:35 +0000)]
skip an op/range.t test under -Dusemallocwrap=no

RT #131033

A recently added test checked for a memory wrap condition, which won't
happen if memory wrap checking is disabled.

4 years agoAdd link to epigraph
Sawyer X [Tue, 21 Mar 2017 17:26:54 +0000 (18:26 +0100)]
Add link to epigraph

4 years agoRegen opcodes
Chris 'BinGOs' Williams [Tue, 21 Mar 2017 13:06:31 +0000 (13:06 +0000)]
Regen opcodes

Ran regen/opcode.pl to regenerate

4 years agoFix uconfig errors
Chris 'BinGOs' Williams [Tue, 21 Mar 2017 13:04:44 +0000 (13:04 +0000)]
Fix uconfig errors

Ran regen/uconfig_h.pl to regenerate

4 years agoRegen META.json for 5.26.0 - it is stable
Sawyer X [Tue, 21 Mar 2017 07:16:41 +0000 (08:16 +0100)]
Regen META.json for 5.26.0 - it is stable

4 years agoUpdate Module::CoreList for 5.26.0
Sawyer X [Tue, 21 Mar 2017 07:16:28 +0000 (08:16 +0100)]
Update Module::CoreList for 5.26.0

4 years agoVersion bump: 5.25.11 -> 5.26.0
Sawyer X [Mon, 20 Mar 2017 21:51:40 +0000 (22:51 +0100)]
Version bump: 5.25.11 -> 5.26.0

4 years agoNew perldelta
Sawyer X [Mon, 20 Mar 2017 21:25:43 +0000 (22:25 +0100)]
New perldelta

4 years agoTick off release
Sawyer X [Mon, 20 Mar 2017 21:17:04 +0000 (22:17 +0100)]
Tick off release

4 years agoAdd epigraph for 5.25.11 (link forthcoming)
Sawyer X [Mon, 20 Mar 2017 21:15:40 +0000 (22:15 +0100)]
Add epigraph for 5.25.11 (link forthcoming)

4 years agoadd new release to perlhist v5.25.11
Sawyer X [Mon, 20 Mar 2017 16:50:59 +0000 (17:50 +0100)]
add new release to perlhist

4 years agoFinalize perldelta:
Sawyer X [Mon, 20 Mar 2017 16:06:38 +0000 (17:06 +0100)]
Finalize perldelta:

This includes cleanups, adding obituary notice for Kip, upgraded
modules, and fixing a small unescaped <>.

4 years agoUpdate Module::CoreList for 5.25.11
Sawyer X [Mon, 20 Mar 2017 15:53:51 +0000 (16:53 +0100)]
Update Module::CoreList for 5.25.11

4 years agoRevert "Respect hashbangs containing perl6"
Leon Timmermans [Sun, 17 Jul 2016 14:54:19 +0000 (16:54 +0200)]
Revert "Respect hashbangs containing perl6"

This reverts commit d9fc04eebe29b8cf5f6f6bf31373b202eafa44d6.

As discussed in
http://www.nntp.perl.org/group/perl.perl5.porters/2016/05/msg236423.html,
the current perl6-shebang code has rather sharp edge-cases. Hence a revert
until we come up with a better solution seems wise.

(cherry picked from commit f691e4455dd520eff11e7f070a9b034b0fa5ca1c)

4 years agoUpgrade to Test::Harness 3.38
Leon Timmermans [Sat, 18 Mar 2017 21:51:51 +0000 (22:51 +0100)]
Upgrade to Test::Harness 3.38

4 years agoFix loading Module::CoreList in corelist.pl
Sawyer X [Mon, 20 Mar 2017 13:01:30 +0000 (14:01 +0100)]
Fix loading Module::CoreList in corelist.pl

4 years agoUpdate Test::Harness 3.36 -> 3.38
Sawyer X [Sun, 19 Mar 2017 18:51:10 +0000 (19:51 +0100)]
Update Test::Harness 3.36 -> 3.38

4 years agoPorting/sync-with-cpan: honour exec-bit whitelist
Aaron Crane [Sun, 19 Mar 2017 09:57:37 +0000 (09:57 +0000)]
Porting/sync-with-cpan: honour exec-bit whitelist

Reported by kid51++

4 years agoPorting/sync-with-cpan: handle absence of "." from @INC
Aaron Crane [Sun, 19 Mar 2017 09:58:56 +0000 (09:58 +0000)]
Porting/sync-with-cpan: handle absence of "." from @INC

4 years agoRegenerate t/porting/customized.dat.
James E Keenan [Sun, 19 Mar 2017 00:22:13 +0000 (20:22 -0400)]
Regenerate t/porting/customized.dat.

By running t/porting/customized.t --regen.  This should have been done as
final part of CPAN-sync for IO-Compress et al in commit
5173674b1cb46b59301b559929904bc67fa15056 on Mar 10 2017.

4 years agoFix copyright test:
Sawyer X [Sat, 18 Mar 2017 19:32:57 +0000 (20:32 +0100)]
Fix copyright test:

Other tests are run from t/ and so they add ".." to @INC, but
this test runs from the main dir, so it needs to add ".".

4 years agoReflect next changes in release schedule
Sawyer X [Sat, 18 Mar 2017 18:01:28 +0000 (19:01 +0100)]
Reflect next changes in release schedule

4 years agoSync Pod-Perldoc with CPAN version 3.28.
James E Keenan [Fri, 17 Mar 2017 23:10:50 +0000 (19:10 -0400)]
Sync Pod-Perldoc with CPAN version 3.28.

This should enable us to close
https://rt.perl.org/Ticket/Display.html?id=130759.

4 years ago[MERGE] fix vec() offset overflow issues
David Mitchell [Fri, 17 Mar 2017 14:13:57 +0000 (14:13 +0000)]
[MERGE] fix vec() offset overflow issues

4 years agofix integer overflows in Perl_do_vecget()/set
David Mitchell [Thu, 16 Mar 2017 12:29:03 +0000 (12:29 +0000)]
fix integer overflows in Perl_do_vecget()/set

RT #130915

In something like

    vec($str, $bignum, 16)

(i.e. where $str is treated as a series of 16-bit words), Perl_do_vecget()
and Perl_do_vecset() end up doing calculations equivalent to:

    $start = $bignum*2;
    $end = $start + 2;

Currently both these calculations can wrap if $bignum is near the maximum
value of a STRLEN (the previous commit already fixed cases for $bignum >
max(STRLEN)).

So this commit makes them check for potential overflow before doing such
calculations.

It also takes account of the fact that the previous commit changed the
type of offset from signed to unsigned.

Finally, it also adds some tests to t/op/vec.t for where the 'word'
overlaps the end of the string, for example

    $x = vec("ab", 0, 64)

should behave the same as:

    $x = vec("ab\0\0\0\0\0\0", 0, 64)

This uses a separate code path, and I couldn't see any tests for it.

This commit is based on an earlier proposed fix by Aaron Crane.

4 years agoPerl_do_vecget(): change offset arg to STRLEN type
David Mitchell [Wed, 15 Mar 2017 14:35:59 +0000 (14:35 +0000)]
Perl_do_vecget(): change offset arg to STRLEN type

... and fix up its caller, pp_vec().

This is part of a fix for RT #130915.

pp_vec() is responsible for extracting out the offset and size from SVs on
the stack, and then calling do_vecget() with those values. (Sometimes the
call is done indirectly by storing the offset in the LvTARGOFF() field of
a SVt_PVLV, then later Perl_magic_getvec() passes the LvTARGOFF() value to
do_vecget().)

Now SvCUR, SvLEN and LvTARGOFF are all of type STRLEN (a.k.a Size_t),
while the offset arg of do_vecget() is of type SSize_t (i.e. there's a
signed/unsigned mismatch). It makes more sense to make the arg of type
STRLEN. So that is what this commit does.

At the same time this commit fixes up pp_vec() to handle all the
possibilities where the offset value can't fit into a STRLEN, returning 0
or croaking accordingly, so that do_vecget() is never called with a
truncated or wrapped offset.

The next commit will fix up the internals of do_vecget() and do_vecset(),
which have to worry about offset*(2^n) wrapping or being > SvCUR().

This commit is based on an earlier proposed fix by Aaron Crane.

4 years ago[MERGE] fix -DPERL_GLOBAL_STRUCT_PRIVATE builds
David Mitchell [Fri, 17 Mar 2017 14:10:59 +0000 (14:10 +0000)]
[MERGE] fix -DPERL_GLOBAL_STRUCT_PRIVATE builds

With no automatic smoking, this build option has suffered some bitrot over
the last few months.

4 years agoPERL_GLOBAL_STRUCT_PRIVATE: dump.c:op_class_names
David Mitchell [Fri, 17 Mar 2017 13:51:46 +0000 (13:51 +0000)]
PERL_GLOBAL_STRUCT_PRIVATE: dump.c:op_class_names

t/porting/libperl.t under -DPERL_GLOBAL_STRUCT_PRIVATE doesn't like
non-const static data structures

4 years agoPERL_GLOBAL_STRUCT_PRIVATE: fix scope.c:arg_counts
David Mitchell [Fri, 17 Mar 2017 13:40:03 +0000 (13:40 +0000)]
PERL_GLOBAL_STRUCT_PRIVATE: fix scope.c:arg_counts

t/porting/libperl.t under -DPERL_GLOBAL_STRUCT_PRIVATE doesn't like
non-const static data structures

4 years agoPERL_GLOBAL_STRUCT_PRIVATE: fix PL_isa_DOES
David Mitchell [Fri, 17 Mar 2017 13:15:13 +0000 (13:15 +0000)]
PERL_GLOBAL_STRUCT_PRIVATE: fix PL_isa_DOES

I added the global string constant PL_isa_DOES recently. This caused
t/porting/libperl.t to fail under -DPERL_GLOBAL_STRUCT_PRIVATE builds.

This commit makes PL_isa_DOES be declared and defined in a similar
way to other such global constants. This is pure cargo-culting - I have no
real idea of the point of all the EXTCONST, INIT and globvar.sym stuff.

4 years agot/porting/libperl.t: add better dianostics
David Mitchell [Fri, 17 Mar 2017 12:19:44 +0000 (12:19 +0000)]
t/porting/libperl.t: add better dianostics

For -DPERL_GLOBAL_STRUCT_PRIVATE builds, it checks that there aren't any
global symbols.  Make it display the symbols if it finds any. It already
does so for bss; this commit adds data and common diag()s.

4 years agolocale.c: fix compiler warning
David Mitchell [Fri, 17 Mar 2017 09:57:39 +0000 (09:57 +0000)]
locale.c: fix compiler warning

(this is debugging-only code)

It was trying to printf a U32 using %u

4 years ago[MERGE] fixes and tests for Renew (RT #130841)
David Mitchell [Wed, 15 Mar 2017 09:25:51 +0000 (09:25 +0000)]
[MERGE] fixes and tests for Renew (RT #130841)

4 years agoadd range.t test for RT #130841
David Mitchell [Tue, 7 Mar 2017 15:22:49 +0000 (15:22 +0000)]
add range.t test for RT #130841

4 years agoupdate size after Renew
Hugo van der Sanden [Tue, 28 Feb 2017 11:23:09 +0000 (11:23 +0000)]
update size after Renew

RT #130841

In general code, change this idiom:

    PL_foo_max += size;
    Renew(PL_foo, PL_foo_max, foo_t);

to
    Renew(PL_foo, PL_foo_max + size, foo_t);
    PL_foo_max += size;

so that if Renew dies, PL_foo_max won't be left hanging.

4 years agoreentr: update size after Renew
Hugo van der Sanden [Tue, 28 Feb 2017 11:21:55 +0000 (11:21 +0000)]
reentr: update size after Renew

RT #130841

Setting it before Renew can cause problems if the Renew fails.

Required 'make regen'.

4 years agoWIN32: update size after Renew
Hugo van der Sanden [Tue, 28 Feb 2017 11:21:09 +0000 (11:21 +0000)]
WIN32: update size after Renew

RT #130841

Setting it before Renew can cause problems if the Renew fails.

4 years agoconfigure.com: default_inc_excludes_dot catch-up
Craig A. Berry [Tue, 14 Mar 2017 18:03:05 +0000 (13:03 -0500)]
configure.com: default_inc_excludes_dot catch-up

This makes it configurable rather than hard-wired, and switches
the default to "define" following 458ea8f78a2917, which did so
on Windows, and 4634f4819b15eb18, which did so for platforms using
Configure.

4 years agowarn if do "somefile" fails when . not default in @INC and somefile exists
Tony Cook [Tue, 7 Mar 2017 03:50:11 +0000 (14:50 +1100)]
warn if do "somefile" fails when . not default in @INC and somefile exists

the message and warning category may need adjustment

4 years agoinitialize default_inc_excludes_dot to '' like every variable
Tony Cook [Tue, 14 Mar 2017 10:56:59 +0000 (21:56 +1100)]
initialize default_inc_excludes_dot to '' like every variable

Handling of the default is done further down.

4 years agoTurn on removal of dot in @INC by default:
Sawyer X [Tue, 14 Mar 2017 08:43:19 +0000 (09:43 +0100)]
Turn on removal of dot in @INC by default:

That's it. Dot no longer in @INC.

4 years agoperlrun: -F pattern can't have NULs
Karl Williamson [Tue, 14 Mar 2017 02:18:06 +0000 (20:18 -0600)]
perlrun: -F pattern can't have NULs

4 years agoperlhacktips.pod: clarify -DDEBUG_LEAKING_SCALARS
David Mitchell [Mon, 13 Mar 2017 09:12:34 +0000 (09:12 +0000)]
perlhacktips.pod: clarify -DDEBUG_LEAKING_SCALARS

distinguish between the cc -D option and the Configure -D option.

Suggested by KES in

http://nntp.perl.org/group/perl.perl5.porters/243481

4 years agoMake DEFAULT_INC_EXCLUDES_DOT the default on Windows
Steve Hay [Sun, 12 Mar 2017 15:37:57 +0000 (15:37 +0000)]
Make DEFAULT_INC_EXCLUDES_DOT the default on Windows

and provide a makefile option of the same name to control it. It is set to
'define' by default, but can be commented out or set to 'undef' in the
usual manner to switch it off and return to the legacy default behaviour
of including '.' at the end of @INC.

4 years agoSync IO-Compress with CPAN version 2.074.
James E Keenan [Fri, 10 Mar 2017 16:46:48 +0000 (11:46 -0500)]
Sync IO-Compress with CPAN version 2.074.

CUSTOMIZED array no longer needed in this distro's entry in
Porting/Maintainers.pl; removed.

lib/File/GlobMapper.pm lacks a $VERSION; compensate for that by adding an
entry in Porting/cmpVERSION.pl.

From Changes file (since last version distributed with core):

  2.074 19 Feb 2017

      * Fix bad 2.073 release

  2.073 18 Feb 2017

      * #120239: [PATCH] ISA fixes for c3

  2.072 12 Feb 2017

      * Makefile.PL
        #120084: Need Fix for Makefile.PL depending on . in @INC

  2.070 28 Dec 2016

      * File::GlobMapper
        #117675: Fix prototype errors while lazy loading the module

      * zipdetails
        #116538: CVE-2016-1238: avoid loading optional modules from default .

4 years agoEnsure that lib is built before IO-Compress
Chris 'BinGOs' Williams [Fri, 10 Mar 2017 11:40:21 +0000 (11:40 +0000)]
Ensure that lib is built before IO-Compress