Karl Williamson [Tue, 18 Feb 2014 17:24:31 +0000 (10:24 -0700)]
regcomp.c: Fix more alignment problems
I believe this will fix the remaining alignment problems recently being
shown on gcc on HP-UX, It works on the procura machine.
regnodes should not have stricter alignment than required by U32, for
reasons given in the comments this commit adds to the beginning of
regcomp.h. Commit
31f05a37 added a new ANYOF regnode struct with a
pointer field. This requires stricter alignment on some 64-bit platforms,
and hence doesn't work on those platforms.
This commit removes that regnode struct type, and instead stores the
pointer it used via a more indirect, but already existing mechanism
that stores other data..
The function that returns that other data is enlarged to return this new
field as well. It now needs to be called from regcomp.c, so the
previous commit had renamed and made it accessible from there. The
"public" function that wraps this one is unchanged. (I put "public" in
quotes here, because I don't think anyone outside core is or should be
using it, but since it has been publicly available for a long time, I'm
treating the API as unchangeable. regcomp.c called this public function
before this commit, but needs the additional data returned by the inner
one).
Karl Williamson [Tue, 18 Feb 2014 16:05:09 +0000 (09:05 -0700)]
regexec.c: Rename function, add parameter, make non-static
This is in preparation for a future commit where the function does more
things so its current name would be misleading. It will need to be
callable from regcomp.c as well.
Karl Williamson [Tue, 18 Feb 2014 15:57:48 +0000 (08:57 -0700)]
regcomp.h: Allow compiler to perform calculation
Instead of doing the calculation of how many bytes a 256 bitmap
occupies, let the compiler do it. I believe we are not too far away
from having the ability to allow applications to recompile Perl to
increase the bitmap size trading speed for memory. ICU has an 8192
bitmap last time I checked.
Karl Williamson [Mon, 17 Feb 2014 23:04:06 +0000 (16:04 -0700)]
regexec.c: Add some checks
These aren't currently needed, but a future commit will change so things
need to be more general
Karl Williamson [Mon, 17 Feb 2014 22:39:12 +0000 (15:39 -0700)]
Change method of passing some info from regcomp to regexec
For the last several releases, the fact that an ANYOF node could match
something outside its bitmap has been passed to regexec.c by having its
ARG field not be -1 (appropriately cast). A bit was set if the match
could occur even if the target string was not UTF-8 encoded. This
design was used to save a bit, as previously there was a bit also for it
matching UTF-8 strings.
That design is no longer tenable, as a future commit will have a third
(independent) reason for something to match outside the bitmap, This
commits uses the current spare bit flag to indicate if the match can
only occur if the target string is UTF-8.
Karl Williamson [Mon, 17 Feb 2014 22:40:50 +0000 (15:40 -0700)]
regcomp.h: Remove extraneous comment
This is obsolete and is a partial copy of the up-to-date comment below
it.
Karl Williamson [Mon, 17 Feb 2014 20:57:11 +0000 (13:57 -0700)]
regcomp.h: Free up flag bit in ANYOF nodes
The ANYOF_LOC bit was removed from final use in the previous commit.
Karl Williamson [Mon, 17 Feb 2014 20:47:00 +0000 (13:47 -0700)]
regexes: Remove uses of ANYOF_LOCALE flag
This flag no longer adds any useful information and can be removed. An
ANYOF node that depends on locale either matches a POSIX class like /d,
or matches case insensitively, or both. There are flags for both these
cases, and to see if something matches locale, one merely needs to see
if either flag is set.
Not having to keep track of this extra flag simplifies things, and will
allow it to be removed. There was a time when this flag was shared with
one of the remaining locale ones, and there was relict code that allowed
that sharing to be reinstated, and which this commit also removes.
Karl Williamson [Mon, 17 Feb 2014 19:49:10 +0000 (12:49 -0700)]
regcomp.c: Simplify /l Synthetic Start Class construction
The ANYOF_POSIXL flag is needed in general for ANYOF nodes to indicate
if the struct contains an extra U32 element used to hold the list of
POSIX classes (like \w and [:punct:]) whose matches depend on the locale
in effect at the time of runtime pattern matching.
But the SSC always contains this U32, and so doesn't need to use the
flag. Instead, if there aren't any such classes, the U32 will be zero.
Removing keeping track of this flag during the assembly of the SSC
simplifies things. At the completion of this process, this flag is
set if the U32 is non-zero to pass that information on to regexec.c so
that it doesn't have to special case things.
Karl Williamson [Sat, 15 Feb 2014 21:45:03 +0000 (14:45 -0700)]
Convert more EXACTFish nodes to EXACT when possible
Under /i matching, many characters match only themselves, such a
punctuation. If a node contains only such characters it can be an EXACT
node. The optimizer gets better hints when dealing with EXACT nodes
than ones with folding.
This changes the alloc_maybe_populate() function to look for
possibilities of non-folding input.
Rafael Garcia-Suarez [Wed, 19 Feb 2014 14:41:51 +0000 (15:41 +0100)]
Do not dereference hv before ensuring it's not NULL
This should fix RT #116441 and possibly other bugs.
Tony Cook [Wed, 19 Feb 2014 09:26:38 +0000 (20:26 +1100)]
perldelta updates
Tony Cook [Wed, 19 Feb 2014 04:12:31 +0000 (15:12 +1100)]
save errno/$! across Win32.pm autoloads too
Tony Cook [Wed, 19 Feb 2014 04:01:06 +0000 (15:01 +1100)]
cygwin doesn't implement $^E (except as a read of $!)
On Cygwin, reading $^E actually reads $!, as it does on other non-
VMS/Win32/OS/2 platforms. Setting it does nothing.
James E Keenan [Wed, 19 Feb 2014 02:27:30 +0000 (03:27 +0100)]
Correct number of tests in plan.
David Golden [Wed, 19 Feb 2014 01:29:52 +0000 (20:29 -0500)]
perlvar.pod: suggest string comparisons for $]
David Golden [Wed, 19 Feb 2014 01:10:45 +0000 (20:10 -0500)]
restore $PERL_OLD_VERSION to English.pm
In the dark ages, when $^V replaced $] for $PERL_VERSION,
$PERL_OLD_VERSION was added as a comment in the list of deprecated
variable. Since $] is *not* deprecated, this commit restores it.
Tony Cook [Tue, 11 Feb 2014 05:42:57 +0000 (16:42 +1100)]
[perl #121081] workaround different output on VMS
VMS is a special snowflake, deal with the slightly different debugger
output it produces.
David Golden [Tue, 18 Feb 2014 20:41:28 +0000 (15:41 -0500)]
Update HTTP-Tiny to CPAN version 0.042
[DELTA]
[ADDED]
- If IO::Socket::IP 0.25+ is installed, HTTP::Tiny will use it for
transparent IPv4 or IPv6 support.
Karl Williamson [Tue, 18 Feb 2014 16:19:46 +0000 (09:19 -0700)]
Fix pod errors
Ricardo Signes [Tue, 18 Feb 2014 13:38:44 +0000 (08:38 -0500)]
re-import 5.19.8 delta form 5.19.8
Tony Cook [Tue, 18 Feb 2014 10:03:29 +0000 (21:03 +1100)]
update perlport with currently unresolved Cygwin test failures
Tony Cook [Tue, 18 Feb 2014 09:37:47 +0000 (20:37 +1100)]
Update Parse-CPAN-Meta to CPAN version 1.4413
1.4413 2014-02-17 20:04:23-05:00 America/New_York
[FIXED]
- UTF-8 decoding is done differently to avoid requiring
a newer version of Encode (Graham Knop)
Tony Cook [Tue, 18 Feb 2014 09:14:07 +0000 (20:14 +1100)]
perldelta updates
Steve Hay [Tue, 18 Feb 2014 08:51:49 +0000 (08:51 +0000)]
Upgrade Digest-SHA from 5.86 to 5.87
Karl Williamson [Tue, 18 Feb 2014 06:10:51 +0000 (23:10 -0700)]
locale.c: Fix initialization compile error for HP
One of the HP compilers would not compile the compile-time array
initialization; so do it at runtime.
Tony Cook [Tue, 18 Feb 2014 04:13:20 +0000 (15:13 +1100)]
[perl #120936] op/taint.t handling of no ipcsysv on cygwin
shmget() and msgget() produce a SIGSYS on cygwin if cygserver isn't
running, crashing op/taint.t.
Perform similar checks to those done in io/shm.t to make sure these
are handled gracefully.
Tony Cook [Tue, 18 Feb 2014 00:37:45 +0000 (11:37 +1100)]
test.pl uses skip_all(...), not plan(skip_all => ...)
This was causing noise on cygwin systems that don't have cygserver
running.
Tony Cook [Mon, 17 Feb 2014 23:38:43 +0000 (10:38 +1100)]
avoid a "FILE" name conflict with cygwin's wchar.h
The 1.7.28 release of cygwin (or possible a separate package released
around the same time) header wchar.h includes the following code:
typedef __FILE FILE;
With PERLIO_NOT_STDIO set to true, the default for core source files, we
#include nostdio.h which does:
struct _FILE;
#define FILE struct _FILE
which turns the above code into:
typedef __FILE struct _FILE;
which isn't C.
Disable this hack for cygwin.c
Chris 'BinGOs' Williams [Mon, 17 Feb 2014 21:03:54 +0000 (21:03 +0000)]
Skip locale test on OpenBSD, MirBSD and Bitrig too
From the original ticket #115808 the following should produce
"Use of uninitialized value in print at -e line 1."
$ perl -wle 'use POSIX; print length setlocale POSIX::LC_ALL, "mtfnpy"'
16
So skip this test on OpenBSD, MirBSD and Bitrig
Chris 'BinGOs' Williams [Mon, 17 Feb 2014 20:30:07 +0000 (20:30 +0000)]
Update HTTP-Tiny to CPAN version 0.041
[DELTA]
0.041 2014-02-17 13:07:54-05:00 America/New_York
[no code change, only an amended Changes file]
[INCOMPATIBLE CHANGES (from 0.039)]
- The 'proxy' attribute no longer takes precedence over the
'http_proxy' environment variable. With the addition of http_proxy
and https_proxy attributes (and corresponding environment variable
defaults), the legacy 'proxy' attribute now maps to the
all_proxy/ALL_PROXY environment variable and only takes effect when
other proxy attributes are not defined.
[ADDED (since 0.039)]
- Added 'keep_alive' attribute for single-server persistent connections
(Clinton Gormley)
- Added support for Basic authorization with proxies
- Added support for https proxies via CONNECT
[FIXED (since 0.039)]
- Requests are made with one less write for lower latency (Martin
Evans)
0.040 2014-02-17 13:02:47-05:00 America/New_York
[INCOMPATIBLE CHANGES]
- The 'proxy' attribute no longer takes precedence over the
'http_proxy' environment variable. With the addition of http_proxy
and https_proxy attributes (and corresponding environment variable
defaults), the legacy 'proxy' attribute now maps to the
all_proxy/ALL_PROXY environment variable and only takes effect when
other proxy attributes are not defined.
[ADDED]
- Added support for Basic authorization with proxies
- Added support for https proxies via CONNECT
Karl Williamson [Wed, 12 Feb 2014 03:27:30 +0000 (20:27 -0700)]
regcomp.c: Fix some alignment problems
The bracketed character class (e.g. /[abc]/) in regular expression
patterns is implemented as an ANYOF regnode. There are several
different structs used for these, each a superset of the next smaller
size, with extra fields tacked on to its end. Bits in the part common
to all of them are set to indicate which size this particular instance
is.
Several functions in regcomp.c take the largest of these as a formal
parameter, even though a smaller one may actually be passed. This
avoids the need to have casts to access the optional fields, but the
code needs to be careful to check the common part bits before trying to
access a portion that may not actually be present. This practice dates
to at least Perl v5.6.2.
It turns out that there is further a problem with this if the tacked-on
fields require a stricter alignment than the common fields. The code in
the functions may assume that the actual parameter has suitable
alignment, which may not be the case.
Some months ago I added some extra optional pointer fields, which have
stricter alignment requirements on 64-bit machines than the common
portion, but no apparent problems ensued.
Then, I changed things slightly, so that the gcc compiler on HP machines
found an optimization possibility whose use required the proper
alignment, which wasn't present, and bus errors started happening there.
Tony Cook diagnosed the problem. A summary of his work can be found
at http://markmail.org/message/hee5zyah7rb62c72
This commit changes the formal parameter to the smallest ANYOF struct,
and uses casts to acess the optional portions.
I don't know how common the coding style formerly used in regcomp.c is,
but it is dangerous and can lead to unrelated changes causing errors.
This commit should enable gcc builds to complete on the HP gcc smokers
(previously miniperl built, but crashed in building the rest of perl),
but we're not sure because unrelated header issues on the gcc on the
machine that we have access to prevent blead from fully compiling there.
There remain alignment bugs which will cause the tests to fail there, as
the appended pointer field needs to have strict alignment on that
platform, but when the regnodes are allocated alignment isn't done. I
am working on fixing those.
Karl Williamson [Mon, 17 Feb 2014 15:11:04 +0000 (08:11 -0700)]
locale.c: Remove vars unused on some platforms
A Darwin compiler noted these are unused.
Chris 'BinGOs' Williams [Mon, 17 Feb 2014 12:46:15 +0000 (12:46 +0000)]
Update Parse-CPAN-Meta to CPAN version 1.4412
[DELTA]
1.4412 2014-02-17 07:14:43-05:00 America/New_York
[FIXED]
- Added prerequisite on Encode 2.11 (Paul Howarth)
1.4411 2014-02-16 23:06:00-05:00 America/New_York
[FIXED]
- Invalid UTF-8 encoding in YAML files are now replaced with "PERLQQ"
quoting from the Encode module and without warnings.
- Removed legacy test modifications for $ENV{PERL_CORE}
Karl Williamson [Mon, 17 Feb 2014 06:03:43 +0000 (23:03 -0700)]
PATCH [perl #121257] blead fails at run/locale.t
Commit 65ebb05984db179833ff252f547043f32184d893changed the locale
initialization code to look at the LANG environment variable as a
fallback if there was a problem with a higher priority variable.
Thus, when trying to have an empty environment for testing, one now
needs to cause LANG to be unset, which wasn't the case before..This
commit adds that unset to the test that needs an empty environment.
Karl Williamson [Mon, 17 Feb 2014 05:41:58 +0000 (22:41 -0700)]
t/run/locale.t: Fix skip count
This skipped the wrong number of tests on platforms that don't have a
locale whose decimal radix character isn't a dot. (e.g. no locales with
a comma).
Karl Williamson [Mon, 17 Feb 2014 05:06:03 +0000 (22:06 -0700)]
locale.c: Handle case where LC_ALL isn't "all"
Setting the LC_ALL locale category on NetBSD does not necessarily change
all the categories to the requested locale. Sometimes the LC_COLLATE
category is set to POSIX. I presume that is because collation has not
been defined for the given locale, so it uses a basic locale instead.
The code in locale.c that does locale initialization for the Perl
program at start-up, depended on LC_ALL setting all categories to the
same locale.
Karl Williamson [Sun, 16 Feb 2014 17:29:43 +0000 (10:29 -0700)]
sv.h: Add comment
There was recent confusion about this.
Father Chrysostomos [Mon, 17 Feb 2014 02:07:17 +0000 (18:07 -0800)]
Avoid recalculating sub name hash in util.c:get_db_sub
James E Keenan [Tue, 11 Feb 2014 00:50:47 +0000 (01:50 +0100)]
Clarify distinction between contents of dist/ and ext/.
Amended with a suggestion from rjbs.
For: RT #120808
Tony Cook [Sun, 16 Feb 2014 22:57:53 +0000 (09:57 +1100)]
[perl #121223] encourage use of PERL_NO_GET_CONTEXT
Tony Cook [Sun, 16 Feb 2014 22:54:42 +0000 (09:54 +1100)]
[perl #121223] explain PERL_NO_GET_CONTEXT a little
and tell the reader where to find the details.
Daniel Dragan [Thu, 13 Feb 2014 00:07:56 +0000 (11:07 +1100)]
add #define PERL_NO_GET_CONTEXT to ParseXS's pods
Not using PERL_NO_GET_CONTEXT is for legacy or unmaintained pre-ithreads
code. New code should define it.
Father Chrysostomos [Sun, 16 Feb 2014 20:43:42 +0000 (12:43 -0800)]
[perl #121255] Call set-magic when setting $DB::sub
Otherwise UTF8 length caches will not be reset, resulting in panicks
when ${^UTF8CACHE} is -1 or wrongs answers from length($DB::sub) when
${^UTF8CACHE} is 1.
Craig A. Berry [Sun, 16 Feb 2014 20:22:25 +0000 (14:22 -0600)]
Exclude Perl_my_setlocale symbol where it's not defined.
Because makedef.pl doesn't take into account the various ifdefs
in embed.fnc, it must repeat their logic by maintaining various
sets of platform-specific inclusions and exclusions.
Perl_my_setlocale was added in
b385bb4ddcb for Win32 only, so we
shouldn't be telling the linker to export it except on Win32.
Chris 'BinGOs' Williams [Sun, 16 Feb 2014 13:38:19 +0000 (13:38 +0000)]
Update Parse-CPAN-Meta to CPAN version 1.4410
[DELTA]
1.4410 2014-02-16 00:47:48-05:00 America/New_York
[INCOMPATIBLE CHANGES]
- Dropped support for Perl's before v5.8.1 to ensure proper
UTF-8 and IO layer support
[CHANGED]
- Updated CPAN::Meta::YAML prereq to 0.011 due to deprecation
of 'errstr' and consistent use of exceptions
Karl Williamson [Sun, 16 Feb 2014 05:21:37 +0000 (22:21 -0700)]
perllocale: Corrections and nits
Karl Williamson [Sun, 16 Feb 2014 05:18:43 +0000 (22:18 -0700)]
perlfunc: Nit
Karl Williamson [Sun, 16 Feb 2014 04:59:51 +0000 (21:59 -0700)]
Revert "Free up bit for regex ANYOF nodes"
This reverts commit
34fdef848b1687b91892ba55e9e0c3430e0770f6, and
adds comments referring to it, in case it is ever needed.
Karl Williamson [Thu, 30 Jan 2014 03:42:33 +0000 (20:42 -0700)]
Free up bit for regex ANYOF nodes
This commit frees up a bit by using an extra regnode to pass the
information to the regex engine instead of the flag. I originally
thought that if this was needed, it should be the ANYOF_ABOVE_LATIN1_ALL
bit, as that might speed some things up. But if we need to do this
again by adding another node to get another bit, we want one that is
mutually exclusive of the first one we did, For otherwise we start
having to make 3 nodes instead of two to get the combinations:
1 0
0 1
1 1
This combinatorial problem is avoided by using bits that are mutually
exclusive, which the ABOVE_LATIN1_ALL isn't, but the one freed by this
commit ANYOF_NON_UTF8_NON_ASCII_ALL is only set under /d matching, and
there are other bits that are set only under /l, so if we need to do
this again, we should use one of those.
I wrote this code when I thought I really needed a bit. But since, I
have figured out a better way to get the bit needed now. But I don't
want to lose this code to posterity, so this commit is being made long
enough to get the commit number, then it will be reverted, adding
comments referring to the commit number, so that it can easily be
reconstructed when necessary.
Father Chrysostomos [Sun, 16 Feb 2014 04:40:15 +0000 (20:40 -0800)]
alphabetise perldiag
Karl Williamson [Thu, 13 Feb 2014 00:04:52 +0000 (17:04 -0700)]
ext/POSIX/POSIX.xs: Add comments
If these few lines are uncommented, the isfoo() functions will no longer
return TRUE for an empty string input. Since we decided to deprecate
them, it will be unlikely that we do this, but I had written this before
that, and even though it's trivial, I think it better to potentially
save a little work .
Karl Williamson [Thu, 13 Feb 2014 00:03:21 +0000 (17:03 -0700)]
ext/POSIX/t/posix.t: White-space only
Indent into a newly formed block
Karl Williamson [Wed, 12 Feb 2014 20:30:01 +0000 (13:30 -0700)]
Deprecate uses of POSIX::isfoo()
These functions have been supplanted in more modern Perls by
/[[:posix:]]/. The documentation has been wrong; they don't handle
UTF-8 and return true on an empty string. Rather than try to fix them,
the decision has been made to deprecate them instead.
See http://markmail.org/thread/jhqcag5njmx7jpyu
This commit also updates the documentation to be accurate.
Karl Williamson [Sat, 15 Feb 2014 23:11:55 +0000 (16:11 -0700)]
t/test.pl: Don't read uninitialized variable
Commit
97dffe50643dd18f87b33b7ec6f8b55bbfd1fd74 introduced
an attempt to access an unitialized hash value.
Karl Williamson [Sat, 15 Feb 2014 22:16:45 +0000 (15:16 -0700)]
t/run/locale.t: Fix SKIP end position
On the platforms where this skip gets engaged, it would have skipped too
much
Karl Williamson [Sat, 15 Feb 2014 21:31:11 +0000 (14:31 -0700)]
Make sure LC_MONETARY is initialized
This is only an issue for those few platforms without LC_ALL, as that
is initialized, and includes LC_MONETARY. This commit extends the
proper initialization to those other platforms. Perl doesn't use
LC_MONETARY itself, but it should be properly initialized for modules
that do.
Karl Williamson [Sat, 15 Feb 2014 21:26:46 +0000 (14:26 -0700)]
Initialize LC_MESSAGES at start-up
The code did not explicitly iinitialize LC_MESSAGES at startup, unlike
most of the other standard categories; I don't know why.
This is only an issue for those few platforms without LC_ALL, as that is
initialized, and includes LC_MESSAGES. This commit extends the proper
initialization to those other platforms.
Karl Williamson [Sat, 15 Feb 2014 20:42:22 +0000 (13:42 -0700)]
locale.c: White-space, useless brace removal only
This takes one piece of code that is needlessly enclosed in braces and
removes the braces, outdenting and reflowing the comments.
Otherwise, it changes to correct indentation for the addition and
removal of braces by the previous commit.
Karl Williamson [Sat, 15 Feb 2014 20:23:36 +0000 (13:23 -0700)]
Improve fallback during locale initialization
If Perl encounters a problem during startup trying to initialize the
locales from the environment it has immediately reverted to the "C"
locale.
This commit generalizes that so it tries each of the applicable
environment variables in order of priority until it works, or it gives
up and uses the "C" locale. For example, if LC_ALL is set to something
that is invalid, but LANG is valid, LANG will be used. This was
motivated by trying to get the Windows system default locale used in
preference to "C" if all else fails.
Karl Williamson [Sat, 15 Feb 2014 20:09:17 +0000 (13:09 -0700)]
locale.c: Add, move some comments, and a declaration
This adds some more comments at the beginning of a function concerning
its API, and moves them to before any declarations.
It also moves the declaration for 'done' to the block of other
declarations, and adds a PERL_UNUSED_VAR call if the code that uses it
is #ifdef'd out. Previously it was too easy to not notice the
declaration separate from the others, and to insert code between the
two, which would not compile under C89, but only on Ultrix machines.
Karl Williamson [Sat, 15 Feb 2014 19:58:07 +0000 (12:58 -0700)]
Emulate POSIX locale setting on Windows
Locale initialization and setting on Windows haven't been as
described in perllocale for setting locales to "". This is because that
tells Windows to use the system default locale, as set through the
Control Panel, but on POSIX systems, it means to look at various
environment variables.
This commit creates a wrapper for setlocale, used only on Windows, that
looks for the appropriate environment variables when called with a ""
input locale. If none are found, it continues to use the system default
locale.
Karl Williamson [Sat, 15 Feb 2014 19:48:59 +0000 (12:48 -0700)]
t/test.pl: Add option to runperl to suppress STDERR
Father Chrysostomos [Sat, 15 Feb 2014 02:05:47 +0000 (18:05 -0800)]
[perl #121242] Fix crash in gp_free when gv is freed
Commit 4571f4a caused the gp to have a refcount of 1, not 0, in
gp_free when the contents of the glob are freed. This makes
gv_try_downgrade see the gv as a candidate for downgrading in
this example:
sub Fred::AUTOLOAD { $Fred::AUTOLOAD }
undef *{"Fred::AUTOLOAD"};
When the glob is undefined, the sub inside it is freed, and the
gvop ($Fred::AUTOLOAD), when freed, tries to downgrade the glob
(*Fred::AUTOLOAD). Since it is empty, it deletes it completely from
the containing stash, so the GV is freed out from under gp_free, which
is still using it, causing an assertion failure.
We can trigger a similar condition more explicitly:
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = bless []; undef *{"foo"}'
This bug is nothing new. On a non-debugging 5.18.2, I get this:
$ perl5.18.2 -e 'DESTROY{delete $::{foo}} ${"foo"} = bless []; undef *{"foo"}'
Attempt to free unreferenced glob pointers at -e line 1.
Segmentation fault: 11
That crashes in pp_undef after the call to gp_free, becaues pp_undef
continues to manipulate the GV.
The problem occurs not only with pp_undef, but also with other func-
tions calling gp_free:
sv_setsv_flags:
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = bless []; *{"foo"}="bar"'
glob_assign_glob:
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = bless []; *{"foo"}=*bar'
sv_unglob, reached through various paths:
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = do {local *bar}; $${"foo"} = bless []; ${"foo"} = 3'
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = do {local *bar}; $${"foo"} = bless []; utf8::encode(${"foo"})'
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = do {local *bar}; $${"foo"} = bless []; open bar, "t/TEST"; ${"foo"} .= <bar>'
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = do {local *bar}; $${"foo"} = bless []; ${"foo"}++'
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = do {local *bar}; $${"foo"} = bless []; undef ${"foo"}'
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = 3; ${"foo"} =~ s/3/${"foo"} = do {local *bar}; $${"foo"} = bless []; 4/e'
And there are probably more ways to trigger this through sv_unglob.
(I stopped looking when I thought of the fix.)
This patch fixes the problem by protecting the GV using the mortals
stack in functions that call gp_free. I did not change gp_free
itself, since it is an API function that as yet does not touch the
mortals stack, and I am not sure that should change. All of its
callers that this patch touches already do sv_2mortal in some cir-
cumstances.
Father Chrysostomos [Fri, 14 Feb 2014 06:49:37 +0000 (22:49 -0800)]
AUTHORS formatting clean-up
• Consistent indentation
• Missing <> around e-mail address
Father Chrysostomos [Thu, 13 Feb 2014 22:32:22 +0000 (14:32 -0800)]
sv.c: Don’t flip flags so many times in glob_assign_glob
We only need to turn off the SvOK flags when the destination was not
already a glob.
Up till now, the code was doing SvOK_off twice, and
isGV_with_GP_on/off several times to avoid assertion failures.
If we already have a glob, then the only SvOK flags that can be on
already are SVpgv_GP (which needs to be on) and possibly SVf_UTF8,
which is harmless.
The only difference is that now the dumped glob in this one-liner will
have its UTF8 flag set:
$ ./perl -Ilib -MDevel::Peek -e 'use utf8; "".*φου; *φου = *bar; Dump *φου'
whereas it didn’t before. That is of no consequence, as the UTF8 flag
is only meaningful after stringification, which resets it.
Peter Martini [Tue, 14 Jan 2014 03:40:45 +0000 (22:40 -0500)]
Remove a redundant EXTEND (its followed by XPUSHs)
Chris 'BinGOs' Williams [Fri, 14 Feb 2014 21:57:58 +0000 (21:57 +0000)]
Update Pod-Escapes to CPAN version 1.06
[DELTA]
1.06 2014-02-14 NEILB
- e2charnum() was using \d but should use [0-9].
RT#70246 report and fix from MARCGREEN
- Added a bunch of pod-related links to SEE ALSO
David Mitchell [Fri, 14 Feb 2014 13:58:42 +0000 (13:58 +0000)]
re_intuit_start(): fix SEGV in /^../m code
RT #121248
Part of my recent refactoring of the code in re_intuit_start() - the bit
that searches for \n's in /^../m patterns (d0880ea) - introduced a
segfault, due to the count arg of memchr() going negative.
This is due to the stclass code (which I haven't refactored yet)
incrementing rx_origin beyond the last point it could match, then jumping
back to the MBOL block. In theory the stclass block should be fixed, but
until I get round to that, I've just added a test to the MBOL block
instead.
Chris 'BinGOs' Williams [Fri, 14 Feb 2014 10:07:20 +0000 (10:07 +0000)]
Update CPAN-Meta-YAML to CPAN version 0.011
[DELTA]
0.011 2014-02-13 20:30:30-05:00 America/New_York
- Generated from ETHER/YAML-Tiny-1.60.tar.gz
Tony Cook [Fri, 14 Feb 2014 05:24:45 +0000 (16:24 +1100)]
perldelta updates
Matthew Horsfall (alh) [Thu, 13 Feb 2014 19:38:13 +0000 (14:38 -0500)]
Fix small typo (dsb -> dsv)
Karl Williamson [Thu, 13 Feb 2014 00:10:40 +0000 (17:10 -0700)]
perldelta.pod: Fix broken links
See commit
b3a2acfa0c0e4f8e48e1f6eb4d6fd143f293d2c6
and http://markmail.org/message/x2sr55ekvos5k6wc
Karl Williamson [Thu, 13 Feb 2014 00:08:57 +0000 (17:08 -0700)]
sv.c: Add comment
Tony Cook [Thu, 13 Feb 2014 02:55:12 +0000 (13:55 +1100)]
[perl #121207] test.pl tempfile() improvements
Brad Gilbert [Tue, 4 Feb 2014 17:55:28 +0000 (11:55 -0600)]
Make sure that tempfile() in t/test.pl removes the temp files
Run a program within t/test_pl/tempfile.t that uses tempfile() to make
sure that the temp file is removed when the tests are done.
Brad Gilbert [Tue, 4 Feb 2014 16:37:02 +0000 (10:37 -0600)]
Add register_tempfile() to t/test.pl
This convenience function causes files to be removed in the same
way that tempfile() does.
It uses the same variable that tempfile() does, to catch and
warn on any collisions.
Brad Gilbert [Tue, 4 Feb 2014 16:31:46 +0000 (10:31 -0600)]
Test that tempfile() in t/test.pl skips files that already exist
Brad Gilbert [Tue, 4 Feb 2014 16:20:26 +0000 (10:20 -0600)]
Improve error diagnostics in t/test_pl/tempfile.t
Tony: add a missing local
Alan Haggai Alavi [Wed, 12 Feb 2014 11:20:49 +0000 (16:50 +0530)]
Replace 'mkpath' (legacy interface) with 'make_path'.
Update email of Alan Haggai Alavi; consolidate all email addresses
in Porting/checkAUTHORS.pl.
Reini Urban [Wed, 12 Feb 2014 17:05:43 +0000 (11:05 -0600)]
NETWARE CopFILE_setn
broken since 5.8.9
Karl Williamson [Wed, 12 Feb 2014 17:26:08 +0000 (10:26 -0700)]
pod/perldebguts: Stress ephemeral nature of regnode types
Karl Williamson [Fri, 7 Feb 2014 17:57:15 +0000 (10:57 -0700)]
regcomp.h: Rmv false comments
I misread the code when I added these comments
Karl Williamson [Thu, 6 Feb 2014 16:57:51 +0000 (09:57 -0700)]
regexec.c, locale.c: Silence some compiler warnings
For regexec.c, one compiler amongst our smokers believes there is a path
where this array can be used uninitialized; it's easiest to just
initialize it, even though I think the compiler is wrong, unless it is
optimizing incorrectly, in which case, it would be still be best to
initialize it.
For locale.c, this is just the well-known gcc bug that they refuse to
fix concerning a (void) cast when the function has been declared to
require not ignoring the resul
Chris 'BinGOs' Williams [Wed, 12 Feb 2014 09:17:36 +0000 (09:17 +0000)]
Update CGI to CPAN version 3.65
[DELTA]
Version 3.65 Feb 11, 2014
[INTERNALS]
- Update Makefile to refine where CGI.pm gets installed
(Thanks to bingo, rjbs: https://github.com/markstos/CGI.pm/pull/30)
Ricardo Signes [Mon, 10 Feb 2014 23:43:53 +0000 (18:43 -0500)]
acknowledgements: use $^X when running sub-perl
Ricardo Signes [Mon, 10 Feb 2014 23:38:07 +0000 (18:38 -0500)]
tweak Porting/acknowledgements.pl to avoid awk and grep
Rather than assuming that we are on a unix system with the
standard kit, we can rely on this neat little programming
language that provides their behavior and is already assumed
to be present!
Gavin Shelley [Mon, 10 Feb 2014 23:19:14 +0000 (18:19 -0500)]
provide a more limited change-count for acknowledgements.pl
Matthew Horsfall [Fri, 7 Feb 2014 14:41:09 +0000 (09:41 -0500)]
Add some examples to cv_set_call_checker and wrap_op_checker
Chris 'BinGOs' Williams [Mon, 10 Feb 2014 16:54:41 +0000 (16:54 +0000)]
Update IO-Socket-IP to CPAN version 0.28
[DELTA]
0.28 2014/02/10 16:17:59
[CHANGES]
* Renamed internal _configure method to _io_socket_ip__configure to
avoid clashes with modules that try to subclass IO::Socket::INET
[BUGFIXES]
* Disable AI_ADDRCONFIG during one-sided 'v6 tests as sometimes it
would otherwise fail
* Skip the SO_BROADCAST test on OSes that fail with EACCES (RT92502)
Chris 'BinGOs' Williams [Mon, 10 Feb 2014 16:53:35 +0000 (16:53 +0000)]
Add IO-Socket-IP to Maintainers.pl
Steffen Mueller [Mon, 10 Feb 2014 10:40:31 +0000 (11:40 +0100)]
pp_concat: Only call SvPV_force_nolen when needed
If we just did an sv_setpvs on it, the SvPV_force_nolen should not do
anything useful, so let's not.
Side note: s/TARG/left/ in the enclosing block because they are the same
pointer, so why use a define that needs grokking by the reader of the
code if the local variable is guaranteed to be the same?
Chris 'BinGOs' Williams [Sun, 9 Feb 2014 21:33:57 +0000 (21:33 +0000)]
Update Module-Build to CPAN version 0.4205
[DELTA]
0.4205 - Sun Feb 9 17:51:22 CET 2014
[BUG FIXES]
- FIX license code regression for artistic license [Roy Ivy III, Leon Timmermans]
- Don't swallow ExtUtils::CBuilder loading errors [Matthew Horsfall, Leon Timmermans]
- Handle testing on cross-compile builds [Brian Fraser]
- Protect against platforms without getpw{nam,uid} [Brian Fraser]
Chris 'BinGOs' Williams [Sun, 9 Feb 2014 21:23:21 +0000 (21:23 +0000)]
Update Pod-Escapes to CPAN version 1.05
[DELTA]
1.05 2014-02-09 NEILB
* Added PREREQ_PM, MIN_PERL_VERSION, LICENSE and repo to Makefile.PL
* Made strict- and warnings-clean.
* Fixed syntax error in abstract: RT#49985 from JDHEDDEN
* Fixed typo reported in RT#85374 by dsteinbrunner
* Renamed this file to Changes and reformatted as per CPAN::Changes::Spec
* Deleted META.yml so MakeMaker will generate MYMETA.{yml,json}
* Noted in pod that now being maintained by NEILB
* Added link to github repo in pod
Father Chrysostomos [Sun, 9 Feb 2014 01:14:10 +0000 (17:14 -0800)]
Use ‘an’ for $/=[] error message
This says ‘an ARRAY’:
$ perl -Mstrict -e '@{"a"}'
Can't use string ("a") as an ARRAY ref while "strict refs" in use at -e line 1.
This says ‘a ARRAY’:
$ ./miniperl -e '$/=[]'
Setting $/ to a ARRAY reference is forbidden at -e line 1.
It ought to say ‘an’.
Father Chrysostomos [Sun, 9 Feb 2014 01:09:46 +0000 (17:09 -0800)]
Increase $mro::VERSION to 1.15
Father Chrysostomos [Sun, 9 Feb 2014 01:09:14 +0000 (17:09 -0800)]
Use HEKfARG in mro.xs
It’s faster to pass the HEK directly instead of creating and
throwing away SVs.
Father Chrysostomos [Sun, 9 Feb 2014 01:02:23 +0000 (17:02 -0800)]
[perl #120374] Stop for($h{k}||'') from vivifying
Commit
2e73d70e52 broke this (made it vivify) by propagating lvalue
context to the branches of || and && (to fix another bug). It broke
App::JobLog as a result.
Because foreach does not do defelem magic (i.e., it vivifies), this
ends up extending vivification to happen where it did not before.
Fixing foreach to do defelem magic (create ‘deferred element’ scalars,
the way sub calls do, to avoid vivifying immediately) would be another
way to fix this, but it is controversial. See ticket #2166.
So, if either argument to || (or &&) is a vivifying op, don’t propa-
gate the lvalue context, unless this is the return value of an lvalue
sub (necessary for if/else with implicit return to work correctly in
lvalue subs).
Father Chrysostomos [Sat, 8 Feb 2014 21:34:29 +0000 (13:34 -0800)]
Remove DREFed flag from Concise.pm
0824d667 added the flag.
9026059dcee8 removed the flag but left it in
B::Concise.
Father Chrysostomos [Sat, 8 Feb 2014 21:34:17 +0000 (13:34 -0800)]
Increase $B::Concise::VERSION to 0.992