This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
7 years agoperlpodspec: Note Pod::Simple instead of Pod::Parser
Karl Williamson [Sun, 8 Jan 2017 17:41:56 +0000 (10:41 -0700)]
perlpodspec: Note Pod::Simple instead of Pod::Parser

Pod::Parser is on its way out from core.  This changes the text to
correspond.

7 years ago[perl #130495] add fresh_perl() option for prog with embedded utf8
Hugo van der Sanden [Sat, 7 Jan 2017 01:27:50 +0000 (01:27 +0000)]
[perl #130495] add fresh_perl() option for prog with embedded utf8

Support { wide_chars => 1 } in the args hash to fresh_perl*() functions,
and use it for the recently added test in re/pat.t

7 years agoImprove perlintern.pod docs for PL_dowarn
Aaron Crane [Sat, 7 Jan 2017 15:32:46 +0000 (15:32 +0000)]
Improve perlintern.pod docs for PL_dowarn

7 years agoFix save-stack type error
Aaron Crane [Sat, 7 Jan 2017 13:57:05 +0000 (13:57 +0000)]
Fix save-stack type error

7 years agoadd setproctitle() support for DragonFly BSD
Peter Avalos [Sat, 7 Jan 2017 14:32:08 +0000 (14:32 +0000)]
add setproctitle() support for DragonFly BSD

RT #130068

(applied untested, as I don't have access to a  dragonfly box - DAPM)

7 years agofix some comment typos about PL_isa_DOES
David Mitchell [Sat, 7 Jan 2017 14:12:05 +0000 (14:12 +0000)]
fix some comment typos about PL_isa_DOES

... and expand one of the comments a bit.

7 years agocflags.SH: omit a needless process in generated file
Aaron Crane [Fri, 6 Jan 2017 17:03:21 +0000 (17:03 +0000)]
cflags.SH: omit a needless process in generated file

Using the shell "case" statement rather than grep(1) will save a process on
every core C file compiled.

7 years agot/perf/optree.t: remove obsolete comment
David Mitchell [Sat, 7 Jan 2017 10:09:28 +0000 (10:09 +0000)]
t/perf/optree.t: remove obsolete comment

with commit v5.25.8-172-gb243b19, I removed some special-casing of the A
in (A&&B) being in boolean context, but forgot to remove a comment
describing this special-casing.

7 years agoEliminate two unused variables detected by clang.
James E Keenan [Fri, 6 Jan 2017 22:56:50 +0000 (17:56 -0500)]
Eliminate two unused variables detected by clang.

"warning: unused variable 'i' [-Wunused-variable]"

7 years ago[MERGE] redo boolean context
David Mitchell [Fri, 6 Jan 2017 16:28:50 +0000 (16:28 +0000)]
[MERGE] redo boolean context

Overhaul the stuff that flags an op as being in boolean context (currently
just padhv and rv2hv). Make the mechanism in rpeep() general, so that
other ops can be easily added in future, and add a generic testing
framework for such ops in t/perf/optree.t.

This alters the amount on situations recognised as being in boolean
context (mainly increasing them).

7 years agoIn A && B, stop special-casing boolean-ness of A
David Mitchell [Fri, 6 Jan 2017 11:35:11 +0000 (11:35 +0000)]
In A && B, stop special-casing boolean-ness of A

Some ops, (currently PADHV and RV2HV) can be flagged as being in boolean
context, and if so, may return a simple truth value which may be more
efficient to calculate than a full scalar value. (This was originally
motivated by code like if (%h) {...}, where the scalar context %h returned a
bucket ratio string, which involved counting how many HvARRAY buckets were
non-empty, which was slow in large hashes. It's been made less important
since %h in scalar context now just returns a key count, which is quick to
calculate.)

There is an issue with the A argument of  A||B, A//B and A&&B, in that,
although A checked by the logop in boolean context, depending on its
truth value the original A may be passed through to the next op. So in
something like $x = (%h || -1), it's not sufficient for %h to return a
truth value; it must return a full scalar value which may get assigned to
$x.

So in general, we only mark the A op as being in boolean context if the
logop is in void context, or if the returned A would only be consumed in
boolean context; so !(A||B) would be ok for example.

However, && is a special case of this, since it will return the original A
only if A was false. Before this commit, && was special-cased to mark A as
being in boolean context regardless of the context of (A&&B). The downside
of this is that the A op can't just return &PL_sv_no as a false value;
it has to return something that is usable in scalar context too. For
example with %h, it returns sv_2mortal(newSViv(0))), which stringifies to
"0" while &PL_sv_no stringifies to "".

This commit removes that special case and makes && behave like || and //
again.

The upside is that some ops in boolean context will be able to more
cheaply return a false value (e.g. just &PL_sv_no verses
sv_2mortal(newSViv(0))).

The main downside is that && in unknown context (typically an
'if (%h} {...}' as the last statement in a sub) will have to check at
runtime whether the caller context is slower.  It will also have to return
a scalar value for something like $y = (%h && $x), but that's a relatively
uncommon occurrence, and now that %h in scalar context doesn't have to
count used buckets, the extra cost in these rare cases is minor.

7 years agoadd xor, grep, flip, flop to boolean cxt detection
David Mitchell [Wed, 4 Jan 2017 23:50:14 +0000 (23:50 +0000)]
add xor, grep, flip, flop to boolean cxt detection

The code that detects whether certain ops (currently just PADHV and RV2HV)
are called in boolean context only recognises a few ops as providing
boolean context: NOT, OR, DOR, AND, COND_EXPR.

This commit expands this by adding GREPWHILE, FLIP, FLOP, XOR too (in the
case of XOR it only applies to the RHS arg - the LHS is not simple to
detect).

This means that in something like

    @AofH_nonempty = grep %$_, @AofH

the test for each hash being non-empty will now be done in boolean rather
than full scalar context, so may be faster.

Similarly (although less excitingly) these hash key counts are also
boolean now:

    %hash .. $other;
    $other .. %hash;
    $other xor %hash;

(I basically did a grep for 'SvTRUE' in pp*.c to see what other ops might
be imposing boolean context.)

Since this has been added to the general boolean context detection
mechanism, it will also apply for any future ops with are 'booleanised'.

7 years agoreindent block in rpeep()
David Mitchell [Wed, 4 Jan 2017 21:22:21 +0000 (21:22 +0000)]
reindent block in rpeep()

(whitespace-only change)

The code for the case OP_PADAV/OP_PADSV was too far left.

7 years agore-implement boolean context detection
David Mitchell [Wed, 4 Jan 2017 20:27:55 +0000 (20:27 +0000)]
re-implement boolean context detection

When certain ops are used in a boolean context (currently just PADHV and
RV2SV, implementing '%hash'), one of the private flags OPpTRUEBOOL or
OPpMAYBE_TRUEBOOL is set on the op to indicate this; at
runtime, the pp function can then just return a boolean value rather than
 a full scalar value (in the case of %hash, an element count).

However, the code which sets these flags has had a complex history, and is
a bit messy. It also sets the flags incorrectly (but safely) in many
cases: principally indicating boolean context when it's in fact void, or
scalar context when it's in fact boolean. Both these permutations make the
code potentially slower (but still correct).

[ As a side-note: in 5.25, a bare %hash in scalar context changed from
returning a bucket count etc, to just returning a key count, which is
quicker to calculate. So the boolean optimisation for %hash is not nearly
as important now: it's now just the overhead of creating a temp to return
a count verses returning &PL_sv_yes, rather than counting keys. However
the improved and generalised boolean context detection added by this
commit will be useful in future to apply boolean context to other ops. ]

In particular, this wasn't being optimised (i.e. a 'not' of a hash within
an if):

    if (!%hash) { ...}

This commit fixes all these cases (and uncomments a load of failing tests
in t/perf/optree.t which were added in the previous commit.)

It makes the code below nearly 3 times faster:

    my $c; my %h = 1..10;
    for my $i (1..10_000_000) { if (!%h) { $c++ }; }

It restructures the relevant code in rpeep() so that rather than switching
on logops like OP_OR, then seeing if that op is preceded by PADHV/RV2HV,
it instead switches on PADHV/RV2HV then sees if succeeding ops impose
boolean context on that op - that is to say, in all possible execution
paths after the PADHV/RV2HV pushes a scalar onto the stack, will that
scalar only ever be used for a boolean test? (*).

The scanning of succeeding ops is extracted out into a static function.
This will make it very easy in future to apply boolean context to other
ops too, or to expand the definition of boolean context (e.g. adding
'xor').

(*) Although in theory an expression like (A && B) can return A if A is
false, if A happens to be %hash, and as long as pp_padhv() etc return
a boolean false value that is also usable in scalar context (so it returns
0 rather than PL_sv_no), then we can pretend that OP_AND's LH arg is
never used as a scalar.

7 years agoadd testing framework for boolean context
David Mitchell [Wed, 4 Jan 2017 19:07:46 +0000 (19:07 +0000)]
add testing framework for boolean context

Some ops (currently just padhv and rv2hv) are optimised when found to be
in boolean context - by setting a private flag on the op indicating
definite or maybe boolean context. At run time, the op can just return
true / false rather than a real value, which may be cheaper.

This commit adds a bunch of tests in nested loops to optree.t to check
that the right private flags are set for the various permutations of

    if (%h || $x) { ...}

etc.

It's written in such a way that its easy to add new ops to it.

At the moment many permutations are actually commented out, as these
(fairly comprehensive) tests show up a number of deficiencies in the
current implementation. These should be fixed in the next commit.

7 years agot/perf/optree.t: add use warnings, strict
David Mitchell [Wed, 4 Jan 2017 09:16:51 +0000 (09:16 +0000)]
t/perf/optree.t: add use warnings, strict

7 years agoRemoved unused CHR_DIST macro from a second file (RT 130519).
James E Keenan [Fri, 6 Jan 2017 12:48:21 +0000 (07:48 -0500)]
Removed unused CHR_DIST macro from a second file (RT 130519).

7 years agoRemoved unused CHR_DIST macros
Andy Lester [Sun, 27 Nov 2016 04:46:13 +0000 (22:46 -0600)]
Removed unused CHR_DIST macros

7 years agoFix the Unicode Bug in the range operator
Aaron Crane [Sun, 20 Nov 2016 14:18:22 +0000 (14:18 +0000)]
Fix the Unicode Bug in the range operator

7 years agoregcomp.c: Use memEQ instead of looping an element at a time
Karl Williamson [Thu, 5 Jan 2017 05:41:53 +0000 (22:41 -0700)]
regcomp.c: Use memEQ instead of looping an element at a time

7 years agoperlapi: Add clarification for SvGROW()
Karl Williamson [Thu, 5 Jan 2017 05:25:15 +0000 (22:25 -0700)]
perlapi: Add clarification for SvGROW()

7 years agotoke.c: Make too-long inline function just static
Karl Williamson [Thu, 5 Jan 2017 05:18:24 +0000 (22:18 -0700)]
toke.c: Make too-long inline function just static

This function is too long to be effectively inlined, so don't request
the compiler to do so.

7 years agoutf8.c: Add a const to a function parameter
Karl Williamson [Thu, 5 Jan 2017 05:16:08 +0000 (22:16 -0700)]
utf8.c: Add a const to a function parameter

7 years agoperldelta for 47a83dc69df7, c345ac2ecadb, 728ecd1a3998, f2a60c1f79f4
Tony Cook [Thu, 5 Jan 2017 00:04:05 +0000 (11:04 +1100)]
perldelta for 47a83dc69df7c345ac2ecadb728ecd1a3998f2a60c1f79f4

7 years agoVarious fixes for dtrace builds on FreeBSD and for other platforms
Tony Cook [Wed, 4 Jan 2017 23:39:44 +0000 (10:39 +1100)]
Various fixes for dtrace builds on FreeBSD and for other platforms

(to a lesser extent)

7 years ago(perl #130108) check if dtrace accepts -xnolibs and use it if available
Tony Cook [Mon, 28 Nov 2016 04:15:18 +0000 (15:15 +1100)]
(perl #130108) check if dtrace accepts -xnolibs and use it if available

dtrace without -xnolibs fails in a FreeBSD jail, so we need to supply
it on FreeBSD.

Unfortunately systemtap's dtrace emulation doesn't support -xnolibs so
we need to test if it's available.

7 years ago(perl #130108) separate compiled objects from dtrace modified objects
Tony Cook [Mon, 28 Nov 2016 04:19:12 +0000 (15:19 +1100)]
(perl #130108) separate compiled objects from dtrace modified objects

When generating an object file with "dtrace -G", dtrace also modifies
the input object files.

This causes two problems:

1) Since the objects are modified, their modification times are updated
which may break dependency checks by make.

2) on FreeBSD at least, once the object has been processed it can't be
processed again by dtrace -G

7 years ago(perl #130108) add elf to libswanted on FreeBSD 10.x
Tony Cook [Mon, 28 Nov 2016 04:22:16 +0000 (15:22 +1100)]
(perl #130108) add elf to libswanted on FreeBSD 10.x

usedtrace builds add references to libelf symbols, causing link
failures without it.

at hints time we don't know if the user will interactively select
dtrace and there's no CBU, so it's added unconditionally on 10.x

7 years ago(perl #130108) generate a dummy dtrace_main.o if perlmain.o doesn't contain probes
Tony Cook [Thu, 17 Nov 2016 11:18:30 +0000 (22:18 +1100)]
(perl #130108) generate a dummy dtrace_main.o if perlmain.o doesn't contain probes

efc4bddfd4 added generating a probes object file for perlmain.o, since
the compiler was generating probes even for unused inline functions.

The default compiler on FreeBSD 11 however doesn't generate probes for
these unused inline functions, and dtrace -G fails because it can't
find any.

So if dtrace fails for perlmain.o generate a dummy object file to
take its place.

Similarly for XS::APItest.

7 years agoRT#130496: assertion failure for '{}->$x' on undefined $x
Aaron Crane [Wed, 4 Jan 2017 20:02:45 +0000 (20:02 +0000)]
RT#130496: assertion failure for '{}->$x' on undefined $x

7 years agoAPItest/t/handy.t: Skip locale tests when not in locale
Karl Williamson [Mon, 2 Jan 2017 22:58:23 +0000 (15:58 -0700)]
APItest/t/handy.t: Skip locale tests when not in locale

In XS code, the macros that pay attention to locale don't check if they
are being called from within the scope of 'use locale'; they assume that
the code calling them wouldn't be doing so unless appropriate.  That's
not true of Perl-level code.  I forgot that when writing these tests.
Normally it doesn't show up as a problem as the underlying locale is the
C locale, which on almost all platforms has the effect of not being in a
locale.  But the VMS C locale is special, and so doesn't meet the
assumptions of these tests.  The solution is to skip locale-aware macros
unless we are testing locale.

7 years agoRemove unnecessary pointer math.
Andy Lester [Sat, 24 Dec 2016 05:53:19 +0000 (23:53 -0600)]
Remove unnecessary pointer math.

7 years agoRT#113960: perl5db should ignore /dev/tty on non-Unix systems
James E Keenan [Wed, 4 Jan 2017 18:17:19 +0000 (18:17 +0000)]
RT#113960: perl5db should ignore /dev/tty on non-Unix systems

If a Win32 system happens to have a \dev\tty file at the root of the current
drive, we were incorrectly treating that as an indicator that the system is
in fact Unix-like.

Fix this by looking at the filesystem for that file only after considering
all the OS platforms that we know aren't Unix-like in that way.

7 years agoRT#130487: fix stack-management bug in Data::Dumper
Aaron Crane [Wed, 4 Jan 2017 15:42:32 +0000 (15:42 +0000)]
RT#130487: fix stack-management bug in Data::Dumper

This was introduced when Data::Dumper acquired the ability to call
B::Deparse from its XS implementation.

7 years ago[perl #130495] /x comment skipping stops a byte short
Hugo van der Sanden [Wed, 4 Jan 2017 14:52:21 +0000 (14:52 +0000)]
[perl #130495] /x comment skipping stops a byte short

If that byte was part of a utf-8 character, this caused inappropriate
"malformed utf8" warnings or assertions.

In principle this should also skip the newline, but failing to do so
is safe.

7 years agoPlace discussion of postfix under DESCRIPTION.
James E Keenan [Fri, 27 May 2016 00:29:14 +0000 (20:29 -0400)]
Place discussion of postfix under DESCRIPTION.

Make subheadings more consistent.  Say what the WARNING is about.

For:  RT #128250, based on suggestions by Father Chrysostomos.

7 years agotoke.c: Clarify comment
Karl Williamson [Wed, 28 Dec 2016 04:25:39 +0000 (21:25 -0700)]
toke.c: Clarify comment

7 years agotoke.c: Keep better track for avoiding work in tr///
Karl Williamson [Wed, 28 Dec 2016 04:15:43 +0000 (21:15 -0700)]
toke.c: Keep better track for avoiding work in tr///

As explained in the comments, tr/// creates byte map tables for bytes
0-255 if everything is below 256.  If something is higher than that,
special handling is required (currently a swash), and so there is no
point in creating the tables here by expanding each range.  Prior to
this commit, it realized this on a per-range basis, not expanding ranges
which extend above 255.  This commit changes that so if any time it
finds something above 255, it remembers that and skips the expansion of
all future ranges encountered.

This was done without adding any extra tests outside the specific tr///
code.

7 years agotoke.c: Fix comment that said the opposite of what was meant
Karl Williamson [Wed, 28 Dec 2016 04:20:13 +0000 (21:20 -0700)]
toke.c: Fix comment that said the opposite of what was meant

7 years agotoke.c: Simplify expression
Karl Williamson [Wed, 28 Dec 2016 03:55:13 +0000 (20:55 -0700)]
toke.c: Simplify expression

Unless there's a reason its needed, I prefer not to set a variable
within an 'if', as it increases the reader's cognitive load.

7 years agoSV_UTF8_NO_ENCODING is no longer used
Karl Williamson [Wed, 28 Dec 2016 03:52:20 +0000 (20:52 -0700)]
SV_UTF8_NO_ENCODING is no longer used

It once had meaning under 'use encoding';

7 years agotoke.c: White-space only
Karl Williamson [Fri, 19 Aug 2016 03:41:08 +0000 (21:41 -0600)]
toke.c: White-space only

Indent after previous commit added new blocks, and a couple other white
space adjustments

7 years agotoke.c: Potentially avoid work when converting to UTF-8
Karl Williamson [Fri, 19 Aug 2016 00:54:13 +0000 (18:54 -0600)]
toke.c: Potentially avoid work when converting to UTF-8

Some code points < 256 are the same whether represented in UTF-8, or
not.  Others change to require 2 bytes to represent in UTF-8.  When
parsing a string, using UTF-8 is avoided unless necessary, because of
the extra overhead required for processing UTF-8.  This means that when,
during the parse, we discover we need to convert to UTF-8, we have to,
in effect, reparse whatever we have so far to make sure those code
points that differ under UTF-8 get their proper representation.  This
reparsing would not be necessary if we know that the string doesn't have
such code points.

It turns out that keeping track of having seen UTF-8 variant code points
is cheap, requiring no extra branch instructions.  And the payoff is
potentially large, avoiding having to reparse the string.  This commit
changes to keep track.

7 years agotoke.c: Reorder if/else branches
Karl Williamson [Mon, 26 Dec 2016 04:53:04 +0000 (21:53 -0700)]
toke.c: Reorder if/else branches

It is easier to read code if the trivial branch is follows immediately
after the 'if'.

7 years agotoke.c: Fix too-small SvGROW()
Karl Williamson [Wed, 28 Dec 2016 02:37:33 +0000 (19:37 -0700)]
toke.c: Fix too-small SvGROW()

This might be a bug on EBCDIC, but not ASCII platforms.  The code forgot
that SvGROW takes a total size, and not an incremental size.  So, this
is most likely a no-op, but I believe there are no cases on ASCII
platforms where this actually needs to grow, and on EBCDIC, it would
only be very large, way above Unicode, code points.  Grows in later
iterations of the loop would recover to grow to the correct size, unless
this EBCDIC escape sequence was the final thing there.

7 years agotoke.c: Simplify a couple of expressions
Karl Williamson [Wed, 28 Dec 2016 02:20:08 +0000 (19:20 -0700)]
toke.c: Simplify a couple of expressions

By storing an intermediate result in a temporary, the final expression
is clearer.

7 years agotoke.c: Convert sv_grow to SvGROW
Karl Williamson [Wed, 28 Dec 2016 02:45:07 +0000 (19:45 -0700)]
toke.c: Convert sv_grow to SvGROW

The latter is preferred

7 years agoAPItest/t/handy.t: Fix for EBCDIC
Karl Williamson [Tue, 3 Jan 2017 01:08:57 +0000 (18:08 -0700)]
APItest/t/handy.t: Fix for EBCDIC

There were several instances where the native code point and the Unicode
equivalent were being conflated.

7 years agoperlhacktips: add some notes on TRUE and FALSE
Aaron Crane [Mon, 2 Jan 2017 15:12:45 +0000 (15:12 +0000)]
perlhacktips: add some notes on TRUE and FALSE

7 years agoAdd epigraphs for 5.22.3-RC5 and 5.24.1-RC5
Steve Hay [Mon, 2 Jan 2017 21:20:05 +0000 (21:20 +0000)]
Add epigraphs for 5.22.3-RC5 and 5.24.1-RC5

7 years agomakedepend.SH: omit trailing "." in progress messages
Aaron Crane [Mon, 2 Jan 2017 18:40:42 +0000 (18:40 +0000)]
makedepend.SH: omit trailing "." in progress messages

Since the message ends in the name of a file, I find that the trailing dot
makes it harder to select the filename in my terminal emulator.

7 years agoUpdate copyright year
Steve Hay [Mon, 2 Jan 2017 17:23:15 +0000 (17:23 +0000)]
Update copyright year

7 years agoHandle chop(@a =~ tr///)
David Mitchell [Mon, 2 Jan 2017 16:37:27 +0000 (16:37 +0000)]
Handle chop(@a =~ tr///)

RT #130198

'chop(@x =~ tr/1/1/)' crashed with an assertion failure. Ditto for chomp.

There are two quirks which together cause this. First, the op tree for
a tr// is different from other bind ops:

    $ perl -MO=Concise -e'$x =~ m/a/'
    5  <@> leave[1 ref] vKP/REFC ->(end)
    1     <0> enter ->2
    2     <;> nextstate(main 1 -e:1) v:{ ->3
    4     </> match(/"a"/) vKS ->5
    -        <1> ex-rv2sv sK/1 ->4
    3           <#> gvsv[*x] s ->4

    $ perl -MO=Concise -e'$x =~ tr/a/b/'
    5  <@> leave[1 ref] vKP/REFC ->(end)
    1     <0> enter ->2
    2     <;> nextstate(main 1 -e:1) v:{ ->3
    -     <1> null vKS/2 ->5
    -        <1> ex-rv2sv sKRM/1 ->4
    3           <#> gvsv[*x] s ->4
    4        <"> trans sS ->5

Note that the argument for the match is a child of the match, while the
arg of the trans is an (earlier) sibing of the trans (linked by a common
null parent).

The normal code path that croaks when e.g. a match is seen in an lvalue
context,

    $ perl -e'chop(@a =~ /a/)'
    Can't modify pattern match (m//) in chop at -e line 1, near "/a/)

is skipped, since lvalue() is only called for the first child of a null op.

Fixing this is as simple as calling lvalue() on the RHS too if the RHS is
a trans op.

The second issue is that chop and chomp are special-cased not to flatten
an array; so

    @b = 10..99;
    chop $a, @b, $c;

pushes 3 items on the stack to pass to pp_chop, rather than 102. pp_chop()
itself then iterates over any array args.

The compiler was seeing the rv2av op in chop(@a =~ tr///) and was setting
the OPf_REF (don't flatten) flag on it. Which then caused pp_trans to
panic when its arg was an AV rather than a string.

This second issue is now moot, since after the fix suggested above, we
will have croaked before we reach the place where OPf_REF would be set.

This commit adds lots of tests, since tr/a/a/ and tr/a/b/r are
special-cased in terms of whether they are regarded as modifying the
var they are bound to.

7 years ago5.22.3-RC5 and 5.24.1-RC5 today
Steve Hay [Mon, 2 Jan 2017 15:07:59 +0000 (15:07 +0000)]
5.22.3-RC5 and 5.24.1-RC5 today

7 years agoperldelta for adf9095d629bebb27169b0f3b03f75ee974da100
James E Keenan [Sun, 1 Jan 2017 15:12:56 +0000 (10:12 -0500)]
perldelta for adf9095d629bebb27169b0f3b03f75ee974da100

7 years agoFix a null pointer dereference segfault in Storable.
John Lightsey [Sun, 25 Dec 2016 02:41:40 +0000 (21:41 -0500)]
Fix a null pointer dereference segfault in Storable.

At point where the retrieve_code logic was unable to read the string that
contained the code.

Also fix several locations where retrieve_other was called with a null context
pointer. This also resulted in a null pointer dereference.

Committer:  Add tests adapted from submitter's test program.

For: RT #130098

7 years agoUpgrade to threads 2.12
jdhedden [Sat, 31 Dec 2016 17:51:35 +0000 (12:51 -0500)]
Upgrade to threads 2.12

For: RT # 130469

7 years agoUpgrade to threads::shared 1.54
jdhedden [Sat, 31 Dec 2016 17:33:47 +0000 (12:33 -0500)]
Upgrade to threads::shared 1.54

7 years agoClarify that 'installhtml' is intended only for use in the Perl 5 core distribution.
jkeenan [Mon, 13 Aug 2012 01:55:42 +0000 (21:55 -0400)]
Clarify that 'installhtml' is intended only for use in the Perl 5 core distribution.

For: RT # 114466

7 years agoUpgrade to threads::shared 1.53
jdhedden [Fri, 30 Dec 2016 17:37:21 +0000 (12:37 -0500)]
Upgrade to threads::shared 1.53

For: RT #130457

7 years agoPrevent tests from getting hung up on 'NonStop' option.
James E Keenan [Fri, 30 Dec 2016 17:30:17 +0000 (12:30 -0500)]
Prevent tests from getting hung up on 'NonStop' option.

For:  https://rt.perl.org/Ticket/Display.html?id=130445

Thanks to Håkon Hægland for report and suggestion.  Simplify revisions, per
feedback from Aaron Crane.

7 years agoDiscuss Porting/sync-with-cpan -- the simpler usage -- first.
James E Keenan [Fri, 30 Dec 2016 14:58:17 +0000 (09:58 -0500)]
Discuss Porting/sync-with-cpan -- the simpler usage -- first.

Incorporate feedback from Aaron Crane.

7 years ago[MERGE] Further improvements to Porting/sync-with-cpan
Aaron Crane [Fri, 30 Dec 2016 18:48:36 +0000 (18:48 +0000)]
[MERGE] Further improvements to Porting/sync-with-cpan

With these changes, all the recent module imports could have been handled
automatically; and applying it to a tricky case that hasn't yet been
imported does now at least yield better advice on how to proceed.

7 years agoPorting/sync-with-cpan: another preflight check
Aaron Crane [Fri, 30 Dec 2016 18:27:14 +0000 (18:27 +0000)]
Porting/sync-with-cpan: another preflight check

7 years agoRevert "Porting/sync-with-cpan: apply --jobs=N when running module tests"
Aaron Crane [Fri, 30 Dec 2016 18:00:45 +0000 (18:00 +0000)]
Revert "Porting/sync-with-cpan: apply --jobs=N when running module tests"

This reverts commit 06998c55f9d56cbee761af0d6dc5ec06fcee3c62.

It turns out that some CPAN modules' test suites fail when run in parallel.
For example, DB_File has three test files, all of which create database files
of the same names. (I'm slightly puzzled as to why I don't see failures from
that module whenever running Perl's test suite in parallel; my guess is that,
when only a few test files are being run, it's much more likely that the
tests will be run simultaneously.)

We can submit patches for modules with serial-only test suites, but for now
at least, the best course of action seems to be for sync-with-cpan to run
modules' test suites serially.

7 years agoPorting/sync-with-cpan: handle unwritable files in tarballs
Aaron Crane [Fri, 30 Dec 2016 16:07:05 +0000 (16:07 +0000)]
Porting/sync-with-cpan: handle unwritable files in tarballs

If the tarball contains an unwritable file, we were throwing an exception
when trying to open the file for appending. Opening the file isn't actually
necessary for bumping the file's timestamp, which was the intention of that
code. However, it's a good idea to make the file locally-writable anyway, so
that if the user later needs to edit it, they can do so easily.

7 years agoPorting/sync-with-cpan: remove needless loop
Aaron Crane [Fri, 30 Dec 2016 16:04:35 +0000 (16:04 +0000)]
Porting/sync-with-cpan: remove needless loop

The de_exec() routine is only ever called with one argument at a time, so
simplify it.

7 years agoPorting/sync-with-cpan: fix bug in updating Maintainers.pl
Aaron Crane [Fri, 30 Dec 2016 15:40:16 +0000 (15:40 +0000)]
Porting/sync-with-cpan: fix bug in updating Maintainers.pl

We must look for $module, not $cpan_mod, because the former is specifically
the key in %Modules under which we found the details for this dist.

7 years agoPorting/sync-with-cpan: try to change "::" to "-" in module name
Aaron Crane [Fri, 30 Dec 2016 15:26:37 +0000 (15:26 +0000)]
Porting/sync-with-cpan: try to change "::" to "-" in module name

This is needed for cases like IO-Compress when the user asks for
"IO::Compress".

In addition, if we still can't find the module, be more explicit about what
the problem is.

7 years agoPorting/sync-with-cpan: offer advice in the face of CUSTOMIZED
Aaron Crane [Fri, 30 Dec 2016 15:05:42 +0000 (15:05 +0000)]
Porting/sync-with-cpan: offer advice in the face of CUSTOMIZED

7 years ago[MERGE] Improve Porting/sync-with-cpan
Aaron Crane [Fri, 30 Dec 2016 14:01:57 +0000 (14:01 +0000)]
[MERGE] Improve Porting/sync-with-cpan

The original goal of this sequence of patches was to address RT#130375. That
ticket proposes extending the release manager's guide with discussion of
what regen/lib_cleanup.pl does, and why it might sometimes be needed, and
thus why Porting/sync-with-cpan might yield a porting-test failure when
t/porting/regen.t detects that it needs to be run.

However, I find the RMG is already relatively bulky, and therefore hard to
navigate; so adding more text to it would exacerbate that problem. In
addition, it seems much better to merely fix this problem: we can always run
regen/lib_cleanup.pl, and if it makes any changes, those changes can be
committed along with the updated CPAN module being imported.

This merge also contains a few other improvements to Porting/sync-with-cpan:

- The log file it generates is now listed in .gitignore

- It allows specifying the module name with "-" rather than "::" as a name
  separator

- A bug that prevented the new module's tests from being run is now fixed

- The MANIFEST is now rewritten to accommodate any file deletions introduced
  by the updated CPAN module

- The messages emitted have been reworked slightly for clarity; in
  particular, "Fixing MANIFEST" will no longer be followed by a confusing
  and scary "'MANIFEST' is NOT sorted properly" message

- It now takes a --jobs option, which if supplied is used both for executing
  make and running the module's tests

- The --tarball option now works when the tarball isn't in the current
  directory

- It runs a few additional preflight checks that detect mistakes I found
  myself making

These changes have been tested by using Porting/sync-with-cpan to import
Test::Simple into blead as of 54f6f377a29af7d60918c003fc2c462439c340bd,
since that was the triggering case for RT#130375.

7 years agoPorting/sync-with-cpan: allow out-of-tree --tarball file
Aaron Crane [Fri, 30 Dec 2016 13:51:04 +0000 (13:51 +0000)]
Porting/sync-with-cpan: allow out-of-tree --tarball file

Previously, in this situation, we correctly used Archive::Tar to extract the
contents of the tarball under cpan/, but then tried to look for the files in
a nonexistent directory alongside the original tarball.

7 years agoPorting/sync-with-cpan: more preflight checks for --tarball
Aaron Crane [Fri, 30 Dec 2016 13:46:11 +0000 (13:46 +0000)]
Porting/sync-with-cpan: more preflight checks for --tarball

If the file supplied doesn't exist (or names a directory), we'll get a
failure from Archive::Tar after having already made some changes.

7 years agoPorting/sync-with-cpan: avoid unless/else
Aaron Crane [Fri, 30 Dec 2016 13:42:51 +0000 (13:42 +0000)]
Porting/sync-with-cpan: avoid unless/else

7 years agoPorting/sync-with-cpan: bail out early if Configure hasn't been run
Aaron Crane [Fri, 30 Dec 2016 11:33:37 +0000 (11:33 +0000)]
Porting/sync-with-cpan: bail out early if Configure hasn't been run

7 years agoPorting/sync-with-cpan: factor out internal WIN32 constant
Aaron Crane [Fri, 30 Dec 2016 11:32:39 +0000 (11:32 +0000)]
Porting/sync-with-cpan: factor out internal WIN32 constant

7 years agoPorting/sync-with-cpan: apply --jobs=N when running module tests
Aaron Crane [Fri, 30 Dec 2016 11:51:38 +0000 (11:51 +0000)]
Porting/sync-with-cpan: apply --jobs=N when running module tests

This requires switching from t/TEST to t/harness.

7 years agoPorting/sync-with-cpan: add --jobs option
Aaron Crane [Thu, 29 Dec 2016 19:01:51 +0000 (19:01 +0000)]
Porting/sync-with-cpan: add --jobs option

7 years agoPorting/sync-with-cpan: avoid "Attempting to …" message
Aaron Crane [Thu, 29 Dec 2016 18:54:56 +0000 (18:54 +0000)]
Porting/sync-with-cpan: avoid "Attempting to …" message

That message doesn't have a follow-up along the lines of "and it worked", so
the user might be left wondering what happened.

7 years agoPorting/sync-with-cpan: improve advice emitted at end
Aaron Crane [Thu, 29 Dec 2016 18:40:54 +0000 (18:40 +0000)]
Porting/sync-with-cpan: improve advice emitted at end

7 years agoPorting/sync-with-cpan: run regen/lib_cleanup.pl if possibly needed
Aaron Crane [Thu, 29 Dec 2016 18:17:45 +0000 (18:17 +0000)]
Porting/sync-with-cpan: run regen/lib_cleanup.pl if possibly needed

7 years agoPorting/sync-with-cpan: delete entries from MANIFEST if needed
Aaron Crane [Thu, 29 Dec 2016 16:51:09 +0000 (16:51 +0000)]
Porting/sync-with-cpan: delete entries from MANIFEST if needed

7 years agoPorting/sync-with-cpan: run manisort with --quiet
Aaron Crane [Thu, 29 Dec 2016 16:37:52 +0000 (16:37 +0000)]
Porting/sync-with-cpan: run manisort with --quiet

Without this, the user is likely to see consecutive lines saying "Fixing
MANIFEST" and "'MANIFEST' is NOT sorted properly", which looks pretty scary.

7 years agoPorting/sync-with-cpan: run manisort under the current perl
Aaron Crane [Thu, 29 Dec 2016 16:35:10 +0000 (16:35 +0000)]
Porting/sync-with-cpan: run manisort under the current perl

7 years agoPorting/sync-with-cpan: do in fact run the new dist's tests
Aaron Crane [Thu, 29 Dec 2016 13:07:35 +0000 (13:07 +0000)]
Porting/sync-with-cpan: do in fact run the new dist's tests

At the point we look for the dist's test files, we've just chdir-ed into
Perl's t/ directory (since we need to be able to run the ./perl binary in
that directory), so the tests are therefore under ../cpan/$dist.

7 years agoPorting/sync-with-cpan: accept dist name instead of package name
Aaron Crane [Thu, 29 Dec 2016 13:04:36 +0000 (13:04 +0000)]
Porting/sync-with-cpan: accept dist name instead of package name

Since the directories in cpan/ are named for the dist, this is perhaps more
obvious, at least in some situations.

7 years agoPorting/sync-with-cpan: mention generation of make.log
Aaron Crane [Thu, 29 Dec 2016 13:01:28 +0000 (13:01 +0000)]
Porting/sync-with-cpan: mention generation of make.log

And factor that filename out into a variable.

7 years agoPorting/sync-with-cpan: don't reimplement tmpdir()
Aaron Crane [Fri, 30 Dec 2016 10:18:05 +0000 (10:18 +0000)]
Porting/sync-with-cpan: don't reimplement tmpdir()

7 years agogitignore build product from Porting/sync-with-cpan
Aaron Crane [Thu, 29 Dec 2016 12:57:17 +0000 (12:57 +0000)]
gitignore build product from Porting/sync-with-cpan

7 years agoperldelta for commit 3e736f1def24bdc1982c2d308a5d3ca4a6f47313
James E Keenan [Fri, 30 Dec 2016 02:25:22 +0000 (21:25 -0500)]
perldelta for commit 3e736f1def24bdc1982c2d308a5d3ca4a6f47313

7 years agoUpgrade Compress-Raw-Bzip2 to CPAN version 2.070.
Paul Marquess [Fri, 30 Dec 2016 02:23:32 +0000 (21:23 -0500)]
Upgrade Compress-Raw-Bzip2 to CPAN version 2.070.

7 years agoperldelta for commit 182b56428366fc161308e7f68a46142f1e566eaf
James E Keenan [Thu, 29 Dec 2016 21:56:32 +0000 (16:56 -0500)]
perldelta for commit 182b56428366fc161308e7f68a46142f1e566eaf

7 years agoUpgrade Compress-Raw-Zlib to CPAN version 2.070.
Paul Marquess [Thu, 29 Dec 2016 21:53:43 +0000 (16:53 -0500)]
Upgrade Compress-Raw-Zlib to CPAN version 2.070.

7 years agoDon't define Perl_isFOO_lc in the regex extension.
Craig A. Berry [Thu, 29 Dec 2016 20:03:43 +0000 (14:03 -0600)]
Don't define Perl_isFOO_lc in the regex extension.

Otherwise it ends up multiply defined, which annoys the VMS linker
(and probably the AIX linker too).

7 years agoperldelta for commit 74f485aaef93391aca61d5b59d7992900277fb7c
James E Keenan [Thu, 29 Dec 2016 17:46:50 +0000 (12:46 -0500)]
perldelta for commit 74f485aaef93391aca61d5b59d7992900277fb7c

7 years agoUpdate DB_File from CPAN version 1.838 to 1.840.
James E Keenan [Thu, 29 Dec 2016 17:39:12 +0000 (12:39 -0500)]
Update DB_File from CPAN version 1.838 to 1.840.

From Changes:

    1.840 29 Dec 2016

       * #119569: Failed to install DB_File-1.839 into Linux

    1.839 29 Dec 2016

       * #119557: DB_File.xs: unused-parameter warnings
       * #107642: unused arg

7 years agoSilence one warnings generated during 'make' by clang.
Jerry D. Hedden [Wed, 28 Dec 2016 16:37:45 +0000 (11:37 -0500)]
Silence one warnings generated during 'make' by clang.

See: https://rt.cpan.org/Ticket/Display.html?id=119529

Committer:  Update version number in module's POD.  Add perldelta entry.

7 years agohandy.h: Add missing right paren in macro
Karl Williamson [Thu, 29 Dec 2016 15:19:06 +0000 (08:19 -0700)]
handy.h: Add missing right paren in macro

This only affected EBCDIC builds, causing syntax errors.

7 years agoAPItest.xs: Silence compiler warnings
Karl Williamson [Thu, 29 Dec 2016 04:49:06 +0000 (21:49 -0700)]
APItest.xs: Silence compiler warnings

See: http://www.nntp.perl.org/group/perl.perl5.porters/2016/12/msg241877.html

7 years agoFix tiny POD typo
Aaron Crane [Thu, 29 Dec 2016 12:48:38 +0000 (12:48 +0000)]
Fix tiny POD typo