This is a live mirror of the Perl 5 development currently hosted at
6 months agoPOSIX.xs: Use alternative functions if avail
Karl Williamson [Mon, 30 Nov 2020 16:30:52 +0000 (09:30 -0700)]
POSIX.xs: Use alternative functions if avail

These preprocessor directives failed to account for the existence of
common alternative functions (which the implementation knows about) if
the plain function is not available on the platform.

I doubt that this makes any difference, but it makes these conditionals
consistent with the others nearby.

6 months agolocale.c: Fix typo in #ifdef
Karl Williamson [Mon, 30 Nov 2020 16:25:52 +0000 (09:25 -0700)]
locale.c: Fix typo in #ifdef

This misspelling led to the code assuming that the platform didn't have
a feature that, if used, would result in faster execution.

6 months agoFix and update documentation of memEQ, memNE, ...
Karl Williamson [Fri, 4 Dec 2020 00:56:21 +0000 (17:56 -0700)]
Fix and update documentation of memEQ, memNE, ...

This fixes GH #18379

6 months agotime64.c: avoid 'uninit' compiler warning
David Mitchell [Thu, 3 Dec 2020 10:36:42 +0000 (10:36 +0000)]
time64.c: avoid 'uninit' compiler warning

clang isn't smart enough to recognise the pattern:

    if (foo) { ...} { else orig_year = ... }
    if (!foo) { ... use orig_year .. }

So just unconditionally initialise orig_year.

6 months agoperldelta for the Win32 symlink()/readlink()/stat() changes
Tony Cook [Thu, 3 Dec 2020 04:24:44 +0000 (15:24 +1100)]
perldelta for the Win32 symlink()/readlink()/stat() changes

6 months agoDocument PERL_TEST_HARNESS_ASAP
Karl Williamson [Thu, 3 Dec 2020 03:54:07 +0000 (20:54 -0700)]

which can increase the CPU occupancy when running the test suite in
parallel on a many-core system, resulting in earlier completion.

6 months agoadd note on how to write NEXTKEY when you can't just wrap around each()
David Cantrell [Mon, 30 Nov 2020 22:50:00 +0000 (22:50 +0000)]
add note on how to write NEXTKEY when you can't just wrap around each()

6 months agoRevert "op.h: Restrict to core certain internal symbols"
Karl Williamson [Thu, 3 Dec 2020 01:56:27 +0000 (18:56 -0700)]
Revert "op.h: Restrict to core certain internal symbols"

This reverts commit 1d6cadf136bf2c85058a5359fb48b09b3ea9fe6f.

Due to cpan breakage: GH #18374 #18375 #18376

6 months agoadd more win32 stat tests
Tony Cook [Thu, 3 Dec 2020 00:00:43 +0000 (11:00 +1100)]
add more win32 stat tests

These tickets were suggested as fixed by the stat updates, some
were fixed, but some weren't.

Add tests (TODO for the unfixed) to help track them

6 months agocpan/Encode: sync with CPAN version 3.08
Dan Kogai [Wed, 2 Dec 2020 22:13:45 +0000 (17:13 -0500)]
cpan/Encode: sync with CPAN version 3.08

6 months agot/harness: Add option for faster test suite execution
Karl Williamson [Sun, 12 Apr 2020 21:13:25 +0000 (15:13 -0600)]
t/harness: Add option for faster test suite execution

This commit adds an environment variable, PERL_TEST_HARNESS_ASAP, which
if set to non-zero increases the parallelism in the execution of the
test suite, speeding it up on systems with multiple cores.

Normally, there are two main test sections, one for core and the second
for non-core tests, and the testing of the non-core one doesn't begin
until the core tests are complete.  Within each section, there are a
number of test categories, like 're' for regular expressions, and
'JSON::PP' for the pure perl implementation of JSON.

Within each category, there are various single .t test files.  Some
categories can have those be tested in parallel; some require them to be
done in a particular order, say because an earlier .t does setup for
subsequent ones.  We already have this capability.

Completion of all the tests in a category is not needed before those of
another category can be started.  This is how it already works.

However, the core section categories are ordered so that they begin in a
logical order for someone trying to get perl to work.  First to start
are the basic sanity tests, then by roughly decreasing order of
widespread use in perl programs in the wild, with the final two
categories, porting and perf, being mainly of use to perl5 porters.
These two categories aren't started until all the tests in the earlier
categories are started.  We have some long running tests in those two
categories, and generally they delay the start of the entire second

If those long running tests could be started sooner, shorter tests in
the first section could be run in parallel with them, increasing the
average CPU utilization, and the second section could begin (and hence
end) earlier, shortening the total elapsed execution time of the entire

The second section has some very long running tests.  JSON-PP is one of
them.  If it could run in parallel with tests from the first section,
that would also speed up the completion of the suite.

The environment variable added by this commit does both things.  The
basic sanity test categories in the first section continue to be started
before anything else.  But then all other tests are run in decreasing
order of elapsed time they take to run, removing the boundaries between
some categories, and between the two sections.

The gain from this increases as the number of jobs run in parallel does;
slower high core platforms have the highest increase.  On the old
dromedary with 24 cores, the gain is 20%, almost 2 minutes.  On my more
modern box with 12 cores, it is 8%.

6 months agoTAP::Harness: Move timer initialization
Karl Williamson [Sun, 12 Apr 2020 16:14:25 +0000 (10:14 -0600)]
TAP::Harness: Move timer initialization

This commit adds to blead the accepted PR
but the updated module has not been released.

This commit allows a many-core processor to run the Perl test suite more

Prior to this commit, the timers for counting elapsed time and CPU usage
were begun when a job's first output appears.  This yields inaccurate
results.  These results are saved in t/test_state for future runs so
that they can start the longest-running tests first, which leads to
using the available cores more efficiently.  (If you start a long running
test after everything else is nearly done, you have to wait for it to
finish before the suite as a whole is; if you start the long ones first,
and the shortest last, you don't have to wait very long for any
stragglers to complete.)  Inaccurate results here lead to this
situation, which we were often seeing in the podcheck.t test.

The worst case is if there is heavy computation at the beginning of the
test being run.  podcheck, for example, examines all the pods in the
directory structure to find which links to other pods do or do not have
corresponding anchors.  Output doesn't happen until the analysis is
complete.  On my system, this takes over 30 seconds, but prior to this
commit, what was noted was just the time required to do the output,
about 200 milliseconds.  The result was that podcheck was viewed as
being one of the shortest tests run, so was started late in the process,
and generally held up the completion of it.

This commit by itself doesn't improve the test completion very much,
because, test tests are run a whole directory at a time, and the
directory podcheck is in, for example, is run last.  The next commit
addresses that.

6 months agofixup! Add Sevan Janiyan as author
Max Maischein [Wed, 2 Dec 2020 20:46:25 +0000 (21:46 +0100)]
fixup! Add Sevan Janiyan as author

6 months agoAdd Sevan Janiyan as author
Max Maischein [Wed, 2 Dec 2020 20:40:42 +0000 (21:40 +0100)]
Add Sevan Janiyan as author

6 months agoDetect GCC as compiler to use
Sevan Janiyan [Wed, 2 Dec 2020 19:50:37 +0000 (19:50 +0000)]
Detect GCC as compiler to use

On Illumos based distributions GCC is likely the compiler available on the system.
Change tested on SmartOS

6 months agoperlxs: Note that rpc.h is can be in different places
Karl Williamson [Mon, 2 Nov 2020 02:35:29 +0000 (19:35 -0700)]
perlxs: Note that rpc.h is can be in different places

This replaces PR #18247

6 months agofix the results of my stupidity
Tony Cook [Wed, 2 Dec 2020 00:43:16 +0000 (11:43 +1100)]
fix the results of my stupidity

I added these definitions late in the process, thinking I hadn't
already added them, but I had.

6 months agoStorable: t/canonical.t: avoid stderr noise
David Mitchell [Tue, 1 Dec 2020 16:45:58 +0000 (16:45 +0000)]
Storable: t/canonical.t: avoid stderr noise

informational text should to stdout, not stderr

6 months agoPOSIX: t/posix.t: avoid warning
David Mitchell [Tue, 1 Dec 2020 16:33:07 +0000 (16:33 +0000)]
POSIX: t/posix.t: avoid warning

Since warnings were enabled in this test file, skip one spurious warning
being generated. S_ISBLK() is being called purely to test run-time
loading; so it's being called without an arg, which now triggers an
'uninitialized value' warning.

6 months agoUnicode-Normalize/Makefile.PL: avoid stderr
David Mitchell [Tue, 1 Dec 2020 16:02:06 +0000 (16:02 +0000)]
Unicode-Normalize/Makefile.PL: avoid stderr

During build, output general progress information to stdout, not stderr.

6 months agoappend colon to USE_STRICT_BY_DEFAULT description
David Mitchell [Tue, 1 Dec 2020 15:26:06 +0000 (15:26 +0000)]
append colon to USE_STRICT_BY_DEFAULT description

This stops complaining that:

    USE_STRICT_BY_DEFAULT has no documentation

6 months agoODBM_File.xs: silence -Wc++-compat warning
David Mitchell [Tue, 1 Dec 2020 15:12:14 +0000 (15:12 +0000)]
ODBM_File.xs: silence -Wc++-compat warning

Under gcc -Wc++-compat, it warns that 'delete' is a keyword. Since this
is the name of the actual function in odbm, just temporarily disable
the warning.

6 months agoOpcode.xs: fix compiler warning
David Mitchell [Tue, 1 Dec 2020 11:07:59 +0000 (11:07 +0000)]
Opcode.xs: fix compiler warning

In some debugging code it was doing a SAVEDESTRUCTOR()
to do a warn() on scope exit, but it should have used the nocontext
version of warn().

6 months agoImplement symlink(), lstat() and readlink() on Win32
Tony Cook [Tue, 1 Dec 2020 04:29:45 +0000 (15:29 +1100)]
Implement symlink(), lstat() and readlink() on Win32

6 months agowin32 symlink: reindent
Tony Cook [Wed, 11 Nov 2020 00:46:15 +0000 (11:46 +1100)]
win32 symlink: reindent

6 months agowin32 symlink: treats paths that look like directories as directories
Tony Cook [Wed, 11 Nov 2020 00:42:23 +0000 (11:42 +1100)]
win32 symlink: treats paths that look like directories as directories

6 months agoTest-Harness: don't assume symlink succeeds
Tony Cook [Mon, 2 Nov 2020 03:28:29 +0000 (14:28 +1100)]
Test-Harness: don't assume symlink succeeds
upstream which has been applied but not released.

6 months agot/op/taint.t: handle symlink requiring anything unavailable
Tony Cook [Wed, 28 Oct 2020 02:46:01 +0000 (13:46 +1100)]
t/op/taint.t: handle symlink requiring anything unavailable

like privileges, or a filesystem without symlink support

6 months agoWin32: try to make the new stat pre-Vista compatible
Tony Cook [Tue, 20 Oct 2020 05:12:09 +0000 (16:12 +1100)]
Win32: try to make the new stat pre-Vista compatible

Skips the win32\stat.t execute flag test for handles pre-Vista

This is intended mostly for allowing the Win2000 smoker to build and
test.  If we end up dropping pre-Vista support this commit can be
removed (or reverted if it ends up in blead)

6 months agopre-vista support for win32_symlink
Tony Cook [Mon, 9 Nov 2020 02:52:09 +0000 (13:52 +1100)]
pre-vista support for win32_symlink

6 months agoWin32: don't include version specific config for prebuilt config_h.*
Tony Cook [Mon, 19 Oct 2020 03:26:57 +0000 (14:26 +1100)]
Win32: don't include version specific config for prebuilt config_h.*

This fixes the problem where doing a regen_config_h with a compiler
that supports stdbool.h would generate a config_h.* that would
result in a build failure on older compilers that didn't support

6 months agolstat(), readlink() and unlink() treat directory junctions as symlinks
Tony Cook [Thu, 15 Oct 2020 04:11:13 +0000 (15:11 +1100)]
lstat(), readlink() and unlink() treat directory junctions as symlinks

6 months agoremove ${^WIN32_SLOPPY_STAT}
Tony Cook [Thu, 15 Oct 2020 00:46:15 +0000 (11:46 +1100)]
remove ${^WIN32_SLOPPY_STAT}

The new implementation, like the UCRT implementation, always
opens the specified file.

6 months agowin32 symlink: only use the unprivileged flag if windows is new enough
Tony Cook [Thu, 15 Oct 2020 00:21:31 +0000 (11:21 +1100)]
win32 symlink: only use the unprivileged flag if windows is new enough

6 months agoWin32: re-work FILETIME <=> time_t conversions
Tony Cook [Wed, 14 Oct 2020 23:38:05 +0000 (10:38 +1100)]
Win32: re-work FILETIME <=> time_t conversions

Current versions of Windows claim to support leap seconds, but the
time conversion I was using ignores that possibility.

Switch to using APIs (FileTimeToSystemTime() and SystemTimeToFileTime())
that are documented to support leap seconds that might be included

6 months agoFile::Copy: support symlinks on Win32
Tony Cook [Wed, 7 Oct 2020 01:08:30 +0000 (12:08 +1100)]
File::Copy: support symlinks on Win32

6 months agoFile::Find: support Win32 symlinks
Tony Cook [Wed, 7 Oct 2020 01:07:31 +0000 (12:07 +1100)]
File::Find: support Win32 symlinks

find.t, taint.t: check that symlink() works under the current
permissions/filesystem rather than assuming it will work

find.t: since symlinks are now available, an earlier test block
set $FileFileTests_OK, and the tests in this Win32 block don't use
either of the follow options, which is required for fast file tests.

taint.t: ensure we get "/" separated names to match File::Find's output

6 months agoFile::Find find.t: switch to done_testing()
Tony Cook [Wed, 7 Oct 2020 00:53:05 +0000 (11:53 +1100)]
File::Find find.t: switch to done_testing()

6 months agoPathTools: use PerlLIO_*() functions and chdir() on a symlink differences
Tony Cook [Wed, 7 Oct 2020 00:50:55 +0000 (11:50 +1100)]
PathTools: use PerlLIO_*() functions and chdir() on a symlink differences

Use PerlLIO_lstat() and PerlLIO_readlink() instead of directly calling
the POSIX names, so our Win32 overrides work.

For the test, unlike POSIX, changing directory via a symlink on Win32
appears to store the symlink as part of the current directory rather
so GetCurrentDirectory() fetches that rather than the hardlinked path.

6 months agoWin32: implement our own stat(), and hence our own utime
Tony Cook [Wed, 14 Oct 2020 02:27:50 +0000 (13:27 +1100)]
Win32: implement our own stat(), and hence our own utime

This fixes at least two problems:

- unlike UCRT, the MSVCRT used for gcc builds has a bug converting
  a FILETIME in an unlike current DST state, returning a time
  offset by an hour.  Fixes GH #6080

- the MSVCRT apparently uses FindFirstFile() to fetch file
  information, but this doesn't follow symlinks(), so stat()
  ends up returning information about the symlink(), not the
  underlying file.  This isn't an issue with the UCRT which
  opens the file as this implementation does.

Currently this code calculates the time_t for st_*time, and the
other way for utime() using a simple multiplication and offset
between time_t and FILETIME values, but this may be incorrect
if leap seconds are enabled.

This code also requires Vista or later.

Some of this is based on code by Tomasz Konojacki (xenu).

6 months agoWin32: implement symlink() and readlink()
Tony Cook [Wed, 7 Oct 2020 05:31:22 +0000 (16:31 +1100)]
Win32: implement symlink() and readlink()

The API used requires Windows Vista or later.

The API itself requires either elevated privileges or a sufficiently
recent version of Windows 10 running in "Developer Mode", so some
tests require updates.

6 months agoWin32: add lstat(), fetch st_dev and st_ino and fetch st_nlink for fstat
Tony Cook [Tue, 6 Oct 2020 06:07:00 +0000 (17:07 +1100)]
Win32: add lstat(), fetch st_dev and st_ino and fetch st_nlink for fstat

We need lstat() for various modules to work well with symlinks,
and the same modules often want to check for matches on the device
and inode number.

The values we're using for st_ino match those that the Python and Rust
libraries use, and Go uses the same volume and file index values for
testing if two stat objects refer to the same file.

They aren't entirely unique, given ReFS uses 128-bit file ids, but
the API used to check for this (GetFileInformationByHandleEx() for
FileIdInfo) is only available on server operating systems, so I can't
directly test it anyway.

6 months agoAccount for 'less' reserving an extra column
Karl Williamson [Tue, 1 Dec 2020 03:55:30 +0000 (20:55 -0700)]
Account for 'less' reserving an extra column

After decades of stability, the 'less' pager project decided to claim an
extra column for its own use when called with certain common options.

This commit changes some of the auto-generating tools to wrap one column
earlier to compensate, and changes podcheck to also whine on wide
verbatim text one column less.  But it changes the podcheck data base
to grandfather-in all the many existing places that exceed that amount.
That means only changes made to pods after this commit will be held to
the stricter value.

Of course, what this means is those pods will wrap or truncate in these
places on an 80 column window, making them harder to read, when used
with 'less' and when it is called with the options that reserve those
two columns.  Patches welcome.

I haven't seen the wrapping problem with perldoc, and haven't
investigated much.

6 months agoDocument various CopFILEfoo functions
Karl Williamson [Sat, 29 Aug 2020 16:55:02 +0000 (10:55 -0600)]
Document various CopFILEfoo functions

6 months agoopcode.h: Restrict scope of internal variables to core
Karl Williamson [Sat, 17 Oct 2020 13:18:16 +0000 (07:18 -0600)]
opcode.h: Restrict scope of internal variables to core

6 months agoDocument SvSHARED_HASH
Karl Williamson [Thu, 27 Aug 2020 17:03:44 +0000 (11:03 -0600)]

6 months agobump version of ExtUtils::ParseXS
Graham Knop [Tue, 24 Nov 2020 20:42:05 +0000 (21:42 +0100)]
bump version of ExtUtils::ParseXS

6 months agorestore compatibility with old versions of ExtUtils::ParseXS
Graham Knop [Tue, 24 Nov 2020 20:27:43 +0000 (21:27 +0100)]
restore compatibility with old versions of ExtUtils::ParseXS

ExtUtils::ParseXS used to include a function called "errors", which was
documented. In was renamed to report_error_count in version 3.01 (perl
5.15.1) although the documentation wasn't fixed until 3.21 (perl 5.19.2).
As a documented function, this is a backwards compatibility issue.

It is possible for this to lead to errors when installing modules from
CPAN. If you are using the version of ExtUtils::ParseXS that comes with
core, between running the Makefile.PL and make, fulfilling prereqs can
result in upgrading ExtUtils::ParseXS. When Makefile.PL is run, the
generated Makefile gets the full path to xsubpp saved in it. Then when
upgraded from CPAN, ExtUtils::ParseXS and xsubpp will be in a new
location (site_perl or a local::lib). Running make will run the old
xsubpp, but it will then try to use the new ExtUtils::ParseXS which has
broken compatibility.

Restore the errors function as a compatibility shim to fix this.

6 months agocop.h: Extend core-only portion
Karl Williamson [Sat, 17 Oct 2020 12:43:55 +0000 (06:43 -0600)]
cop.h: Extend core-only portion

This encloses some #defines in a PERL_CORE section, as their only use is
in the macro immediately following, already confined to core.

6 months agoINSTALL: Fix grammar/typos
Karl Williamson [Wed, 7 Oct 2020 19:22:54 +0000 (13:22 -0600)]
INSTALL: Fix grammar/typos

6 months agoperlapi: Consolidate svREFCNT_dec-ish entries
Karl Williamson [Sun, 6 Sep 2020 04:18:06 +0000 (22:18 -0600)]
perlapi: Consolidate svREFCNT_dec-ish entries

6 months agoDynaLoader: use PerlEnv_getenv()
Karl Williamson [Sat, 7 Mar 2020 19:54:19 +0000 (12:54 -0700)]
DynaLoader: use PerlEnv_getenv()

Doing so invokes thread-safe guards

6 months agoop.h: Restrict to core certain internal symbols
Karl Williamson [Sat, 17 Oct 2020 13:04:41 +0000 (07:04 -0600)]
op.h: Restrict to core certain internal symbols

so that they aren't accessible to XS code and won't be picked up by

6 months agoperlapi: Consolidate SvPVX-ish entries
Karl Williamson [Sun, 6 Sep 2020 04:20:45 +0000 (22:20 -0600)]
perlapi: Consolidate SvPVX-ish entries

6 months agoAdd -negative import args for 'use warnings'
David Cantrell [Mon, 27 Jan 2020 16:02:05 +0000 (16:02 +0000)]
Add -negative import args for 'use warnings'

6 months agoperlapi: Consolidate SvREFCNT_INC-ish entries
Karl Williamson [Sun, 6 Sep 2020 04:17:19 +0000 (22:17 -0600)]
perlapi: Consolidate SvREFCNT_INC-ish entries

6 months agoadd extra language in the quotemeta() docs for embedded \ and $
Karen Etheridge [Fri, 20 Nov 2020 23:57:25 +0000 (15:57 -0800)]
add extra language in the quotemeta() docs for embedded \ and $

One paragraph was lifted from perlop.pod, and the other from perlre.pod.

6 months agoperlvar - clarify that paragraph mode also discards a single leading newline
Dan Book [Fri, 27 Nov 2020 04:19:13 +0000 (23:19 -0500)]
perlvar - clarify that paragraph mode also discards a single leading newline

6 months agoAvoid deadlock with PERL_MEM_LOG
Karl Williamson [Thu, 26 Nov 2020 01:20:28 +0000 (18:20 -0700)]
Avoid deadlock with PERL_MEM_LOG

This fixes GH #18341

The Perl wrapper for getenv() was changed in 5.32 to allocate memory to
squirrel safely away the result of the wrapped getenv() call.  It does
this while in a critical section so as to make sure another thread can't
interrupt it and destroy it.

Unfortunately, when Perl is compiled for debugging memory problems and
has PERL_MEM_LOG enabled, that allocation causes a recursive call to
getenv() for the purpose of checking an environment variable to see how
to log that allocation.  And hence it deadlocks trying to enter the
critical section.

There are various solutions.  One is to use or emulate a general semaphore
instead of a binary one.  This is effectively what
PL_lc_numeric_mutex_depth does for another mutex, and the code for that
could be used as a template.

But given that this is an extreme edge case which requires Perl to be
specially compiled to enable this feature which is used only for
debugging, a much simpler, if less safe if it were to ever be used in
production, solution should suffice.  Tony Cook suggested just avoiding
the wrapper for this particular purpose.

6 months agoAdd mutex locking for many-reader/1-writer
Karl Williamson [Wed, 12 Aug 2020 20:59:12 +0000 (14:59 -0600)]
Add mutex locking for many-reader/1-writer

The mutex macros already in perl are sufficient to allow us to emulate
this type of locking, which may also be available natively, but I don't
think it is worth the effort to use the native calls.

6 months agolocale.c: Move comment to better place
Karl Williamson [Thu, 26 Nov 2020 13:16:13 +0000 (06:16 -0700)]
locale.c: Move comment to better place

6 months agoperlsub - indicate version requirement for "delete local"
Dan Book [Thu, 26 Nov 2020 02:29:22 +0000 (21:29 -0500)]
perlsub - indicate version requirement for "delete local"

6 months agoperlapi: PL_sv_yes and kin are read-only
Karl Williamson [Wed, 25 Nov 2020 13:54:37 +0000 (06:54 -0700)]
perlapi: PL_sv_yes and kin are read-only

6 months agoperlapi: Remove per-thread section; move to real scns
Karl Williamson [Wed, 18 Nov 2020 03:35:55 +0000 (20:35 -0700)]
perlapi: Remove per-thread section; move to real scns

Instead of having a grab bag section of all interpreter variables, move
their documentation to the section that they actually fit under.

6 months agoperlapi: Move PL_dowarn to Warnings section
Karl Williamson [Wed, 18 Nov 2020 03:35:01 +0000 (20:35 -0700)]
perlapi: Move PL_dowarn to Warnings section

6 months agoperldelta updates for the SysV IPC changes
Tony Cook [Tue, 24 Nov 2020 03:31:08 +0000 (14:31 +1100)]
perldelta updates for the SysV IPC changes

6 months agoVarious updates and fixes to some of the SysV IPC ops and their tests
Tony Cook [Tue, 24 Nov 2020 02:52:59 +0000 (13:52 +1100)]
Various updates and fixes to some of the SysV IPC ops and their tests

6 months agoio/shm.t: make runnable as ./perl io/shm.t
Tony Cook [Wed, 18 Nov 2020 04:02:05 +0000 (15:02 +1100)]
io/shm.t: make runnable as ./perl io/shm.t

and give editors a hint

6 months agoshmwrite: treat the string as bytes
Tony Cook [Wed, 18 Nov 2020 04:01:13 +0000 (15:01 +1100)]
shmwrite: treat the string as bytes

6 months agomsgrcv: properly downgrade the receive buffer
Tony Cook [Wed, 18 Nov 2020 03:26:38 +0000 (14:26 +1100)]
msgrcv: properly downgrade the receive buffer

If the receive buffer started with SVf_UTF8 on, the received message
SV would stay flagged, corrupting the result.

6 months agomsgsnd: handle an upgraded MSG parameter correctly
Tony Cook [Wed, 18 Nov 2020 03:20:47 +0000 (14:20 +1100)]
msgsnd: handle an upgraded MSG parameter correctly

6 months agoperlfunc/msgsnd: the supplied MSG doesn't have a length field
Tony Cook [Wed, 18 Nov 2020 00:42:24 +0000 (11:42 +1100)]
perlfunc/msgsnd: the supplied MSG doesn't have a length field

The length of the message is derived from the length of the MSG
less the size of the type field.

6 months agofix UTF-8 handling for semop()
Tony Cook [Tue, 17 Nov 2020 23:27:50 +0000 (10:27 +1100)]
fix UTF-8 handling for semop()

As with semctl(), the UTF-8 flag on the passed in opstring was ignored,
which meant that the upgraded version of the same string would
cause an error.

Just use SvPVbyte().

6 months agoio/sem.t: eliminate warnings
Tony Cook [Tue, 17 Nov 2020 04:59:44 +0000 (15:59 +1100)]
io/sem.t: eliminate warnings

This eliminates some warnings that semctl() (or other *ctl()) calls
might generate, and some warnings specific to io/sem.t:

- for IPC_STAT and GETALL, the current value of ARG is overwritten
  so making an undefined value warning for it nonsensical, so don't
  use SvPV_force().

- for other calls, ARG is either ignored, or in a behaviour
  introduced in perl 3 (along with the ops), treats the supplied
  value as an integer which is then converted to a pointer.  Rather
  than warning on an undef value which is most likely to be ignored
  we treat the undef as zero without the usual warning.

- always pass a number for SEMNUM in the test code

I didn't try to eliminate warning for non-numeric/undefined SEMNUM,
since while we know it isn't used by SETALL, GETALL, IPC_STAT and
IPC_SET, it may or may not be used by system defined *ctl() operators
such as SEM_INFO and SHM_LOCK on Linux.

fixes #17926

6 months ago*ctl: test that we throw on a code point above 0xff
Tony Cook [Tue, 17 Nov 2020 03:25:36 +0000 (14:25 +1100)]
*ctl: test that we throw on a code point above 0xff

These functions expect a packed structure of some point
representing bytes from the structure in memory.

6 months ago*ctl: test we handle the buffer as bytes
Tony Cook [Tue, 17 Nov 2020 03:20:41 +0000 (14:20 +1100)]
*ctl: test we handle the buffer as bytes

Previously this had the "unicode bug", an upgraded string would
be treated as the encoding of that string, rather than the raw

6 months ago*ctl: ensure the ARG parameter's UTF-8 flag is reset
Tony Cook [Tue, 17 Nov 2020 03:07:32 +0000 (14:07 +1100)]
*ctl: ensure the ARG parameter's UTF-8 flag is reset

If the SV supplied as ARG had the SVf_UTF8 flag on it would be left
on, which would effectively corrupt the returned buffer.

Only tested with shmctl(), since the other *ctl() functions only have
more complex structures with indeterminate types that would require
more effort to test.

6 months agoperl - update usage data to match perlrun
Dan Book [Mon, 23 Nov 2020 07:59:53 +0000 (02:59 -0500)]
perl - update usage data to match perlrun

6 months agoJohn Karr is now a perl author
Tony Cook [Mon, 23 Nov 2020 23:24:28 +0000 (10:24 +1100)]
John Karr is now a perl author

6 months agofix typo in comp/parser.t
John Karr [Thu, 12 Nov 2020 08:30:49 +0000 (03:30 -0500)]
fix typo in comp/parser.t

3 similar tests eval a sub with a list of variables, $r is repeated at the
end of the list, but the errors that are being checked have nothing to do with
the repeated variable. This causes a warning enabled.

6 months agocomp/parser.t count two lines that were being tested to see if they crashed
John Karr [Tue, 10 Nov 2020 22:14:24 +0000 (17:14 -0500)]
comp/parser.t count two lines that were being tested to see if they crashed
parser as tests (PASS if the test file is still running after the lines).

6 months agobump $Carp::VERSION
Tony Cook [Mon, 23 Nov 2020 23:18:18 +0000 (10:18 +1100)]
bump $Carp::VERSION

7 months agofix context of caller call in Carp
Graham Knop [Mon, 23 Nov 2020 22:12:49 +0000 (23:12 +0100)]
fix context of caller call in Carp

Carp's CARP_NOT variable is meant to have package names. caller in list
context returns the calling file and line in addition to the package

Enforce scalar context on the call to caller to fix this.

7 months agoperlapi: Document UVf, as deprecated
Karl Williamson [Sat, 17 Oct 2020 21:49:53 +0000 (15:49 -0600)]
perlapi: Document UVf, as deprecated

7 months agoperlapi: Note proper rplcemnt for pad_compname_type
Karl Williamson [Thu, 27 Aug 2020 15:24:12 +0000 (09:24 -0600)]
perlapi: Note proper rplcemnt for pad_compname_type

7 months agoadd a brief introduction to the IO SV type
Tony Cook [Thu, 19 Nov 2020 05:08:05 +0000 (16:08 +1100)]
add a brief introduction to the IO SV type

7 months agoConfine scope of SV_CONST to core
Karl Williamson [Sat, 17 Oct 2020 13:32:18 +0000 (07:32 -0600)]
Confine scope of SV_CONST to core

as well as the constants it uses.  This is unused in cpan

7 months agoAdd a usage note about the "l" modifier.
Shlomi Fish [Thu, 29 Oct 2020 13:40:07 +0000 (15:40 +0200)]
Add a usage note about the "l" modifier.

7 months agowin32: remove support for disabling USE_LARGE_FILES
Tomasz Konojacki [Thu, 29 Oct 2020 17:58:10 +0000 (18:58 +0100)]
win32: remove support for disabling USE_LARGE_FILES

It was enabled by default on all compilers. I don't think it ever
makes sense to disable it.

7 months agoRestrict scope/Shorten some very long macro names
Karl Williamson [Sat, 17 Oct 2020 12:55:50 +0000 (06:55 -0600)]
Restrict scope/Shorten some very long macro names

The names were intended to force people to not use them outside their
intended scopes.  But by restricting those scopes in the first place, we
don't need such unwieldy names

7 months agoembed.fnc: Mark reginitcolors as Core only
Karl Williamson [Wed, 22 Jul 2020 22:16:41 +0000 (16:16 -0600)]
embed.fnc: Mark reginitcolors as Core only

This is used for internal initialization, and there are no uses on cpan

7 months agoperlapi: Consolidate Sv{INU]VX-ish entries
Karl Williamson [Sun, 6 Sep 2020 16:17:42 +0000 (10:17 -0600)]
perlapi: Consolidate Sv{INU]VX-ish entries

7 months agoUpdate gitignore files to reflect files in repo
Tony Cook [Sun, 22 Nov 2020 23:57:25 +0000 (10:57 +1100)]
Update gitignore files to reflect files in repo

7 months agofix ignore to only apply to root
Graham Knop [Thu, 19 Nov 2020 11:09:55 +0000 (12:09 +0100)]
fix ignore to only apply to root

There is a real in NetWare/, which may be copied to the
root. Ignore the file in the root, but not the file in NetWare/.

7 months agoremove ignore for perlvms.pod, which is a real file now
Graham Knop [Thu, 19 Nov 2020 11:08:48 +0000 (12:08 +0100)]
remove ignore for perlvms.pod, which is a real file now

7 months agomove ignore for re into its own dists gitignore
Graham Knop [Thu, 19 Nov 2020 11:08:19 +0000 (12:08 +0100)]
move ignore for re into its own dists gitignore

7 months agomove ignore for XS-APItest into dists own gitignore
Graham Knop [Thu, 19 Nov 2020 11:07:50 +0000 (12:07 +0100)]
move ignore for XS-APItest into dists own gitignore

7 months agoremove ignore for Test-Harness directory which no longer exists
Graham Knop [Thu, 19 Nov 2020 11:06:20 +0000 (12:06 +0100)]
remove ignore for Test-Harness directory which no longer exists

7 months agoremove ignore for dl_win32.xs, since it is a real file now
Graham Knop [Thu, 19 Nov 2020 11:05:27 +0000 (12:05 +0100)]
remove ignore for dl_win32.xs, since it is a real file now

7 months agoadd gitignore exclusions for files in git
Graham Knop [Thu, 19 Nov 2020 11:02:15 +0000 (12:02 +0100)]
add gitignore exclusions for files in git

There are a number of files excluded using gitignore rules that are
included in the repository. This can lead to confusion if something
other than git tries to read the ignore files.

Add rules to the gitignore files so that these files won't be ignored.