summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * fix thread issue with PERL_GLOBAL_STRUCTDavid Mitchell2019-02-197-15/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Perl_my_cxt_init: fix potential race conditionDavid Mitchell2019-02-191-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
| * PL_InBitmap: fix with -DPERL_GLOBAL_STRUCT_PRIVATEDavid Mitchell2019-02-191-1/+1
| | | | | | | | | | Valgrind wasn't happy, as this global var wasn't being initialised to NULL.
| * foo_cloexec() under PERL_GLOBAL_STRUCT_PRIVATEDavid Mitchell2019-02-195-10/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * PERL_GLOBAL_STRUCT_PRIVATE: fix some const stringsDavid Mitchell2019-02-194-10/+8
| | | | | | | | | | | | | | | | | | | | | | 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.
| * regcomp.c: don't include INTERN.hDavid Mitchell2019-02-192-4/+7
| | | | | | | | | | | | | | | | | | | | | | 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
| * ext/SDBM_File/sdbm.c: don't include INTERN.hDavid Mitchell2019-02-191-1/+0
| | | | | | | | | | | | | | | | 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.
| * vutil.c: build under PERL_GLOBAL_STRUCT_PRIVATEDavid Mitchell2019-02-191-0/+5
| | | | | | | | | | | | | | | | 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.
| * add dVAR's for PERL_GLOBAL_STRUCT_PRIVATE buildsDavid Mitchell2019-02-1911-0/+68
|/ | | | | | 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.
* re/user_prop_race_thr.t: reduce timeoutDavid Mitchell2019-02-191-1/+1
| | | | | | | | | | 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.
* Update Time-HiRes Changes for 1.9760Nicolas R2019-02-181-0/+57
| | | | | | | | | | | | | | | 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
* Update releaser managersSawyer X2019-02-181-2/+2
|
* deprecate: bump $VERSION to 0.04Aristotle Pagaltzis2019-02-181-1/+1
|
* deprecate: expand the documentationAristotle Pagaltzis2019-02-181-10/+45
|
* prepare next patchAristotle Pagaltzis2019-02-181-1/+0
|
* deprecate: fix POD heading levelAristotle Pagaltzis2019-02-181-1/+2
|
* mktables: Omit unnecessary duplicatesKarl Williamson2019-02-164-4/+4
| | | | These are in a generated structure.
* perldelta: perldelta for previous commitKarl Williamson2019-02-161-1/+4
|
* malloc.c: Limit malloc size to PTRDIFF_MAXKarl Williamson2019-02-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/
* regcomp.c: Don't interate a loop needlesslyKarl Williamson2019-02-161-2/+3
| | | | | While single stepping in gdb, I noticed that this loop kept executing, when it need not.
* perldelta for previous commiKarl Williamson2019-02-161-0/+5
|
* PATCH: [perl #133770] null pointer dereference in S_regclass()Karl Williamson2019-02-161-3/+5
| | | | | | | | | | | | | | | | | | | | 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.
* PATCH: [perl #133767] Assertion failureKarl Williamson2019-02-163-2/+13
| | | | | | | | | | | 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.
* Jakub Wilk is now a Perl author.James E Keenan2019-02-151-0/+1
|
* perlthrtut: Fix POD formattingJakub Wilk2019-02-151-3/+3
|
* Use STATIC_ASSERT_STMT for checking compile-time invariantsDagfinn Ilmari Mannsåker2019-02-151-3/+2
| | | | | Better to have the build fail if they're wrong than relying on the code path being hit at runtime in a DEBUGGING build.
* Merge branch 'incore' into bleadKarl Williamson2019-02-1423-1137/+1495
|\ | | | | | | | | | | | | 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.
| * Remove relics of regex swash useKarl Williamson2019-02-148-739/+63
| | | | | | | | | | | | | | | | | | | | | | 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.
| * Use mnemonics for array indicesKarl Williamson2019-02-141-15/+26
| | | | | | | | | | The element at say, [0] is a particular thing. This commit changes to use a mnemonic instead of [0], for clarity
| * regcomp.c: Arrays no longer need PL_sv_undef placeholdersKarl Williamson2019-02-141-29/+22
| | | | | | | | An empty entry is now just NULL.
| * regcomp.c: Simplify args passing for ANYOF nodesKarl Williamson2019-02-142-94/+47
| | | | | | | | | | | | | | | | | | | | 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.
| * Add .t for testing user-defined \p{} racesKarl Williamson2019-02-142-0/+118
| |
| * t/re/regexp_unicode_prop.t: Make sure sub called only onceKarl Williamson2019-02-141-5/+18
| | | | | | | | | | | | | | 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.
| * t/re/regexp_unicode_prop.t: Add testsKarl Williamson2019-02-141-1/+76
| | | | | | | | | | Add some tests. These test various error conditions that haven't been tested before.
| * t/re/regexp_unicode_prop.t: Test that can have nested pkgsKarl Williamson2019-02-141-2/+2
| | | | | | | | That is, in \p{user-defined}
| * t/re/regexp_unicode_prop.t: Add some stressKarl Williamson2019-02-141-5/+8
| | | | | | | | | | This adds some trailing spaces and comments in expansion of \p{user-defined}/ to verify things work.
| * t/op/taint.t: Add testKarl Williamson2019-02-141-1/+17
| |
| * regcomp.c: Add some potential code that's #ifdef'd outKarl Williamson2019-02-141-0/+52
| | | | | | | | | | | | | | | | | | | | | | 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.
| * Move \p{user-defined} to core from utf8_heavy.plKarl Williamson2019-02-148-245/+988
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Add global hash to handle \p{user-defined}Karl Williamson2019-02-145-1/+42
| | | | | | | | | | | | | | 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.
| * Add mutex for dealing with qr/\p{user-defined}/Karl Williamson2019-02-148-3/+21
| | | | | | | | This will be used in future commits
| * regcomp.c: Add/reword some comments/white-spaceKarl Williamson2019-02-141-41/+39
| |
| * regcomp.c: Change variable nameKarl Williamson2019-02-141-13/+13
|/ | | | The new name more closely corresponds with its use.
* perldelta prep setup for v5.29.8Nicolas R2019-02-141-130/+46
| | | | | | | | | | | | | 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.
* perldelta module changes from ext,libNicolas R2019-02-141-50/+18
| | | | remove useless module sections for 5.29.8
* Update Modules section for perldelta for 5.29.8Nicolas R2019-02-141-0/+18
| | | | | List cpan & dist packages updated since v5.29.7 and add a warning for the JSON::PP incompatible changes.
* Update JSON-PP to CPAN version 4.00Nicolas R2019-02-1440-396/+848
| | | | | | | | | | | | | | | | | | | [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
* t/porting/manifest.t add line numberNicolas R2019-02-141-3/+3
| | | | | Improve t/porting/manifest.t output on errors to show the line number.
* Net::Ping 501_ping_icmpv6.t: disable sudo testNicolas R2019-02-143-1/+3
| | | | | This is similar to the changes made in 7bfdd8260c we do not want to use 'sudo' during the tests.
* Update Net::Ping to upstream version 2.71Nicolas R2019-02-1416-103/+547
| | | | | | | | | | 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