| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The MY_CXT subsystem allows per-thread pseudo-static data storage.
Part of the implementation for this involves each XS module being
assigned a unique index in its my_cxt_index static var when first
loaded.
Because PERL_GLOBAL_STRUCT bans any static vars, under those builds
there is instead a table which maps the MY_CXT_KEY identifying string to
index.
Unfortunately, this table was allocated per-interpreter rather than
globally, meaning if multiple threads tried to load the same XS module,
crashes could ensue.
This manifested itself in failures in
ext/XS-APItest/t/keyword_plugin_threads.t
The fix is relatively straightforward: allocate PL_my_cxt_keys globally
rather than per-interpreter.
Also record the size of this struct in a new var, PL_my_cxt_keys_size,
rather than doing double duty on PL_my_cxt_size.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(Found by code inspection - I can't reproduce a failure)
the MY_CXT subsystem, which allows per-thread pseudo-static variables,
has a thread race condition.
When a module is first loaded, it is allocated unique index (from
PL_my_cxt_index++) which is assigned to the module's my_cxt_index static
var.
If two threads both try to load an XS module at the same time, its
possible for one thread to set my_cxtp, then a second thread to overwrite
it with a higher value, causing the first thread to use the wrong index
into its local storage.
|
| |
| |
| |
| |
| | |
Valgrind wasn't happy, as this global var wasn't being initialised to
NULL.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fix the various Perl_PerlSock_dup2_cloexec() type functions so that
t/porting/liberl.a passes under -DPERL_GLOBAL_STRUCT_PRIVATE builds.
In these builds it is forbidden to have any static variables, but each
of these functions (via convoluted macros) has a static var called
'strategy' which records, for each function, whether a run-time probe
has been done to determine the best way of achieving close-exec
functionality, and the result.
Replace them all with 'global' vars: PL_strategy_dup2 etc.
NB these vars aren't thread-safe but it doesn't really matter, as the
worst that can happen is for a redundant probe or two to be done before
a suitable "don't probe any more" value is written to the var and seen
by all the threads.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
change a couple of
const char * foo[] = { ... }
to
const char * const foo[] = { ... }
Making the string ptrs const means the whole thing is RO and doesn't
appear in data section, making porting/libperl.t happier when building
under -DPERL_GLOBAL_STRUCT_PRIVATE.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This file only needs including by globals.c; it was being included
in regcomp.c too as the declarations in regcomp.h aren't included by
perl.h and thus don't get pulled into globals.c. This was a confusing
and hacky workaround.
Instead, this commit causes globals.c to #include regcomp.h directly
After this commit, only globals.c #includes INTERN.h
|
| |
| |
| |
| |
| |
| |
| |
| | |
This file really only needs including by globals.c - including it in
sdbm.c was probably just a thinko or cut and paste error from decades ago.
Removing it doesn't seem to break anything.
After this commit, only globals.c and regcomp.c include it.
|
| |
| |
| |
| |
| |
| |
| |
| | |
The perl build option -DPERL_GLOBAL_STRUCT_PRIVATE had bit-rotted
due to lack of smoking. This commit and the next fix it.
I've separated out the vutil.c change into a separate commit since
this file is actually part of the 'version' CPAN distribution and
normally should be edited upstream first.
|
|/
|
|
|
|
| |
The perl build option -DPERL_GLOBAL_STRUCT_PRIVATE had bit-rotted
due to lack of smoking. The main fix is to just add 'dVAR;' to any
functions which have a pTHX arg. It's a NOOP on normal builds.
|
|
|
|
|
|
|
|
|
|
| |
This new test script has a test that's supposed to exercise an up-to 10s
wait-and-retry loop when loading properties. It has a 500s timeout
built-in for if that fails. On my system its been intermittently
failing (not sure if due to something I'm doing or a problem with the
test or with regcomp.c) which effectively hangs the test run.
So decrease the timeout to 25 secs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1.9760 is now released to CPAN to match its status
in blead.
This commit is synchronizing the Changelog, by reintroducing
some history which were lost during previous reverts.
Any new change since cf8375d should now go to the next release 1.9761.
A '{{NEXT}}' entry was added to the Changes for tracking these changes.
Note that a Dual-Life git repository is now available for Time-HiRes.
Upstream-URL: https://github.com/Dual-Life/Time-HiRes
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
These are in a generated structure.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without doing this, it is possible that the behavior is undefined when
subtracting two pointers that point to the same object.
See thread beginning at
http://nntp.perl.org/group/perl.perl5.porters/251541
In particular this from Tomasz Konojacki
C11 says:
> When two pointers are subtracted, both shall point to elements of the
> same array object, or one past the last element of the array object;
> the result is the difference of the subscripts of the two array
> elements. The size of the result is implementation-defined, and its
> type (a signed integer type) is ptrdiff_t defined in the <stddef.h>
> header. If the result is not representable in an object of that type,
> the behavior is undefined.
There are many ways to interpret this passage, but according to (most?)
C compilers developers, it means that no object can be larger than
PTRDIFF_MAX. For example, gcc's optimizer assummes that strlen() will
never return anything larger than PTRDIFF_MAX [1].
There's also a blogpost[2] on this topic, which IMO is a very
interesting read.
If gcc and clang can assume that all objects won't be larger than
PTRDIFF_MAX, so can we. Also, in practice, ssize_t and ptrdiff_t on most
(all?) platforms are defined as exactly the same type.
BTW, the fact that compilers assume that objects can't be larger than
PTRDIFF_MAX has very dangerous implications on 32-bit platforms. Is it
possible to create string longer than PTRDIFF_MAX on 32-bit perls?. It
shouldn't be allowed.
[1] - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78153
[2] - https://trust-in-soft.com/objects-larger-than-ptrdiff_max-bytes/
|
|
|
|
|
| |
While single stepping in gdb, I noticed that this loop kept executing,
when it need not.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The failing case can be reduced to
qr/\x{100}[\x{3030}\x{1fb2}/
(It only happens on UTF-8 patterns).
The bottom line is that it was assuming that there was at least one
character that folded to 1fb2 besides itself, even though the function
call said there weren't any such. The solution is to pay attention to
the function return value.
I incorporated Hugo's++ patch as part of this one.
However, the original test case should never have gotten this far. The
parser is getting passed garbage, and instead of croaking, it is somehow
interpreting it as valid and calling the regex compiler. I will file a
ticket about that.
|
|
|
|
|
|
|
|
|
|
|
| |
The problem here is that a syntax error occurs and hence certain things
don't get done, but processing continues, as the error isn't checked for
until after the return of the function that found it. The failing
assertion is checking that those certain things actually did get done.
There appear to be good reasons to defer the raising of the error until
then, so the simplest way to fix this is to generalize the code so that
the failing assertion doesn't happen.
|
| |
|
| |
|
|
|
|
|
| |
Better to have the build fail if they're wrong than relying on the
code path being hit at runtime in a DEBUGGING build.
|
|\
| |
| |
| |
| |
| |
| | |
This branch moves the handling of user-defined \p{} properties from
lib/utf8_heavy.pl into regcomp.c (rewriting it in C). This fixes a
bunch of bugs, and removes all uses of swashes from regular expression
compilation and execution.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This removes the most obvious and easy things that are no longer needed
since regexes no longer use swashes at all.
tr/// continues, for the time being, to use swashes, so not all swash
handling is removable now. But tr/// doesn't use inversion lists, and
so a bunch of code is ripped out here. Other code could have been, but
I did only the relatively easy stuff. The rest can be ripped out all at
once when tr/// is stops using swashes.
|
| |
| |
| |
| |
| | |
The element at say, [0] is a particular thing. This commit changes to
use a mnemonic instead of [0], for clarity
|
| |
| |
| |
| | |
An empty entry is now just NULL.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A swash is no longer used, so we can remove some elements from the array
of data that gets stored with the compiled pattern for use in runtime
matching. This is the first step in more simplifications.
Since a swash isn't used, this change also requires regexec.c to change
to use a straight inversion list lookup. This has the salutary effect
of eliminating a conversion between code point and UTF-8.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
User-defined properties are supposed to be called just once for /i and
once for non-/i. This adds tests for that.
It turns out that this was broken in blead.
|
| |
| |
| |
| |
| | |
Add some tests. These test various error conditions that haven't been
tested before.
|
| |
| |
| |
| | |
That is, in \p{user-defined}
|
| |
| |
| |
| |
| | |
This adds some trailing spaces and comments in expansion of
\p{user-defined}/ to verify things work.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is in case we ever need it. This checks for portability in the
code points specified in user-defined properties. Previously there was
a check, but I couldn't get a warning to trigger unless there was also
overflow. So that means the pattern compile failed due to the overflow,
and the portability warning was superfluous. But, one can have
non-portable code points without overflow; just the old method didn't
properly detect them. If we do ever need to detect and report on them,
the code is mostly written and in this commit.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This large commit moves the handling of user-defined properties to C
code. This should speed it up, but the main reason to do this is to
stop using swashes in this case, leaving only tr/// using them. Once
that too is converted, all swash handling can be ripped out of perl.
Doing this in perl has caused some nasty interactions that will now be
fixed automatically.
The change is not entirely transparent, however (besides speed and the
possibility of removing these interactions). perldelta in this commit
details these.
|
| |
| |
| |
| |
| |
| |
| | |
A global hash has to be specially handled. The keys can't be shared,
and all the SVs stored into it must be in its thread. This commit adds
the hash, and initialization, and macros for context change, but doesn't
use them. The code to deal with this is entirely confined to regcomp.c.
|
| |
| |
| |
| | |
This will be used in future commits
|
| | |
|
|/
|
|
| |
The new name more closely corresponds with its use.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a preparation commit for the future
Perl v5.29.8 release.
perldelta still contains some placeholder which
would need to be cleanup before release and would
also need to take into account any changes since
commit 5eabe055
Several sections have already been removed considering
they would not be used, feel free to restore them if required.
|
|
|
|
| |
remove useless module sections for 5.29.8
|
|
|
|
|
| |
List cpan & dist packages updated since v5.29.7
and add a warning for the JSON::PP incompatible changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[DELTA]
4.00 2018-12-07
- production release
3.99_01 2018-12-03
- BACKWARD INCOMPATIBILITY:
As JSON::XS 4.0 changed its policy and enabled allow_nonref
by default, JSON::PP also enabled allow_nonref by default
- implement allow_tags that was introduced by JSON::XS 3.0
- add boolean_values that was introduced by JSON::XS 4.0
- allow literal tags in strings in relaxed mode, as JSON::XS 3.02 does
- allow PERL_JSON_PP_USE_B environmental variable to restore
old number detection behavior for compatibility
- various doc updates
|
|
|
|
|
| |
Improve t/porting/manifest.t output on errors
to show the line number.
|
|
|
|
|
| |
This is similar to the changes made in 7bfdd8260c
we do not want to use 'sudo' during the tests.
|
|
|
|
|
|
|
|
|
|
| |
This retains blead customizations:
* 1a58b39af8 remove of 'use vars'
* 7bfdd8260c 500_ping_icmp.t: remove sudo code
These changes are not required anymore, they
are merged upstream
* 0fc44d0a18 avoid stderr noise in tests
|