| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
This disables the new unshared hash key logic by default. People
who wish to try it out can enable it at build time with
-DPERL_USE_UNSHARED_KEYS_IN_LARGE_HASHES
in the configure process.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This moves all run time mutations of PL_hash_rand_bits into a set of
macros which allow us to debug what is happening. It also moves away
from our poor mans RNG based on mixing in various sources of data as
we go and switches to using an XORSHIFT RNG for generating the random
bits. This particular RNG is very efficient, using three xor operations
and three shift operations, so it shouldn't hurt us to use it. As a
bonus it also removes the conditional logic involved, as we use seed()
to initialize things at the very beginning when we are running under
RANDOMIZE mode, which should fix any problems with running on platforms
that do not use process space randomization like cygwin.
It adds support for -Dh under DEBUGGING to allow introspection of the
the state of PL_hash_rand_bits and source and cause of changes to it.
With -Dhv you can also get an idea of the keys which are triggering
these mutations as well. -Dh has also been changed to imply
PERL_HASH_SEED_DEBUG as a convenience.
This goes alongside a new test, based on one from Nicholas R (atoomic)
to test that the various PERL_PERTURB_KEYS options behave as expected
and that 1 bit mutations of the seed actually *do* affect the key order
and hashing of our strings. The test is run many times to ensure that
it passes under many different randomly generated hash seeds. Parts of
this test would fail without the preceding commit to this one adjusting
how SBOX32 is initialized.
|
|
|
|
|
|
|
|
|
|
|
| |
In 2017 in fcd573e77ec68fbe3936ac1381654581fba8a64f Dave Mitchell
removed support for the -DH flag but missed this.
Part of the -D options parsing is positionally sensitive, so in order to
be able to remove the 'H' option entirely I had to use a placeholder
character, and I chose '?'. This is because it is not isWORDCHAR(),
which means the preceding logic prevents it from being chosen anyway,
and thus it should be safe.
|
|
|
|
|
|
|
| |
I think not initializing these to zero is a false economy, Felipe Gasper brought
this up that it made debugging issues with the stack confusing. We only do this once
per process and zeroing memory is prety cheap so it make sense to me to zero
the stacks on startup.
|
|
|
|
|
| |
It's a simpler alias for -0777. It was proposed in RFC-0011:
https://github.com/Perl/RFCs/blob/master/rfcs/rfc0011.md
|
|
|
|
|
|
|
|
|
|
| |
Now that C99 is required, bool is always defined, so HAS_BOOL should
also always be defined.
PERL_BOOL_AS_CHAR was used to workaround problems when no bool type
existed, so it is obsolete, and in fact perl won't compile if
PERL_BOOL_AS_CHAR is #defined. So remove it completely from being
looked at.
|
| |
|
|
|
|
|
|
|
| |
-? is a common paradigm for finding the usage of a program. Prior to
this commit, doing so on perl would tell you it is illegal and suggest
-h. This commit allows someone using this paradigm to skip the second
step
|
|
|
|
|
|
|
|
| |
This finishes the perl-visible API required for RFC 0008
https://github.com/Perl/RFCs/blob/master/rfcs/rfc0008.md
It also begins the "builtin::" namespace of RFC 0009
https://github.com/Perl/RFCs/blob/master/rfcs/rfc0009.md
|
| |
|
|
|
|
|
|
| |
DJGPP is a port of the GNU toolchain to 32-bit x86 systems running DOS.
The last known attempt to build Perl on it was on 5.20, which only got
as far as building miniperl.
|
|
|
|
| |
The build has been broken since 2009.
|
|
|
|
|
|
|
|
|
|
| |
In April 2003 commit f2095865e3489f4e:
Noted by Nat: -0 didn't work that well with Unicode.
added support for passing hexadecimal to the -0 option. As '-0' has an
optional argument, the chosen syntax for hex was ambiguous with '-0' clustered
with an '-x' option with an argument, so the heuristic described here was
implemented.
|
|
|
|
|
|
|
|
| |
Use ->pCalloc instead of ->pMalloc followed by Zero()
This commit is analogous to the change in perl_alloc() in the previous
commit - the order of S_init_tls_and_interp() and Zero() can be swapped,
at which point the change to use "calloc" is obvious.
|
|
|
|
|
|
|
| |
`INIT_TRACK_MEMPOOL` is defined as a no-op if `PERL_TRACK_MEMPOOL` is not
defined, so no need to wrap it in `#ifdef`.
Spotted by Ilmari.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous code
1) allocated memory with PerlMem_malloc()
2) passed the pointer to S_init_tls_and_interp()
3) called Zero() or ZeroD()
4) optionally invoked INIT_TRACK_MEMPOOL()
5) returned the pointer
ZeroD() and Zero() are equivalent, apart from the return value of the
expression.
The layers of functions and macros obscured what what was actually
happening, and what the ordering dependencies are:
* S_init_tls_and_interp() uses only the address of the pointer
* Zero() zeros the memory
* Only INIT_TRACK_MEMPOOL() touches the contents
* all the "memory wrap" macros inside the other macros can't "trigger"
Hence the order of Zero() and S_init_tls_and_interp() can be swapped,
at which point Zero() immediately follows malloc(), meaning that the two
should be be replaced with calloc().
This simplifies the function considerably.
|
|
|
|
| |
This replaces an hv_exists/hv_store pair with a single LVALUE hv_fetch.
|
| |
|
| |
|
|
|
|
|
| |
Also use HvTOTALKEYS() instead of HvKEYS(), as the latter makes a check for
placeholders, which here cannot make a difference.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since the removal of PERL_OBJECT
(acfe0abcedaf592fb4b9cb69ce3468308ae99d91) PERL_IMPLICIT_CONTEXT and
MULTIPLICITY have been synonymous and they're being used interchangeably.
To simplify the code, this commit replaces all instances of
PERL_IMPLICIT_CONTEXT with MULTIPLICITY.
PERL_IMPLICIT_CONTEXT will stay defined for compatibility with XS
modules.
|
| |
|
|
|
|
|
|
|
| |
This is a rebasing by @khw of part of GH #18792, which I needed to get
in now to proceed with other commits.
It also strips trailing white space from the affected files.
|
|
|
|
|
| |
The format is '%s', so it is not appropriate to wrap the char * arguments
in SVfARG().
|
|
|
|
|
|
| |
Check that porting/copyright.t is passing when run with --now:
../perl -I../lib porting/copyright.t --now
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This feature allows documentation destined for perlapi or perlintern to
be split into sections of related functions, no matter where the
documentation source is. Prior to this commit the line had to contain
the exact text of the title of the section. Now it can be a $variable
name that autodoc.pl expands to the title. It still has to be an exact
match for the variable in autodoc, but now, the expanded text can be
changed in autodoc alone, without other files needing to be updated at
the same time.
|
| |
|
|
|
|
|
| |
This uses a new organization of sections that I came up with. I asked
for comments on p5p, but there were none.
|
|
|
|
|
| |
apidoc_section is slightly favored over head1, as it is known only to
autodoc, and can't be confused with real pod.
|
| |
|
|
|
|
| |
These were only ever needed by Symbian.
|
|
|
|
|
| |
It only does anything under PERL_GLOBAL_STRUCT, which is gone.
Keep the dNOOP defintion for CPAN back-compat
|
|
|
|
|
|
|
|
| |
This was originally added for MinGW, which no longer needs it, and
only still used by Symbian, which is now removed.
This also leaves perlapi.[ch] empty, but we keep the header for CPAN
backwards compatibility.
|
|
|
|
|
| |
Also eliminate USE_HEAP_INSTEAD_OF_STACK and
SETSOCKOPT_OPTION_VALUE_T, since Symbian was the only user of those.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This resolves #17774.
This ticket is because the fixes in GH #17154 failed to get every case,
leaving this one outlier to be fixed by this commit.
The text in https://github.com/Perl/perl5/issues/17154 gives extensive
details as to the problem. But briefly, in an attempt to speed up
interpreter cloning, I moved certain SVs from interpreter level to
global level in e80a0113c4a8036dfb22aec44d0a9feb65d36fed (v5.27.11,
March 2018). This was doable, we thought, because the content of these
SVs is constant throughout the life of the program, so no need to copy
them when cloning a new interpreter or thread. However when an
interpreter exits, all its SVs get cleaned up, which caused these to
become garbage in applications where another interpreter remains
running. This circumstance is rare enough that the bug wasn't reported
until September 2019, #17154. I made an initial attempt to fix the
problem, and closed that ticket, but I overlooked one of the variables,
which was reported in #17774, which this commit addresses.
Effectively the behavior is reverted to the way it was before
e80a0113c4a8036dfb22aec44d0a9feb65d36fed.
|
|
|
|
|
| |
Mostly in comments and docs, but some in diagnostic messages and one
case of 'or die die'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
v5.31.9-156-g94c8b9c1f0 introduced the free_and_set_cop_warnings()
macro. It's first argument expects a COP rather than a COP*. Its usage
in S_restore_cop_warnings(() is to modify PL_cucop, but in order to pass
a COP rather than a COP*, the original commit made a local copy of
PL_curcop and ended up inadvertently updating the copy instead.
This commit changes the maco so it expects a COP*, and updates the bulk
of its callers to use &PL_compiling rather than PL_compiling, and fixes
up S_restore_cop_warnings().
The symptoms were ASAN failures in a few test scripts including
uni/parser.t and ext/XS-APItest/t/handy0*.t.
(The S_restore_cop_warnings() function was only used by
Perl__force_out_malformed_utf8_message(), so didn't cause many issues
outside of test scripts which forced such "malformed "errors).
|
|
|
|
|
| |
This is avoiding the boilerplate to free
the cop_warning string when setting it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous commit added a mutex specifically for protecting against
simultaneous accesses of the environment. This commit changes the
normal getenv, putenv, and clearenv functions to use it, to avoid races.
This makes the code simpler in places where we've gotten burned and
added stuff to avoid races. Other places where we haven't known we were
getting burned could have existed until now. Now that comes
automatically, and we can remove the special cases we earlier stumbled
over.
getenv() returns a pointer to static memory, which can be overwritten at
any moment from another thread, or even another getenv from the same
thread. This commit changes the accesses to be under control of a
mutex, and in the case of getenv, a mortalized copy is created so that
there is no possible race.
|
| |
|
|
|
|
|
|
|
|
|
| |
Old glibc versions had a buggy modulo implementation for 64 bit
integers on 32-bit architectures. This was fixed in glibc 2.3,
released in 2002 (the version check in the code is overly cautious).
Removing the alternate PP function support is left for the next
commit, in case we need to resurrect it in future.
|
|
|
|
|
|
|
| |
check that porting/copyright.t is passing when
run with --now
../perl -I../lib porting/copyright.t --now
|
|
|
|
|
|
|
| |
This replaces strchr("list", c) calls throughout the core. They don't
work properly when 'c' is a NUL, returning the position of the
terminating NUL in "list" instead of failure. This could lead to
segfaults or even security issues.
|
|
|
|
|
| |
and the associated commits, at least until a way to make
wrap_op_checker() work is available.
|
|
|
|
| |
Fixes issue #14816
|
|
|
|
| |
This is for Devel::PPPort.
|