The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

perl5274delta - what is new for perl v5.27.4

DESCRIPTION

This document describes differences between the 5.27.3 release and the 5.27.4 release.

If you are upgrading from an earlier release such as 5.27.2, first read perl5273delta, which describes differences between 5.27.2 and 5.27.3.

Core Enhancements

In-place editing is now safer

Previously in-place editing would delete or rename the input file as soon as you started working on a new file.

Without backups this would result in loss of data if there was an error, such as a full disk, when writing to the output file.

This has changed so that the input file isn't replaced until the output file has been completely written and successfully closed.

This works by creating a work file in the same directory, which is renamed over the input file once the output file is complete.

Incompatibilities:

  • Since this renaming needs to only happen once, if you create a thread or child process, that renaming will only happen in the original thread or process.

  • If you change directories while processing a file, and your operating system doesn't provide the unlinkat(), renameat() and fchmodat() functions, the final rename step may fail.

[perl #127663]

Security

[CVE-2017-12837] Heap buffer overflow in regular expression compiler

Compiling certain regular expression patterns with the case-insensitive modifier could cause a heap buffer overflow and crash perl. This has now been fixed. [perl #131582]

[CVE-2017-12883] Buffer over-read in regular expression parser

For certain types of syntax error in a regular expression pattern, the error message could either contain the contents of a random, possibly large, chunk of memory, or could crash perl. This has now been fixed. [perl #131598]

[CVE-2017-12814] $ENV{$key} stack buffer overflow on Windows

A possible stack buffer overflow in the %ENV code on Windows has been fixed by removing the buffer completely since it was superfluous anyway. [perl #131665]

Performance Enhancements

  • Slightly improved performance when parsing stash names. [perl #129990]

Modules and Pragmata

Updated Modules and Pragmata

  • attributes has been upgraded from version 0.3 to 0.31.

  • File::Glob has been upgraded from version 1.29 to 1.30.

  • I18N::Langinfo has been upgraded from version 0.13 to 0.14. This fixes a bug in which the underlying locale was ignored for the RADIXCHAR (always was returned as a dot, and the THOUSEP (always empty). Now the locale-appropriate values are returned.

  • Module::CoreList has been upgraded from version 5.20170821 to 5.20170920.

  • sort has been upgraded from version 2.02 to 2.03.

  • Term::ReadLine has been upgraded from version 1.16 to 1.17.

  • threads has been upgraded from version 2.17 to 2.18.

  • VMS::Stdio has been upgraded from version 2.41 to 2.42.

Removed Modules and Pragmata

  • The VMS::stdio compatibility shim has been removed.

Diagnostics

The following additions or changes have been made to diagnostic output, including warnings and fatal error messages. For the complete list of diagnostic messages, see perldiag.

Changes to Existing Diagnostics

  • A false-positive warning that was issued when using a numerically-quantified sub-pattern in a recursive regex has been silenced. [perl #131868]

Testing

Tests were added and changed to reflect the other additions and changes in this release.

Platform Support

Platform-Specific Notes

Darwin

Perl now correctly uses reentrant functions, like asctime_r, on versions of Darwin that have support for them.

Internal Changes

  • A new function, Perl_langinfo() has been added. It is an (almost) drop-in replacement for the system nl_langinfo(3), but works on platforms that lack that; as well as being more thread-safe, and hiding some gotchas with locale handling from the caller. Code that uses this, needn't use localeconv(3) (and be affected by the gotchas) to find the decimal point, thousands separator, or currency symbol. See "Perl_langinfo" in perlapi.

  • A new API function sv_rvunweaken() has been added to complement sv_rvweaken(). The implementation was taken from "unweaken" in Scalar::Util.

  • A new flag, SORTf_UNSTABLE, has been added. This will allow a future commit to make mergesort unstable when the user specifies ‘no sort stable’, since it has been decided that mergesort should remain stable by default.

Selected Bug Fixes

  • The internal stack usage checks introduced in 5.27.2 are now also done by the entersub operator when calling XSUBs. This means we can report which XSUB failed to allocate enough stack space. [perl #131975]

  • Parsing a sub definition could cause a use after free if the sub keyword was followed by whitespace including newlines (and comments.) [perl #131836]

  • The tokenizer now correctly adjusts a parse pointer when skipping whitespace in a ${identifier} construct. [perl #131949]

  • Accesses to ${^LAST_FH} no longer assert after using any of a variety of I/O operations on a non-glob. [perl #128263]

  • The Copy(), Move(), Zero() macros and their variants now assert if the pointers supplied are NULL. ISO C considers supplying NULL pointers to the functions these macros are built upon as undefined behaviour even when their count parameters are zero. Based on these assertions and the original bug report three macro calls were made conditional. [perl #131746] [perl #131892]

  • The in-place sort optimisation now correctly strengthens weak references using the new sv_rvunweaken() API function.

  • Only the = operator is permitted for defining defaults for parameters in subroutine signatures. Previously other assignment operators, e.g. +=, were also permitted. [perl #131777]

  • Package names are now always included in :prototype warnings [perl #131833]

  • Creating a thread with no parameters no longer tries to Copy() a null pointer. This fixes an assertion failure and allows threaded builds to work again.

  • The je_old_stack_hwm field, previously only found in the jmpenv structure on debugging builds, has been added to non-debug builds as well. This fixes an issue with some CPAN modules caused by the size of this structure varying between debugging and non-debugging builds. [perl #131942]

  • The arguments to the ninstr() macro are now correctly parenthesized.

  • A NULL pointer dereference in the S_regmatch() function has been fixed. [perl #132017]

Acknowledgements

Perl 5.27.4 represents approximately 4 weeks of development since Perl 5.27.3 and contains approximately 5,000 lines of changes across 140 files from 18 authors.

Excluding auto-generated files, documentation and release tools, there were approximately 3,300 lines of changes to 76 .pm, .t, .c and .h files.

Perl continues to flourish into its third decade thanks to a vibrant community of users and developers. The following people are known to have contributed the improvements that became Perl 5.27.4:

Abigail, Chris 'BinGOs' Williams, Dagfinn Ilmari Mannsåker, David Mitchell, Dominic Hargreaves, Father Chrysostomos, H.Merijn Brand, James E Keenan, Jarkko Hietaniemi, John SJ Anderson, Karl Williamson, Lukas Mai, Matthew Horsfall, Neil Bowers, Nicolas R., Steve Hay, Tony Cook, Yves Orton.

The list above is almost certainly incomplete as it is automatically generated from version control history. In particular, it does not include the names of the (very much appreciated) contributors who reported issues to the Perl bug tracker.

Many of the changes included in this version originated in the CPAN modules included in Perl's core. We're grateful to the entire CPAN community for helping Perl to flourish.

For a more complete list of all of Perl's historical contributors, please see the AUTHORS file in the Perl source distribution.

Reporting Bugs

If you find what you think is a bug, you might check the perl bug database at https://rt.perl.org/ . There may also be information at http://www.perl.org/ , the Perl Home Page.

If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.

If the bug you are reporting has security implications which make it inappropriate to send to a publicly archived mailing list, then see "SECURITY VULNERABILITY CONTACT INFORMATION" in perlsec for details of how to report the issue.

Give Thanks

If you wish to thank the Perl 5 Porters for the work we had done in Perl 5, you can do so by running the perlthanks program:

    perlthanks

This will send an email to the Perl 5 Porters list with your show of thanks.

SEE ALSO

The Changes file for an explanation of how to view exhaustive details on what changed.

The INSTALL file for how to build Perl.

The README file for general stuff.

The Artistic and Copying files for copyright information.