This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
8 years agoBuild fixes for Win32 after the Coverity smoke.
Jarkko Hietaniemi [Thu, 29 May 2014 20:56:28 +0000 (16:56 -0400)]
Build fixes for Win32 after the Coverity smoke.

(for 375ed12a42c6092b1af1d8e395bf3dadd9a66e48)

8 years agoGet rid of "grep empty(sub)expression" noise.
Jarkko Hietaniemi [Thu, 29 May 2014 19:16:47 +0000 (15:16 -0400)]
Get rid of "grep empty(sub)expression" noise.

In OS X (and assumedly *BSD) Configure output starts with:

grep empty(sub)expression

apparently because plain 'grep' understands the 'os\(/\|\)2'
somewhat differently (BRE vs ERE, RTFM re_format(7))

Cure: redirect the stderr of grep to stdout (which is then promptly
redirected to /dev/null).  The grep will still fail, and not take
the OS/2 (or DJGPP) branch.

8 years agoWe cannot assert(sv) since sv can be validly null
Jarkko Hietaniemi [Thu, 29 May 2014 19:14:34 +0000 (15:14 -0400)]
We cannot assert(sv) since sv can be validly null
(see the top of the function), but we can test it.

8 years agoDevel::PPPort 3.24 from CPAN.
Jarkko Hietaniemi [Thu, 29 May 2014 18:17:18 +0000 (14:17 -0400)]
Devel::PPPort 3.24 from CPAN.

8 years agoNo more x2p.
Jarkko Hietaniemi [Thu, 29 May 2014 17:56:35 +0000 (13:56 -0400)]
No more x2p.

8 years agoVersion bumping thanks to the Coverity deluge.
Jarkko Hietaniemi [Thu, 29 May 2014 17:52:25 +0000 (13:52 -0400)]
Version bumping thanks to the Coverity deluge.

8 years agoFollowup to 316ebaf (aka perl #121894).
Jarkko Hietaniemi [Thu, 29 May 2014 17:24:36 +0000 (13:24 -0400)]
Followup to 316ebaf (aka perl #121894).

Adding asserts to more spots.

Fix for Coverity perl5 CIDs 28962,28968,28969:
CID ...: Dereference after null check (FORWARD_NULL)
var_deref_op: Dereferencing null pointer p->q

8 years agoBump version for Devel::Peek
Karl Williamson [Thu, 29 May 2014 17:33:10 +0000 (11:33 -0600)]
Bump version for Devel::Peek

Commit 316ebaf2966c5b6fd47a9d1dc6fb64fcbd262379 changed this module
without changing the version number

8 years agofcntl receiving -1 from fileno, fcntl failing.
Jarkko Hietaniemi [Thu, 29 May 2014 16:36:28 +0000 (12:36 -0400)]
fcntl receiving -1 from fileno, fcntl failing.

(Also very few spots of negative numgroups for getgroups(),
and fgetc() return, but almost all checking is for fcntl.)

(merged fix for perl #121743 and perl #121745: hopefully
picked up all the fixes-to-fixes from the ticket...)

Fix for Coverity perl5 CIDs 28990..29003,29005..29011,29013,
45354,45363,49926:

Argument cannot be negative (NEGATIVE_RETURNS) fd is
passed to a parameter that cannot be negative.

and CIDs 29004, 29012:
Argument cannot be negative (NEGATIVE_RETURNS)
num_groups is passed to a parameter that cannot be negative

and because of CIDs 29005 and 29006 also CID 28924.

In the first set of issues a fd is retrieved from PerlIO_fileno, and
that is then used in places like fstat(), fchown(), dup(), etc.,
without checking whether the fd is valid (>=0).

In the second set of issues a potentially negative
number is potentially passed to getgroups().

The CIDs 29005 and 29006 were a bit messy: fixing them needed also
resolving CID 28924 where the return value of fstat() was ignored,
and for completeness adding two croak calls (with perldiag updates):
a bit of a waste since it's suidperl code.

8 years agoInsert asserts to paths suspected by Coverity.
Jarkko Hietaniemi [Thu, 29 May 2014 15:37:56 +0000 (11:37 -0400)]
Insert asserts to paths suspected by Coverity.

Coverity suspects paths like this:

(1)

  p = foo();
  if (!p) p = bar();
  baz(p->q);

since it cannot prove that p is always non-NULL at the dereference.

(2) Or simply something like:

  mg = mg_find(...);
  foo(mg->blah);

Since mg_find() can fail returning NULL.

Adding assert() calls before the dereferences.  Testing with -DDEBUGGING.
Hopefully there are regular smokes doing the same.

[perl #121894]

Fix for Coverity perl5 CIDs 28950,28952..28955,28964,28967,28970..28795,49921:
CID ...: Dereference after null check (FORWARD_NULL)
var_deref_op: Dereferencing null pointer p->q

(TODO: Coverity perl5 CIDs 28962,28968,28969: the same issue, but would
conflict with already in-flight changes, prepare catch-up patch later.)
---
 dist/Data-Dumper/Dumper.xs | 1 +
 dump.c                     | 1 +
 ext/Devel-Peek/Peek.xs     | 1 +
 ext/XS-APItest/APItest.xs  | 1 +
 mg.c                       | 2 ++
 mro.c                      | 4 +++-
 op.c                       | 4 ++++
 perlio.c                   | 1 +
 pp_hot.c                   | 5 +++--
 regcomp.c                  | 3 +++
 regexec.c                  | 5 ++++-
 universal.c                | 2 +-
 util.c                     | 4 +++-
 13 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/dist/Data-Dumper/Dumper.xs b/dist/Data-Dumper/Dumper.xs
index 12c4ebd..23e0cf4 100644
--- a/dist/Data-Dumper/Dumper.xs
+++ b/dist/Data-Dumper/Dumper.xs
@@ -641,6 +641,7 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
      else {
        sv_pattern = val;
      }
+     assert(sv_pattern);
      rval = SvPV(sv_pattern, rlen);
      rend = rval+rlen;
      slash = rval;
diff --git a/dump.c b/dump.c
index 59be3e0..c2d72fd 100644
--- a/dump.c
+++ b/dump.c
@@ -471,6 +471,7 @@ Perl_sv_peek(pTHX_ SV *sv)
   finish:
     while (unref--)
  sv_catpv(t, ")");
+    /* XXX when is sv ever NULL? */
     if (TAINTING_get && SvTAINTED(sv))
  sv_catpv(t, " [tainted]");
     return SvPV_nolen(t);
diff --git a/ext/Devel-Peek/Peek.xs b/ext/Devel-Peek/Peek.xs
index 679efa5..b20fa94 100644
--- a/ext/Devel-Peek/Peek.xs
+++ b/ext/Devel-Peek/Peek.xs
@@ -450,6 +450,7 @@ PPCODE:
 BOOT:
 {
     CV * const cv = get_cvn_flags("Devel::Peek::Dump", 17, 0);
+    assert(cv);
     cv_set_call_checker(cv, S_ck_dump, (SV *)cv);

     XopENTRY_set(&my_xop, xop_name, "Dump");
diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs
index a51924d..18ba381 100644
--- a/ext/XS-APItest/APItest.xs
+++ b/ext/XS-APItest/APItest.xs
@@ -2096,6 +2096,7 @@ newCONSTSUB(stash, name, flags, sv)
                break;
         }
         EXTEND(SP, 2);
+        assert(mycv);
         PUSHs( CvCONST(mycv) ? &PL_sv_yes : &PL_sv_no );
         PUSHs((SV*)CvGV(mycv));

diff --git a/mg.c b/mg.c
index 76912bd..7f3339a 100644
--- a/mg.c
+++ b/mg.c
@@ -1675,6 +1675,7 @@ Perl_magic_clearisa(pTHX_ SV *sv, MAGIC *mg)
     same function. */
  mg = mg_find(mg->mg_obj, PERL_MAGIC_isa);

+    assert(mg);
     if (SvTYPE(mg->mg_obj) == SVt_PVAV) { /* multiple stashes */
  SV **svp = AvARRAY((AV *)mg->mg_obj);
  I32 items = AvFILLp((AV *)mg->mg_obj) + 1;
@@ -3437,6 +3438,7 @@ Perl_magic_copycallchecker(pTHX_ SV *sv, MAGIC *mg, SV *nsv,

     sv_magic(nsv, &PL_sv_undef, mg->mg_type, NULL, 0);
     nmg = mg_find(nsv, mg->mg_type);
+    assert(nmg);
     if (nmg->mg_flags & MGf_REFCOUNTED) SvREFCNT_dec(nmg->mg_obj);
     nmg->mg_ptr = mg->mg_ptr;
     nmg->mg_obj = SvREFCNT_inc_simple(mg->mg_obj);
diff --git a/mro.c b/mro.c
index 1b37ca7..ccf4bf4 100644
--- a/mro.c
+++ b/mro.c
@@ -638,12 +638,14 @@ Perl_mro_isa_changed_in(pTHX_ HV* stash)
                       hv_storehek(mroisarev, namehek, &PL_sv_yes);
                 }

-                if((SV *)isa != &PL_sv_undef)
+                if ((SV *)isa != &PL_sv_undef) {
+                    assert(namehek);
                     mro_clean_isarev(
                      isa, HEK_KEY(namehek), HEK_LEN(namehek),
                      HvMROMETA(revstash)->isa, HEK_HASH(namehek),
                      HEK_UTF8(namehek)
                     );
+                }
             }
         }
     }
diff --git a/op.c b/op.c
index 796cb03..79621ce 100644
--- a/op.c
+++ b/op.c
@@ -2907,6 +2907,7 @@ S_my_kid(pTHX_ OP *o, OP *attrs, OP **imopsp)
      S_cant_declare(aTHX_ o);
  } else if (attrs) {
      GV * const gv = cGVOPx_gv(cUNOPo->op_first);
+     assert(PL_parser);
      PL_parser->in_my = FALSE;
      PL_parser->in_my_stash = NULL;
      apply_attrs(GvSTASH(gv),
@@ -2929,6 +2930,7 @@ S_my_kid(pTHX_ OP *o, OP *attrs, OP **imopsp)
     else if (attrs && type != OP_PUSHMARK) {
  HV *stash;

+        assert(PL_parser);
  PL_parser->in_my = FALSE;
  PL_parser->in_my_stash = NULL;

@@ -10229,6 +10231,7 @@ Perl_ck_split(pTHX_ OP *o)
  op_append_elem(OP_SPLIT, o, newDEFSVOP());

     kid = kid->op_sibling;
+    assert(kid);
     scalar(kid);

     if (!kid->op_sibling)
@@ -10902,6 +10905,7 @@ Perl_cv_set_call_checker(pTHX_ CV *cv, Perl_call_checker ckfun, SV *ckobj)
  MAGIC *callmg;
  sv_magic((SV*)cv, &PL_sv_undef, PERL_MAGIC_checkcall, NULL, 0);
  callmg = mg_find((SV*)cv, PERL_MAGIC_checkcall);
+ assert(callmg);
  if (callmg->mg_flags & MGf_REFCOUNTED) {
      SvREFCNT_dec(callmg->mg_obj);
      callmg->mg_flags &= ~MGf_REFCOUNTED;
diff --git a/perlio.c b/perlio.c
index d4c43d0..e6ff9e4 100644
--- a/perlio.c
+++ b/perlio.c
@@ -2225,6 +2225,7 @@ PerlIOBase_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags)
  PerlIO_funcs * const self = PerlIOBase(o)->tab;
  SV *arg = NULL;
  char buf[8];
+ assert(self);
  PerlIO_debug("PerlIOBase_dup %s f=%p o=%p param=%p\n",
       self ? self->name : "(Null)",
       (void*)f, (void*)o, (void*)param);
diff --git a/pp_hot.c b/pp_hot.c
index 2cccc48..9c9d1e9 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -3078,6 +3078,7 @@ S_method_common(pTHX_ SV* meth, U32* hashp)
  const HE* const he = hv_fetch_ent(stash, meth, 0, *hashp);
  if (he) {
      gv = MUTABLE_GV(HeVAL(he));
+     assert(stash);
      if (isGV(gv) && GvCV(gv) &&
  (!GvCVGEN(gv) || GvCVGEN(gv)
                   == (PL_sub_generation + HvMROMETA(stash)->cache_gen)))
@@ -3085,9 +3086,9 @@ S_method_common(pTHX_ SV* meth, U32* hashp)
  }
     }

+    assert(stash || packsv);
     gv = gv_fetchmethod_sv_flags(stash ? stash : MUTABLE_HV(packsv),
-              meth, GV_AUTOLOAD | GV_CROAK);
-
+                                 meth, GV_AUTOLOAD | GV_CROAK);
     assert(gv);

     return isGV(gv) ? MUTABLE_SV(GvCV(gv)) : MUTABLE_SV(gv);
diff --git a/regcomp.c b/regcomp.c
index eaee604..3d49827 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -2007,6 +2007,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch,
     });

     re_trie_maxbuff = get_sv(RE_TRIE_MAXBUF_NAME, 1);
+    assert(re_trie_maxbuff);
     if (!SvIOK(re_trie_maxbuff)) {
         sv_setiv(re_trie_maxbuff, RE_TRIE_MAXBUF_INIT);
     }
@@ -14920,6 +14921,7 @@ S_set_ANYOF_arg(pTHX_ RExC_state_t* const pRExC_state,
  av_store(av, 0, (runtime_defns)
  ? SvREFCNT_inc(runtime_defns) : &PL_sv_undef);
  if (swash) {
+     assert(cp_list);
      av_store(av, 1, swash);
      SvREFCNT_dec_NN(cp_list);
  }
@@ -16609,6 +16611,7 @@ S_dumpuntil(pTHX_ const regexp *r, const regnode *start, const regnode *node,
         last= plast;

     while (PL_regkind[op] != END && (!last || node < last)) {
+        assert(node);
  /* While that wasn't END last time... */
  NODE_ALIGN(node);
  op = OP(node);
diff --git a/regexec.c b/regexec.c
index 362390b..ffab4f2 100644
--- a/regexec.c
+++ b/regexec.c
@@ -7010,6 +7010,8 @@ no_silent:
                 sv_commit = &PL_sv_yes;
             sv_yes_mark = &PL_sv_no;
         }
+        assert(sv_err);
+        assert(sv_mrk);
         sv_setsv(sv_err, sv_commit);
         sv_setsv(sv_mrk, sv_yes_mark);
     }
@@ -7620,6 +7622,7 @@ Perl__get_regclass_nonbitmap_data(pTHX_ const regexp *prog,
                     *only_utf8_locale_ptr = ary[2];
                 }
                 else {
+                    assert(only_utf8_locale_ptr);
                     *only_utf8_locale_ptr = NULL;
                 }

@@ -7641,7 +7644,7 @@ Perl__get_regclass_nonbitmap_data(pTHX_ const regexp *prog,
      }
      else if (doinit && ((si && si != &PL_sv_undef)
                                  || (invlist && invlist != &PL_sv_undef))) {
-
+ assert(si);
  sw = _core_swash_init("utf8", /* the utf8 package */
        "", /* nameless */
        si,
diff --git a/universal.c b/universal.c
index a29696d..65e02df 100644
--- a/universal.c
+++ b/universal.c
@@ -67,7 +67,7 @@ S_isa_lookup(pTHX_ HV *stash, const char * const name, STRLEN len, U32 flags)
     if (our_stash) {
  HEK *canon_name = HvENAME_HEK(our_stash);
  if (!canon_name) canon_name = HvNAME_HEK(our_stash);
-
+ assert(canon_name);
  if (hv_common(isa, NULL, HEK_KEY(canon_name), HEK_LEN(canon_name),
        HEK_FLAGS(canon_name),
        HV_FETCH_ISEXISTS, NULL, HEK_HASH(canon_name))) {
diff --git a/util.c b/util.c
index b90abe5..cd0afb6 100644
--- a/util.c
+++ b/util.c
@@ -850,15 +850,17 @@ Perl_fbm_instr(pTHX_ unsigned char *big, unsigned char *bigend, SV *littlestr, U

     {
  const MAGIC *const mg = mg_find(littlestr, PERL_MAGIC_bm);
- const unsigned char * const table = (const unsigned char *) mg->mg_ptr;
  const unsigned char *oldlittle;

+ assert(mg);
+
  --littlelen; /* Last char found by table lookup */

  s = big + littlelen;
  little += littlelen; /* last char */
  oldlittle = little;
  if (s < bigend) {
+     const unsigned char * const table = (const unsigned char *) mg->mg_ptr;
      I32 tmp;

    top2:
--
1.8.5.2 (Apple Git-48)

8 years agobump version on NDBM_File
David Mitchell [Thu, 29 May 2014 15:28:12 +0000 (16:28 +0100)]
bump version on NDBM_File

8 years agoO_BINARY versus O_TEXT.
Jarkko Hietaniemi [Thu, 29 May 2014 15:18:24 +0000 (11:18 -0400)]
O_BINARY versus O_TEXT.

O_BINARY and O_TEXT can be either different (mostly in Windowsy platforms,
and in some hybrids, and then they can be either effective or no-ops);
or equal (in UNIXy platforms, no-ops).  If they are no-ops, and especially
if one or both of them are zeros, one cannot even test for them (bit-and),
without introducing dead/non-sensical code.

[perl #121739]

Fix for Coverity perl5 CID 28948:
Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement mode[ix++] = 'b';

8 years agoStrengthen the ix zero min-clamping to panic.
Jarkko Hietaniemi [Thu, 29 May 2014 15:09:48 +0000 (11:09 -0400)]
Strengthen the ix zero min-clamping to panic.

Currently the ix cannot ever be less than zero (detected by Coverity).
Furthermore, it probably should never get less than zero, so panic if
that ever happens.

[perl #121897]

Fix for Coverity perl5 CID 28946:
at_least: At condition ix < 0, the value of ix must be at least 0.
dead_error_condition: The condition ix < 0 cannot be true.
Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement ix = 0;

8 years agoMakefile.SH: Module::Build is no longer there, stop copying it
Brian Fraser [Thu, 29 May 2014 11:47:31 +0000 (13:47 +0200)]
Makefile.SH: Module::Build is no longer there, stop copying it

This only affected 'make test' for cross-compilation builds; in
those, we try to copy files relevant to 'make test' to the target
system.

Since Module::Build is no longer part of the core, no need to
try to copy it over.

8 years agomake regen for uconfig.h
Brian Fraser [Thu, 29 May 2014 11:28:00 +0000 (13:28 +0200)]
make regen for uconfig.h

8 years agoFix for [perl #121963] 5.20.0-RC1 can't compile on Android
Brian Fraser [Thu, 29 May 2014 10:58:52 +0000 (12:58 +0200)]
Fix for [perl #121963] 5.20.0-RC1 can't compile on Android

On some native android builds, this was causing warnings and
possibly build errors before Config.pm was generated.

8 years agoSH_PATH should be $targetsh, not $sh
Brian Fraser [Thu, 29 May 2014 10:54:59 +0000 (12:54 +0200)]
SH_PATH should be $targetsh, not $sh

Due to a small oversight, this was reverted in the last metaconfig
update, and was preventing backticks/system/exec/two-arg-pipe-open
from working in some Android devices.

8 years agoMax size of the flop operator range.
Jarkko Hietaniemi [Thu, 29 May 2014 15:00:31 +0000 (11:00 -0400)]
Max size of the flop operator range.

Firstly, rename {max,j} -> {j,n} since j as the count is very confusing.

The j > SSize_t_MAX cannot (usually) fire.

(1) If the IV and SSize_t are the same (very likely) the count (an IV)
simply cannot be larger than the max of SSize_t.

(2) If IV is larger than SSize_t (e.g. long longs for IVs but only
32-bit pointers available) the count could conceivably be larger than
the max of SSize_t, but we still need to correctly dance around the
max: the signed maxima are tricky since the behavior of overflow is
undefined.

(3) The IV cannot be smaller than than SSize_t (e.g. I32 for IV but
64-bit pointers available): IV is supposed to be large enough to
contain pointers).

NOTE: this logic only protects against the wraparound, not against
an OOM: we will run out of memory long before we create (even)
SSize_t_MAX SVs. There is nothing magical about SSize_t as such,
except that it is a likely wraparound spot.

Fix for Coverity perl5 CID 28933:
Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
result_independent_of_operands: j > 9223372036854775807L
/* (ssize_t)(~((size_t)0) >> 1) */ is always false regardless of
The values of its operands. This occurs as the logical operand of if.

8 years agoUse system default locale only if there is one.
Jarkko Hietaniemi [Thu, 29 May 2014 14:40:02 +0000 (10:40 -0400)]
Use system default locale only if there is one.

(Currently, only Win32 has one.)

[perl #121865]

Fix for Coverity perl5 CID 28949:
Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement
name = system_default_locale;

8 years agoprintf %s, cast appropriately.
Jarkko Hietaniemi [Thu, 29 May 2014 14:34:28 +0000 (10:34 -0400)]
printf %s, cast appropriately.

[perl #121881]

Fix for Coverity perl5 CID 29050:
Printf arg type mismatch (PW.PRINTF_ARG_MISMATCH)
printf_arg_mismatch: argument is incompatible with corresponding
format string conversion

8 years agoUnused dTHX, even under threads.
Jarkko Hietaniemi [Thu, 29 May 2014 14:26:54 +0000 (10:26 -0400)]
Unused dTHX, even under threads.

[perl #121882].

Fix for Coverity perl5 CID 49935:
Unused pointer value (UNUSED_VALUE)
returned_pointer: Pointer my_perl returned by
pthread_getspecific(PL_thr_key) is never used.

8 years ago __APPLE__ is not Apple, use PERL_DARWIN instead.
Jarkko Hietaniemi [Thu, 29 May 2014 14:21:58 +0000 (10:21 -0400)]
 __APPLE__ is not Apple, use PERL_DARWIN instead.

See hints/darwin.sh for details.

8 years agoReindent the block. Whitespace-only change.
Jarkko Hietaniemi [Thu, 29 May 2014 14:17:51 +0000 (10:17 -0400)]
Reindent the block. Whitespace-only change.

Followup to 99e8c5.

8 years agoFix false nesting.
Jarkko Hietaniemi [Thu, 29 May 2014 14:13:08 +0000 (10:13 -0400)]
Fix false nesting.

[perl #121744]

Fix for Coverity perl5 CID 29014:
Nesting level does not match indentation (NESTING_INDENT_MISMATCH)

(Reindentation of the whole "if (!PL_use_safe_putenv)" block will follow.)

8 years agoUV casting to avoid intermediate sign extension.
Jarkko Hietaniemi [Thu, 29 May 2014 14:01:13 +0000 (10:01 -0400)]
UV casting to avoid intermediate sign extension.

[perl #121746]

Fix for Coverity perl5 CIDs 29069, 29070, 29071:
Unintended sign extension: ... ... if ... U8 (8 bits unsigned) ... 32
bits, signed ...  64 bits, unsigned ... is greater than 0x7FFFFFFF,
the upper bits of the result will all be 1.

8 years agoRemove x2p
Leon Timmermans [Wed, 21 May 2014 11:56:54 +0000 (13:56 +0200)]
Remove x2p

This removes find2perl, s2p and a2p from core. They have all been
released to CPAN as separate distributions.

8 years agoStandardize spelling of program name on American English.
Doug Bell [Thu, 29 May 2014 12:23:42 +0000 (08:23 -0400)]
Standardize spelling of program name on American English.

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

8 years agotemporary fix for [perl #121975] COW speedup lost after e8c6a474
Yves Orton [Thu, 29 May 2014 09:33:56 +0000 (11:33 +0200)]
temporary fix for [perl #121975] COW speedup lost after e8c6a474

Disable use of Perl_safesysmalloc_size by default. Only use it when PERL_USE_MALLOC_SIZE is defined.

Using Perl_safesysmalloc_size() perl cannot tell a deliberately preallocated buffer
which we probably dont want to COW from a malloc() preallocated buffer where we probably
dont care. Hopefully this fixes the slowdown observed on some platforms.

8 years agoQuad_t and Uquad_t cannot unpack as NVs.
Jarkko Hietaniemi [Tue, 6 May 2014 16:50:55 +0000 (12:50 -0400)]
Quad_t and Uquad_t cannot unpack as NVs.

If IVSIZE >= 8, a Quad_t is always >= IV_MIN, and <= IV_MAX, and an
Uquad_t is always (>= 0 aka UV_MIN and) <= UV_MAX; they cannot escape
their quadness and be NVs.  (This logic may fail if Quad_t is not 8
bytes, but then other things would no doubt fail.)

Also tighten the logic by adding HAS_QUAD, also for the pack case.

Fix for Coverity perl5 CID 28942.

8 years agosi_names access one past the end.
Jarkko Hietaniemi [Fri, 9 May 2014 22:49:25 +0000 (18:49 -0400)]
si_names access one past the end.

Fix for Coverity perl5 CID 45359.

8 years agocleanup on commit "Pseudo-fork dups arg array on argless calls"
Daniel Dragan [Tue, 29 Apr 2014 16:27:42 +0000 (12:27 -0400)]
cleanup on commit "Pseudo-fork dups arg array on argless calls"

less branching, less cpu intructions, easier to read

8 years agoput va_end() in the right place
Tony Cook [Thu, 22 May 2014 01:05:59 +0000 (11:05 +1000)]
put va_end() in the right place

8 years agobump $PerlIO::via::VERSION to 0.15
Tony Cook [Tue, 20 May 2014 05:06:16 +0000 (15:06 +1000)]
bump $PerlIO::via::VERSION to 0.15

8 years agoadd va_end() calls where missing for a va_start() or va_end().
Jarkko Hietaniemi [Wed, 23 Apr 2014 16:53:42 +0000 (12:53 -0400)]
add va_end() calls where missing for a va_start() or va_end().

Fix for Coverity perl5 CIDs 29225, 29226, 29227, 29228, 29229: Missing
varargs init or cleanup (VARARGS) missing va_end: va_end was not
called for foo.

Use of va_args must be finished off with va_end (in other words,
use of va_start or va_copy must be bracketed off with va_end).
In most platforms va_end is a no-op, but in some platforms it is
required for proper cleanup (or face stack smash, or memory leak).

Tony: move va_start() out of the declaration block

8 years agoremove comment that no longer applies
Tony Cook [Wed, 21 May 2014 00:45:58 +0000 (10:45 +1000)]
remove comment that no longer applies

8 years agobump $XS::APItest::VERSION to 0.61
Tony Cook [Tue, 20 May 2014 05:06:33 +0000 (15:06 +1000)]
bump $XS::APItest::VERSION to 0.61

8 years agoPointers set but then (immediately or very shortly) overwritten.
Jarkko Hietaniemi [Sat, 26 Apr 2014 01:52:54 +0000 (21:52 -0400)]
Pointers set but then (immediately or very shortly) overwritten.

Fix for Coverity perl5 CIDs 29203, 29207, 29211, 29214, 29217, 29218,
29222: Unused pointer value (UNUSED_VALUE) Pointer foo returned by
bar() is overwritten.

8 years agoUninitialized tmbuf.
Jarkko Hietaniemi [Wed, 7 May 2014 13:26:52 +0000 (09:26 -0400)]
Uninitialized tmbuf.

Fix for Coverity perl5 CID 29088: Uninitialized scalar variable (UNINIT)
uninit_use: Using uninitialized value tmbuf.tm_year.

There is a code path that can lead to accessing uninitialized tmbuf:
when the too-small or too-large time inputs to gmtime/localtime
happen.

- make it so that the tm_year is used only on successful code path:
  pp_sys.c
- add the gmtime failed / localtime failed errors to perldiag:
  pod/perldiag.pod
- test those errors: t/op/time.t

8 years agofd closes for failure paths.
Jarkko Hietaniemi [Wed, 7 May 2014 13:30:35 +0000 (09:30 -0400)]
fd closes for failure paths.

Fix for Coverity perl5 CIDs 29053, 29055, 29057: Resource leak (RESOURCE_LEAK)
leaked_handle: Handle variable fd going out of scope leaks the handle.

8 years agoMake UINT64_C()/INT64_C() available anytime HAS_QUAD is defined
Tony Cook [Thu, 29 May 2014 04:39:26 +0000 (14:39 +1000)]
Make UINT64_C()/INT64_C() available anytime HAS_QUAD is defined

Prevent the failure for 32-bit builds on C89 compilers introduced in
f4e3fd268af3.

8 years agoRevert "Upgrade Digest::SHA from version 5.88 to 5.91"
Karl Williamson [Thu, 29 May 2014 01:19:03 +0000 (19:19 -0600)]
Revert "Upgrade Digest::SHA from version 5.88 to 5.91"

This reverts commit d3013bbfc3b14e06bdc794c44d15e95024343369,
because it is breaking blead compiles of C++ because it is using 'class'
as a formal parameter, and that is a reserved word in C++

8 years agoRevert "Upgrade Term::Cap from version 1.15 to 1.16"
Karl Williamson [Wed, 28 May 2014 23:15:30 +0000 (17:15 -0600)]
Revert "Upgrade Term::Cap from version 1.15 to 1.16"

This reverts commit 60d2b2aebfceab38ad669bac181bb68e42c05cb2.
because we are getting test failures in blead:

../cpan/podlators/t/basic.t                                     (Wstat: 256 Tests: 15 Failed: 1)
  Failed test:  15
  Non-zero exit status: 1
../cpan/podlators/t/termcap.t                                   (Wstat: 512 Tests: 4 Failed: 2)
  Failed tests:  3-4
  Non-zero exit status: 2

I only bisected the first test to this commit, but it seems likely that
the second test is from it too.  We'll know soon enough

8 years agoDoug Bell is now a perl author
Tony Cook [Tue, 13 May 2014 01:05:56 +0000 (11:05 +1000)]
Doug Bell is now a perl author

8 years agomove given/when ~~ note below item introducing it
Doug Bell [Tue, 13 May 2014 00:50:41 +0000 (10:50 +1000)]
move given/when ~~ note below item introducing it

The note explaining to use $c ~~ $_ instead of $_ ~~ $c was put under the item
introducing all binary operators, and not the one mentioning the explicit
smartmatch operator.

8 years agoFixes for running a clean minitest (at least in OS X). - detect POSIX locale support...
Jarkko Hietaniemi [Sat, 19 Apr 2014 19:38:40 +0000 (15:38 -0400)]
Fixes for running a clean minitest (at least in OS X). - detect POSIX locale support differently: t/op/lc.t, t/uni/fold.t - detect PerlIO::scalar differently: t/op/pwent.t - bail out earlier if no dscl: t/op/op/pwent.t - avoid wide character warning: t/op/tr.t

8 years agoGrammatical correction.
James E Keenan [Thu, 29 May 2014 01:04:05 +0000 (03:04 +0200)]
Grammatical correction.

8 years agoperldelta for e16b8d1b7d43, 32f4893f37f4
Tony Cook [Thu, 29 May 2014 00:48:04 +0000 (10:48 +1000)]
perldelta for e16b8d1b7d4332f4893f37f4

8 years agoFix RT #62052: Math::BigFloat -> bdiv() in list context
pjacklam [Tue, 15 Apr 2014 21:03:18 +0000 (23:03 +0200)]
Fix RT #62052: Math::BigFloat -> bdiv() in list context

In list context, Math::BigFloat -> bdiv() returns the quotient and remainder.
By convention, this means that the quotient and remainder, q and r, after
dividing x by y, satisfies x = q*y + r. The current behaviour is to return x/y
and r, which do not satisfy this relation, and - more importantly - is not what
people expect.

dist/Math-BigInt/lib/Math/BigFloat.pm: Patched to fix this bug.

t/bigfltpm.inc and t/upgrade.inc: Fixed test cases to match the new behaviour.

8 years agoFix RT #43692: Math::BigFloat -> blog() is sometimes incorrect
pjacklam [Tue, 15 Apr 2014 15:57:02 +0000 (17:57 +0200)]
Fix RT #43692: Math::BigFloat -> blog() is sometimes incorrect

dist/Math-BigInt/lib/Math/BigFloat.pm: Patched as suggested in RT #43692.
blog(x) would sometimes return blog(2*x) when the accuracy was greater than
70 digits.

t/biglog.t: Fixed incorrect use of ok(). Edited a test case so it fails without
this patch.

8 years agoperldelta for 945313f0aee2, c4885710b2c3
Tony Cook [Thu, 29 May 2014 00:18:32 +0000 (10:18 +1000)]
perldelta for 945313f0aee2c4885710b2c3

8 years agobump dist/Math-BigInt/ $VERSIONs
Tony Cook [Tue, 13 May 2014 00:21:57 +0000 (10:21 +1000)]
bump dist/Math-BigInt/ $VERSIONs

8 years agoSync Math-BigInt blead vs. CPAN
Peter John Acklam [Wed, 9 Apr 2014 09:46:01 +0000 (11:46 +0200)]
Sync Math-BigInt blead vs. CPAN

Some POD changes, and a version number increase for consistency between all
.pm files, were accidentally included in the CPAN release of Math-BigInt
before they were included in blead. This patch gets the modules in sync.

8 years agoAdd comment about tmpnam().
Jarkko Hietaniemi [Wed, 28 May 2014 18:11:12 +0000 (14:11 -0400)]
Add comment about tmpnam().

8 years ago[perl #121431] - Document test.valgrind in perlhacktips.pod
Matthew Horsfall (alh) [Wed, 28 May 2014 17:53:19 +0000 (13:53 -0400)]
[perl #121431] - Document test.valgrind in perlhacktips.pod

8 years agoFix for Coverity perl5 CID 29068: Insecure temporary file (SECURE_TEMP) secure_temp...
Jarkko Hietaniemi [Thu, 24 Apr 2014 16:23:18 +0000 (12:23 -0400)]
Fix for Coverity perl5 CID 29068: Insecure temporary file (SECURE_TEMP) secure_temp: Calling mkstemp() without securely setting umask first.

The umask used for mkstemp should be secure, but umask 0600 has been
the required umask only since POSIX.1-2008.  In glibc 2.06 and earlier
the default was 0666, which is not secure.  And no explicit knowledge
of how well non-glibc platforms implement mkstemp.  Better err on the
side security, so set the umask temporarily to 0600, and then restore it.

8 years agoAnnotate intentional case fallthrough, or add breaks.
Jarkko Hietaniemi [Sun, 4 May 2014 23:44:24 +0000 (19:44 -0400)]
Annotate intentional case fallthrough, or add breaks.

Fix suspicious (*) switch cases found by Coverity by
annotating with either "/* FALLTHROUGH */" or adding a break;

The FALLTHROUGH was much more common, but the break turned
out to be the right choice in three spots.  All changes tested
to work.

(*) suspicious = case1 + code + case2, and neither flow control
(like break) nor fallthrough annotation between code and case2.

Fix for Coverity perl5 CIDs 28977..28989, 45353.

8 years agoFix for Coverity perl5 CID 28936: Wrong operator used (CONSTANT_EXPRESSION_RESULT)
Jarkko Hietaniemi [Fri, 25 Apr 2014 12:25:52 +0000 (08:25 -0400)]
Fix for Coverity perl5 CID 28936: Wrong operator used (CONSTANT_EXPRESSION_RESULT)

operator_confusion: ret->flags | 0x10 is always 1/true regardless of
the values of its operand. This occurs as the logical first operand of '&&'.
Did you intend to use '&' rather than '|'?

(confirmed by Karl Williamson)

8 years agoslen may be uninitialized.
Jarkko Hietaniemi [Wed, 7 May 2014 13:25:04 +0000 (09:25 -0400)]
slen may be uninitialized.

Fix for Coverity perl5 CID 29081: Uninitialized scalar
variable (UNINIT) uninit_use_in_call: Using uninitialized value slen when
calling Perl_croak.

If all fails, slen hasn't been set, and croak will be called with that.

8 years agoLeaked string in failure path.
Jarkko Hietaniemi [Wed, 7 May 2014 13:22:16 +0000 (09:22 -0400)]
Leaked string in failure path.

Fix for Coverity perl5 CID 29058: Resource leak
(RESOURCE_LEAK) leaked_storage: Variable codeset going out of scope leaks the
storage it points to.

The savepv-ed codeset was not freed in failure path.
(The save_input_locale is freed just few lines later.)

8 years ago[perl #121976] - Fix typo in pod
Matthew Horsfall (alh) [Wed, 28 May 2014 17:03:10 +0000 (13:03 -0400)]
[perl #121976] - Fix typo in pod

8 years ago[perl #121431] Add support for test.valgrind parallel testing.
Matthew Horsfall (alh) [Thu, 13 Mar 2014 12:39:48 +0000 (05:39 -0700)]
[perl #121431] Add support for test.valgrind parallel testing.

Output for each test will be printed inline when it finishes.

Sample usage (loud):

  TEST_JOBS=9 make test.valgrind

Sample usage (quiet):

  VG_OPTS='-q --leak-check=no --show-reachable=no' TEST_JOBS=9 make test.valgrind

8 years agoMove the PERL_GCC_BRACE_GROUPS_FORBIDDEN earlier.
Jarkko Hietaniemi [Wed, 28 May 2014 16:46:05 +0000 (12:46 -0400)]
Move the PERL_GCC_BRACE_GROUPS_FORBIDDEN earlier.

The PERL_UNUSED_RESULT needs it to avoid using the brace groups
when going -pedantic.

8 years agoRemove +x from Term::ANSIColor test files.
Nicholas Clark [Wed, 28 May 2014 16:38:14 +0000 (18:38 +0200)]
Remove +x from Term::ANSIColor test files.

Commit 5e64492f6452260c seems to have accidentally changed the mode of the
files.

8 years agoBump module versions following commit 3800c3188602fdac.
Nicholas Clark [Wed, 28 May 2014 16:36:18 +0000 (18:36 +0200)]
Bump module versions following commit 3800c3188602fdac.

8 years agoUpdate Term-ANSIColor to CPAN version 4.03
Chris 'BinGOs' Williams [Wed, 28 May 2014 15:38:12 +0000 (16:38 +0100)]
Update Term-ANSIColor to CPAN version 4.03

  [DELTA]

Term::ANSIColor 4.03 (2014-03-23)

    Switch the module build system to Module::Build, but still generate a
    Makefile.PL file for backward compatibility and for the use of Perl
    core.

    Fix typo in SYNOPSIS (colorstrip example) and duplicated word.
    Thanks, Olivier MenguĂ© and David Steinbrunner.  (#85480, #94006)

    Skip POD and some other style tests unless doing automated or release
    testing.  Skip POD spelling, coverage, and Perl::Critic tests unless
    doing author testing.  Use the Lancaster Consensus environment
    variables instead of RRA_MAINTAINER_TESTS.  (#93474)

    Add SEE ALSO reference to Win32::Console::ANSI.  (#87295)

8 years agoUpdated META files for CPAN-Meta upgrade
Chris 'BinGOs' Williams [Wed, 28 May 2014 15:25:32 +0000 (16:25 +0100)]
Updated META files for CPAN-Meta upgrade

8 years agoUpdate CPAN-Meta to CPAN version 2.141170
Chris 'BinGOs' Williams [Wed, 28 May 2014 15:21:19 +0000 (16:21 +0100)]
Update CPAN-Meta to CPAN version 2.141170

  [DELTA]

2.141170  2014-04-27 13:03:37-04:00 America/New_York

  [ADDED]

  - Added ability for CPAN::Meta::Converter to convert metadata fragments
    (incomplete portions of a metadata structure)

  [CHANGED]

  - Optimized internal use of JSON for datastructure cloning

  [FIXED]

  - Removed dependency on List::Util 1.33

  [DOCUMENTED]

  - Clarified language around 'dynamic_config' in the Spec

8 years agoUpgrade Unicode::Normalize from version 1.17 to 1.18
Steve Hay [Wed, 28 May 2014 13:39:41 +0000 (14:39 +0100)]
Upgrade Unicode::Normalize from version 1.17 to 1.18

8 years agoUpgrade Unicode::Collate from version 1.04 to 1.07
Steve Hay [Wed, 28 May 2014 11:37:53 +0000 (12:37 +0100)]
Upgrade Unicode::Collate from version 1.04 to 1.07

8 years agoUpgrade Term::Cap from version 1.15 to 1.16
Steve Hay [Wed, 28 May 2014 11:31:16 +0000 (12:31 +0100)]
Upgrade Term::Cap from version 1.15 to 1.16

8 years agoUpgrade Digest::SHA from version 5.88 to 5.91
Steve Hay [Wed, 28 May 2014 13:28:13 +0000 (14:28 +0100)]
Upgrade Digest::SHA from version 5.88 to 5.91

8 years agoTrailing comma in enum is not C89.
Jarkko Hietaniemi [Wed, 28 May 2014 15:43:53 +0000 (11:43 -0400)]
Trailing comma in enum is not C89.

8 years agoUse STRUCT_OFFSET() instead raw C99 offsetof().
Jarkko Hietaniemi [Wed, 28 May 2014 15:32:34 +0000 (11:32 -0400)]
Use STRUCT_OFFSET() instead raw C99 offsetof().

That is, offsetof() is available only iff not C89 pedantic gcc.

(Socket.xs needs fixing, too, but it's cpan/Socket.)

8 years agog++ cleanups.
Jarkko Hietaniemi [Wed, 28 May 2014 15:09:23 +0000 (11:09 -0400)]
g++ cleanups.

regcomp.c:11083: warning: suggest a space before ';' or explicit braces around empty body in 'for' statement

locale.c:1113: warning: comparison between signed and unsigned integer expressions

8 years agoUINT64_C/INT64_C logic shuffling.
Jarkko Hietaniemi [Wed, 28 May 2014 14:41:16 +0000 (10:41 -0400)]
UINT64_C/INT64_C logic shuffling.

(1) Prefer the native int/long over long long (not in C89!) or __int64.
(2) Define them only if necessary, they might be defined in <stdint.h> by C99
(3) However, note the C99.  They might not be available in strict C89.
(4) In OS X they are defined with ULL/LL, which will not be
    to the liking of C89 pedantic gcc.

8 years agoUse UINT64_C for UV constants.
Jarkko Hietaniemi [Wed, 28 May 2014 13:32:34 +0000 (09:32 -0400)]
Use UINT64_C for UV constants.

8 years agoHide the VMS error identifier SS$_NOPRIV, as customary.
Jarkko Hietaniemi [Wed, 28 May 2014 13:24:14 +0000 (09:24 -0400)]
Hide the VMS error identifier SS$_NOPRIV, as customary.

8 years agoOff-by-one in PL_fold_locale use.
Jarkko Hietaniemi [Wed, 7 May 2014 13:19:00 +0000 (09:19 -0400)]
Off-by-one in PL_fold_locale use.

Fix for Coverity perl5 CID 29033: Out-of-bounds read
 (OVERRUN) overrun-local: Overrunning array PL_fold_locale of 256 bytes at
 byte offset 256 using index c1 (which evaluates to 256).

- the "c1 > 256" was off-by-one, it needed to be "c1 > 255",
  it could have caused the PL_fold_locale to be accessed one past the end,
  at offset 256, but we have dodged the bullet thanks to the regex engine
  optimizing the bad case away before we hit it (analysis by Karl Williamson):
  regexec.c
- comment fixes (pointed out by Karl Williamson): regexec.c
- add tests to nail down the behaviour of fold matching
  for the last of Latin-1 (0xFF, lowercase which curiously does not have
  uppercase within Latin-1). and the first pure Unicode: t/re/pat.t

8 years agoCannot rotl u32 (hek_hash) by 64 bits.
Jarkko Hietaniemi [Tue, 13 May 2014 12:18:05 +0000 (08:18 -0400)]
Cannot rotl u32 (hek_hash) by 64 bits.

Fix for Coverity perl5 CID 28935:
Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
result_independent_of_operands: (unsigned long)entry->hent_hek->hek_hash >> 47 /* 64 - 17 */ is 0 regardless of the values of its operands. This occurs as the bitwise second operand of '|'.

8 years agofix sv_usepvn_flags's docs
Daniel Dragan [Wed, 14 May 2014 08:08:13 +0000 (04:08 -0400)]
fix sv_usepvn_flags's docs

Newx != malloc, mixing Newx and malloc leads to heap corruption on some
builds like Win32, use the official Perl API for allocating memory.

8 years agoUse the C_ARRAY_LENGTH.
Jarkko Hietaniemi [Mon, 19 May 2014 10:52:24 +0000 (06:52 -0400)]
Use the C_ARRAY_LENGTH.

Use the C_ARRAY_LENGTH instead of sizeof(c_array)/sizeof(c_array[0])
or sizeof(c_array)/sizeof(type_of_element_in_c_array), and C_ARRAY_END
for c_array + C_ARRAY_LENGTH(c_array).

While doing this found potential off-by-one error in sv.c:Perl_sv_magic:
how > C_ARRAY_LENGTH(PL_magic_data)
should probably have been
how >= C_ARRAY_LENGTH(PL_magic_data)
No tests fail, but this seems to be more of an internal sanity check.

8 years agoUCHARAT unnecessary with isSPACE().
Jarkko Hietaniemi [Tue, 6 May 2014 14:40:21 +0000 (10:40 -0400)]
UCHARAT unnecessary with isSPACE().

UCHARAT is not only unnecessary here (and no other spot in the core
seems to use UCHARAT with isFOO()), but it also narrows the type so
that some of the code in isSPACE() becomes unreachable.

Fix for Coverity perl5 CIDs 28937, 28938.

8 years agoDo not invert a NULL cp_list.
Jarkko Hietaniemi [Fri, 9 May 2014 15:05:30 +0000 (11:05 -0400)]
Do not invert a NULL cp_list.

Fix for Coverity perl5 CID 28966.

8 years agoFixup for [perl #121860]: g++ and VC are pickier about what's
Jarkko Hietaniemi [Wed, 28 May 2014 12:52:44 +0000 (08:52 -0400)]
Fixup for [perl #121860]: g++ and VC are pickier about what's
an expression and what's a statement.

8 years agoFix EXTEND changes under STRESS_REALLOC
Steffen Mueller [Wed, 28 May 2014 12:11:40 +0000 (14:11 +0200)]
Fix EXTEND changes under STRESS_REALLOC

As part of aad79b331c21c962b6e0ce7b8027aa625d7445ec, -DSTRESS_REALLOC was broken.
This should alleviate that.

8 years agoperlhist: add release date for 5.21.0
Ricardo Signes [Wed, 28 May 2014 11:59:05 +0000 (07:59 -0400)]
perlhist: add release date for 5.21.0

8 years agoAdd PERL_UNUSED_RESULT() and use that instead of the V_Gconvert().
Jarkko Hietaniemi [Mon, 28 Apr 2014 00:52:54 +0000 (20:52 -0400)]
Add PERL_UNUSED_RESULT() and use that instead of the V_Gconvert().

8 years agoAvoid "unused sp" if EXTEND is the last mentioning sp.
Jarkko Hietaniemi [Tue, 20 May 2014 11:44:06 +0000 (07:44 -0400)]
Avoid "unused sp" if EXTEND is the last mentioning sp.

Add PERL_UNUSED_VAR(sp) in case the EXTEND (or MEXTEND)
is the last thing mentioning the sp.

Addresses Coverity perl5 CIDs 29199..29201, 29204, 29205, 29206,
29208, 29210, 29212, 29213, 29215, 29216, 29219..29221.

8 years agoAccessing array before its start is dubious.
Jarkko Hietaniemi [Wed, 7 May 2014 16:04:37 +0000 (12:04 -0400)]
Accessing array before its start is dubious.

Fix by petermartini.

Fix for Coverity perl5 CID 28909:
Out-of-bounds access (ARRAY_VS_SINGLETON)
ptr_arith: Using &unsliced_keysv as an array.
This might corrupt or misinterpret adjacent memory locations.

8 years agoFor ptr masking use PTRSIZE-1, not nested conditional statement.
Jarkko Hietaniemi [Wed, 30 Apr 2014 11:49:07 +0000 (07:49 -0400)]
For ptr masking use PTRSIZE-1, not nested conditional statement.

8 years agorefactor pp_list
Daniel Dragan [Sun, 18 May 2014 02:10:01 +0000 (22:10 -0400)]
refactor pp_list

-move PL_stack_sp and PL_stack_base reads into the branch in which they
 are used, this also removes 1 var from being saved across the function
 call in GIMME, which removes saving and restoring 1 non-vol register
-write SP to PL_stack_sp (PUTBACK) only if it was changed
-POPMARK is mutable, it must execute on all branches

this reduced pp_list's machine code size of the function from 0x58 to
0x53 bytes on VC 2003 -01 32 bits

8 years agoMemory leak in Storable::dclone with STORABLE_freeze hook
Alex Solovey [Wed, 21 May 2014 06:27:14 +0000 (16:27 +1000)]
Memory leak in Storable::dclone with STORABLE_freeze hook

Storable documentation recommends using dclone shortcut in
STORABLE_freeze hook: "Unless you know better, serializing hook should
always say:
                sub STORABLE_freeze {
                    my ($self, $cloning) = @_;
                    return if $cloning; # Regular default serialization
                    ....
                }

            in order to keep reasonable dclone() semantics."

However, this causes a memory leak which is easy to observe with the
following small script:

=== storable-leak.plx ===
use Storable qw( dclone );

package Foo {
     sub new { return bless {}, __PACKAGE__ }

     sub STORABLE_freeze {
         my( $self, $cloning ) = @_;
         # Switch to regular default serialization results in memory leak
         return if $cloning;
         return 'Foo';
     }
}

my $d = Foo->new();
while(1)
{
     dclone( $d );
}
===

The leak is caused by missing cleanup of empty array value returned by
the hook. I've attached a simple patch for Storable-2.45 which fixes
this issue.

Reported in [perl #121928]

Amended to include version bump and Storable changelog entry.

8 years agoregen Makefile.SH
David Mitchell [Wed, 28 May 2014 10:04:12 +0000 (11:04 +0100)]
regen Makefile.SH

I ran regen/lib_cleanup.pl because porting/regen.t was failing.

No I don't understand this area at all. And I don't think 'make realclean'
is doing what its supposed to be doing.

8 years agoUpdate Test-Simple to CPAN version 1.001003
Chris 'BinGOs' Williams [Tue, 27 May 2014 21:49:00 +0000 (22:49 +0100)]
Update Test-Simple to CPAN version 1.001003

  [DELTA]

1.001003     Fri Mar  21 21:12:32 PST 2014
    * Doc updates for maintainer change

8 years agoUpdate autodie to CPAN version 2.25
Chris 'BinGOs' Williams [Tue, 27 May 2014 21:45:06 +0000 (22:45 +0100)]
Update autodie to CPAN version 2.25

  [DELTA]

2.25      2014-04-03 09:43:15EST+1100 Australia/Melbourne

        * DOCS: Spelling fixes in autodie::ScopeUtil
                (Courtesy Salvatore Bonaccorso)

2.24      2014-03-30 19:30:10EST+1100 Australia/Melbourne

        * FEATURE: Provide a stack backtrace when `Carp::Always` is enabled.
                   Note that sometimes this is not as pretty as it could
                   be, patches welcome.
                   (Thanks to Niels Thykier, GH #35)

        * BUGFIX: Fix situations where `no autodie` doesn't respect lexical
                  scope. (Thanks to Niels Thykier, GH #41, RT #72053,
                  RT #86396)

        * INTERNAL: Remove now unused variables in code (Niels Thykier).

        * DOCS: Make it extra-clear autodie doesn't check `print`.
                (Dave Rolsky, GH #39)

        * TEST: Removed obsolete boilerplate.t

        * TEST / INTERNAL: Enabled travis-ci for Perl 5.8

        * TEST: Stopped some Pod::Coverage tests failing under Perl 5.8

        * BUILD: Better support for building in a read-only directory
                 (courtesy Andrew Fresh, GH #46)

8 years agoUpdate Module-Metadata to CPAN version 1.000022
Chris 'BinGOs' Williams [Tue, 27 May 2014 21:38:10 +0000 (22:38 +0100)]
Update Module-Metadata to CPAN version 1.000022

  [DELTA]

1.000022 - 2014-04-29
  - work around change in comparison behaviour in Test::More 0.95_01 by being
    more explicit with our tests - now explicitly checking the string form of
    the extracted version, rather than the entire version object
  - ensure the extracted version is returned as a version object in all cases
    (RT#87782, Randy Stauner)

1.000021 - 2014-04-29
  - fix use of newer interface from File::Path, to avoid another prereq on
    older perls (Graham Knop, PR#7)
  - fixed all out of date prereq declarations

1.000020 - 2014-04-27
  - new is_indexable() object method (ether, RT#84357)
  - eliminated dependency on IO::File (and by virtue, XS) - thanks, leont!
  - removed cruft in test infrastructure left behind from separation from
    Module::Build (ether)
  - repository moved to https://github.com/Perl-Toolchain-Gang/Module-Metadata
  - .pm file is now wholly ascii, for nicer fatpacking (RT#95086)
  - some code micro-optimizations (Olivier MenguĂ©, PR#4)

8 years agoperldelta for a7752796dd84, 0baa1af7fb9e
Tony Cook [Wed, 28 May 2014 06:18:13 +0000 (16:18 +1000)]
perldelta for a7752796dd840baa1af7fb9e

8 years agobump Math::BigRat $VERSION
Tony Cook [Tue, 13 May 2014 00:09:34 +0000 (10:09 +1000)]
bump Math::BigRat $VERSION

8 years agoSync Math-BigRat blead vs. CPAN
Peter John Acklam [Wed, 9 Apr 2014 17:30:40 +0000 (19:30 +0200)]
Sync Math-BigRat blead vs. CPAN

Some POD changes were accidentally included in the CPAN release of
Math-BigRat before they were included in blead. This patch gets the
module in sync.

8 years agoPierre Bogossian is now a perl author
Tony Cook [Mon, 12 May 2014 05:52:04 +0000 (15:52 +1000)]
Pierre Bogossian is now a perl author