This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Father Chrysostomos [Mon, 12 Jan 2015 06:03:21 +0000 (22:03 -0800)]
Father Chrysostomos [Mon, 12 Jan 2015 05:47:34 +0000 (21:47 -0800)]
perldelta for
3c6ef0a5 / #103260 / #123071
Father Chrysostomos [Mon, 12 Jan 2015 05:44:53 +0000 (21:44 -0800)]
Father Chrysostomos [Mon, 12 Jan 2015 05:44:13 +0000 (21:44 -0800)]
perldelta for
62ae7cfb674910
Father Chrysostomos [Mon, 12 Jan 2015 05:38:07 +0000 (21:38 -0800)]
Father Chrysostomos [Mon, 12 Jan 2015 05:34:06 +0000 (21:34 -0800)]
Correct perl ver in Safe Changes
Daniel Dragan [Thu, 1 Jan 2015 04:09:28 +0000 (23:09 -0500)]
refactor op.c S_bad_type_*v
-flags arg of both funcs is unused in all callers. Move the 0 to the funcs.
flags arg is from commit
ce16c625ec in 2012
-all bad_type_gv calls are right before the end of the switch, the pushing
of 1st 3 args and call asm ops can be merged together, leaving the 1
string constant push as the only unique op between the 7 src code
callers of bad_type_gv, this requires reordering the args so the only
unique one is the last/right most one, reordering can't be done to
bad_type_pv because each following execution point after each bad_type_pv
is different, bad_type_pv's caller/s are not a switch statement
- commit
53e06cf030 probably overlooked the 2 PL_op_desc[type] places,
OP_DESC is a fancier superset of PL_op_desc[type], since calling
bad_type_pv only happens during a PP syntax error, that is not
performance critical, so replace PL_op_desc[type] with OP_DESC and
factor out OP to description string lookup, plus custom ops are very rare
so this shouldn't impact the error message seen by the user
VC2003 .text section of perl521.dll before 0xc9543 after 0xC9523
Father Chrysostomos [Mon, 12 Jan 2015 04:39:03 +0000 (20:39 -0800)]
Confused cloning of nested state subs
use feature 'lexical_subs','state';
no warnings 'experimental';
my $sub = sub{
state sub sb4;
state sub a {
state $x = 42;
sub sb4 { $x; }
}
a();
print sb4(), "\n";
};
$sub->();
The output:
Bizarre copy of CODE in subroutine exit at - line 10.
The sb4 sub was trying to close over the wrong pad; namely, the one
belonging to the anonymous sub.
Father Chrysostomos [Mon, 12 Jan 2015 04:08:12 +0000 (20:08 -0800)]
perldiag grammo
Jarkko Hietaniemi [Mon, 12 Jan 2015 01:05:34 +0000 (20:05 -0500)]
Catch infnan repeat counts.
Not entirely convinced this is worth the extra code but getting
"Negative repeat count" warning for NaN repeat count is too much.
Even before this patch, "a" x $Inf didn't go all Genghis over your
virtual memory. This is all about the right warning.
Daniel Dragan [Thu, 8 Jan 2015 05:10:13 +0000 (00:10 -0500)]
Win32: stat() only after a failed open() on a module
See RT ticket for this patch for details.
Steve Hay [Sat, 10 Jan 2015 16:17:19 +0000 (16:17 +0000)]
Add missing =item * in perldelta (now perl5217delta) from commit
070733dfda
Steve Hay [Sat, 10 Jan 2015 16:09:36 +0000 (16:09 +0000)]
Correct a bug number in perldelta
Steve Hay [Sat, 10 Jan 2015 15:39:08 +0000 (15:39 +0000)]
Steve Hay [Sat, 10 Jan 2015 15:35:27 +0000 (15:35 +0000)]
Bump $VERSION following previous commit
The code is currently identical to 0.23, but when the next change is made
the $VERSION must not be bumped to 0.24 since that has already been
released. For the same reason, we can't use 0.24 now, so bump to 0.25.
Steve Hay [Sat, 10 Jan 2015 15:29:26 +0000 (15:29 +0000)]
Revert "fix attributes memcmp without len<6 (asan catch)"
This reverts commit
ff5314c5aa54b172122507017cac034acf1c4bf7.
As noted by Andy Dougherty in #122629 the problem that this fixes
was already fixed more succinctly in
dd369969a/#122701.
Karl Williamson [Thu, 8 Jan 2015 21:36:00 +0000 (14:36 -0700)]
perldelta for [perl #123530]
Karl Williamson [Thu, 8 Jan 2015 20:49:56 +0000 (13:49 -0700)]
POSIX.pod: Various nits, typos, clarifications
Karl Williamson [Thu, 8 Jan 2015 19:22:21 +0000 (12:22 -0700)]
perlpodspec: Corrections/adds to detecting =encoding
C0 and C1 are not legal UTF-8 start bytes. utf8::decode() is a more
accurate way of determining UTF-8.
Karl Williamson [Thu, 8 Jan 2015 19:16:50 +0000 (12:16 -0700)]
toke.c: White-space only
Outdent a block that was indented by 2 tab widths.
Chris 'BinGOs' Williams [Sat, 10 Jan 2015 12:24:02 +0000 (12:24 +0000)]
Actually remove the TODO rather than just the block
Chris 'BinGOs' Williams [Sat, 10 Jan 2015 11:59:43 +0000 (11:59 +0000)]
Update Digest-SHA to CPAN version 5.94
[DELTA]
5.94 Sat Jan 10 00:45:28 MST 2015
- added support for threaded builds
-- PERL_GET_NO_CONTEXT, pTHX_, aTHX_, etc.
-- employed 'const' storage class where possible
-- ref. rt.cpan.org #101260
- simplified shabits() routine (bitwise input buffering)
-- slightly less efficient but easier to understand
-- ref. rt.cpan.org #101344
- minor documentation tweaks and additions
Chris 'BinGOs' Williams [Fri, 9 Jan 2015 22:21:58 +0000 (22:21 +0000)]
Removed TODO from pm_to_lib test in EUMM
And upstream fix for race condition applied
https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/6f41d63
Father Chrysostomos [Fri, 9 Jan 2015 02:49:32 +0000 (18:49 -0800)]
Simplify s/// and tr/// parsing logic
These two operators were being translated into subst("","") and
tr("","") by the lexer. Then pmruntime in op.c would take apart the
resulting list op. Instead of constructing a list op only to take it
apart again, feed the replacement part to pmruntime separately. We
can achieve this by introducing a new token ('/') that the parser rec-
ognizes as introducing a replacement.
If we had followed this approach to begin with, then bug #123542 would
never have happened.
(Actually, it seems the parser did know about the replacement part to
begin with, but it changed in perl-5.8.0-4047-g131b3ad to fix some
overloading problems.)
Father Chrysostomos [Fri, 9 Jan 2015 02:00:35 +0000 (18:00 -0800)]
parser.t: Correct bug number
Chris 'BinGOs' Williams [Thu, 8 Jan 2015 21:50:05 +0000 (21:50 +0000)]
Update ExtUtils-Command to CPAN version 1.20
[DELTA]
1.20 Thu, Jan 8, 2015
- Skip some tests on Haiku as well
Father Chrysostomos [Thu, 8 Jan 2015 17:23:50 +0000 (09:23 -0800)]
parser.t: Correct skip count
I increased the skip count in
08b999a9 by mistake. For crashing bugs,
executing the code that would have crashed is sufficient to test it.
Matthew Horsfall (alh) [Thu, 8 Jan 2015 13:41:24 +0000 (08:41 -0500)]
Fix apidocs for OP_TYPE_IS(_OR_WAS) - arguments separated by |, not ,.
This was causing Devel::PPPort's tooling some grief.
Father Chrysostomos [Thu, 8 Jan 2015 03:33:39 +0000 (19:33 -0800)]
[perl #123452] Fix crash with s/${<>{})//
s/foo/bar/ tokenizes as something akin to subst("foo","bar") and the
resulting list op representing the contents of the parentheses is
passed to pmruntime as its expr argument.
If we have invalid code like s/${<>{})//, the bison parser will dis-
card invalid tokens until it finds something it can fall back to, in
an attempt to keep parsing (to report as many errors as possible).
In the process of discarding tokens, it may convert s/${<>{})//, which
the lexer emits like this:
PMFUNC ( $ { THING(readline) { } ) , "" )
into this:
PMFUNC ( $ { THING(readline) } ) , "" )
(or something similar). So when the parser sees the first closing
parentheses, it decides it has a complete PMFUNC(...), and the expr
argument to pmruntime ends up being an rv2sv op (the ${...}), not
a list op.
pmruntime assumes it is a list op, and tries to access its op_last
field, to find the replacement part; but rv2sv has no op_last field,
so this reads past the end of the op struct, usually into the first
pointer in the next op slot, which itself is an opslot pointer, not an
op pointer, so things really screw up.
If we check that the arguments to subst are indeed a list op first
before trying to extract the replacement part, everything works. We
get the syntax errors reported as expected, but no crash.
Matthew Horsfall (alh) [Thu, 8 Jan 2015 02:45:44 +0000 (21:45 -0500)]
Upgrade Devel::PPPort from 3.25 to 3.26 (to silence build warnings)
Thanks to Dave M. for the patches.
Jarkko Hietaniemi [Thu, 8 Jan 2015 01:12:51 +0000 (20:12 -0500)]
[-Dusecbacktrace] Close the BFD descriptor.
Otherwise we leak several dozens of megabytes, if not more,
for each Perl_dump_c_backtrace().
Father Chrysostomos [Wed, 7 Jan 2015 22:05:49 +0000 (14:05 -0800)]
Add Andreas Voegele to AUTHORS
Andreas Voegele [Wed, 7 Jan 2015 19:36:14 +0000 (20:36 +0100)]
Add test for rt#123556
Andreas Voegele [Tue, 6 Jan 2015 11:05:14 +0000 (12:05 +0100)]
Only compare defined values with "ge" in Module::CoreList::first_release_raw
Father Chrysostomos [Wed, 7 Jan 2015 19:01:59 +0000 (11:01 -0800)]
perly.c: Emit nl after ‘Reading a token’
This makes the -DTp output easier to read.
Father Chrysostomos [Wed, 7 Jan 2015 18:01:14 +0000 (10:01 -0800)]
op.c: Remove dVAR from ck_grep
It has not needed it since
3253bf854 make it call S_alloc_LOGOP
instead of accessing PL_ppaddr directly.
Father Chrysostomos [Wed, 7 Jan 2015 18:00:46 +0000 (10:00 -0800)]
op.c: Remove dVAR from newRANGE
It has not needed it since
3253bf854 make it call S_alloc_LOGOP
instead of accessing PL_ppaddr directly.
Father Chrysostomos [Wed, 7 Jan 2015 18:00:07 +0000 (10:00 -0800)]
op.c: Remove dVAR from pmruntime
It has not needed it since
3253bf854 make it call S_alloc_LOGOP
instead of accessing PL_ppaddr directly.
Father Chrysostomos [Wed, 7 Jan 2015 17:54:52 +0000 (09:54 -0800)]
TEST: Comment for
804352e2
Father Chrysostomos [Wed, 7 Jan 2015 17:48:30 +0000 (09:48 -0800)]
Avoid glob in t/TEST on non-Windows
See ticket #123561. The presence of ‘glob’ was causing perl to
attempt to File::Glob at compile time, before @INC is set up.
Windows needs to do file globbing on @ARGV for t/TEST to work cor-
rectly. Windows only uses TEST for miniperl (it uses harness for
‘make test’), and under miniperl ‘glob’ doesn’t use File::Glob. So it
is safe to use ‘glob’ on Windows. For the sake of other systems, we
can put it in a string eval to avoid even compiling the op.
Father Chrysostomos [Wed, 7 Jan 2015 17:44:22 +0000 (09:44 -0800)]
op.c: S_maybe_targlex needs no dVAR
I thought it would be needed for PL_opargs, but PL_opargs is truly
global, even with PERL_GLOBAL_STRUCT.
Karl Williamson [Wed, 7 Jan 2015 17:31:29 +0000 (10:31 -0700)]
Fix broken ext/POSIX/t/wrappers.t on Windows
Windows doesn't have LC_MESSAGES, so skip the code if it isn't defined.
Steve Hay [Wed, 7 Jan 2015 14:24:14 +0000 (14:24 +0000)]
Remove obscure "attrib -r ..\t\*.*" command from minitest recipe
This command is not run for any other test targets, and there seems to be
no point in it, at least not now, since files under t\ are not read-only
anyway.
(It dates from the creation of the minitest target in commit
137443ea0a.
At that time, the same command was already used in the $(PERLEXE) target,
having been added there in the initial creation of win32/Makefile in
commit
0a753a7640. Needless to say, neither commit gives any details on
why the command was deemed necessary.)
Steve Hay [Wed, 7 Jan 2015 14:08:27 +0000 (14:08 +0000)]
Silence warning during VC++/nmake build
"Use of uninitialized value $opt{"uselongdouble"} in string eq at
config_sh.PL line 202."
Only GCC supports USE_LONG_DOUBLE, so set the option to undef for VC++.
Steve Hay [Wed, 7 Jan 2015 14:02:10 +0000 (14:02 +0000)]
Fix minitest (op/taint.t) for GCC 4.x
Steve Hay [Wed, 7 Jan 2015 13:47:32 +0000 (13:47 +0000)]
Remove Windows makefile support for building without PerlIO
As noted in #123394, building without PerlIO was all but deprecated in
5.18.0 and is no longer supported by Configure on POSIX systems, so there
is no need for the Windows makefiles to provide support for it either.
Therefore, we can simply enable PerlIO in the canned configuration files
and remove any fiddling with that setting for the real configuration,
which means that miniperl will also now have PerlIO enabled without
needing the recently added change to win32.h.
Karl Williamson [Fri, 26 Dec 2014 21:49:17 +0000 (14:49 -0700)]
PATCH: [perl #123503] Bug in POSIX::strerror on 5.21.7
There were 3 ideas for a patch: mine, Slaven's, and Father
Chrysostomos'. I tried out all 3, and all three appear to work, without
breaking #123171. But I chose FC's as I think it is the best.
I had to create a new .t because it turns out that the test didn't fail
when placed in the obvious test file, wrappers.t. It appears that the
'use File::Temp' in that file perturbs things to not fail later on.
This is scary, so I created a minimal file. I thought about using
fresh_perl, but wrappers.t needs functions from Test::More.
Karl Williamson [Wed, 7 Jan 2015 04:05:43 +0000 (21:05 -0700)]
Add test case for [perl #123171]
This looks for a non-English locale to test with, as the bug appears
only in such locales. The fix to the referenced ticket broke the .t
file in non-English locales, and this commit fixes it. If no
non-English locale is found, the code runs anyway, using an English one.
Part of the commit came from Slaven Rezic.
Karl Williamson [Mon, 5 Jan 2015 22:32:53 +0000 (15:32 -0700)]
regcomp.c: Rmv no-longer-used macro and function
There are no longer any calls to these, so can be removed.
Karl Williamson [Mon, 5 Jan 2015 22:30:42 +0000 (15:30 -0700)]
regcomp.c: Don't use general macro
The macro REGC is used to hide PASS1 behavior versus PASS2 behavior from
the caller. But this is the last use of REGC, and it's only executed in
PASS2, so it doesn't need the generality (and obscurity) that REGC
provides.
Karl Williamson [Tue, 6 Jan 2015 20:08:06 +0000 (13:08 -0700)]
regcomp.c: Refactor as a result of [perl #123539]
The previous commit was a minimal patch for this bug, suitable for a
maintenance release. This patch refactors that fix to eliminate special
cases (hence branches) and makes things more logical and clearer.
The original code shoe-horned two cases together that, it turns out,
should have been handled separately, and this patch does that.
The earlier code was somewhat stilted to conform with the reguni() API.
Now that reguni is no longer called, this gets cleaned up.
Karl Williamson [Tue, 6 Jan 2015 20:07:51 +0000 (13:07 -0700)]
PATCH: [perl #123539] regcomp.c node overrun/segfault
This is a minimal patch suitable for a maintenance release. It extracts
the guts of reguni and REGC without the conditional they have. The next
commit will do some refactoring to avoid branching and to make things
clearer.
This bug is due to the current two pass structure of the Perl regular
expression compiler. The first pass attempts to do just enough work to
figure out how much space to malloc for the compiled pattern; and the
2nd pass actually fills in the details. One problem with this design is
that in many cases quite a bit of work is required to figure out the
size, and this work is thrown away and redone in the second pass.
Another problem is that it is easy to forget to do enough work in the
sizing pass, and that is what happened with the blamed commit. I
understand that there are plans (God speed) to change the compiler
design.
When not under /i matching, the size of a node that will match a
sequence of characters is just the number of bytes those characters take
up. We have an easy way to calculate the number of bytes any code point
will occupy in UTF-8, and it's just 1 byte per code point for non-UTF-8.
So in the sizing pass, we don't actually have to figure out the
representation of the characters. However under /i matching, we do.
First of all, matching of UTF-8 strings is done by replacing each
character of each string by its fold-case (function fc()) and then
comparing. This is required by the nature of full Unicode matching
which is not 1-1. If we do that replacement for the pattern at compile
time, we avoid having to do it over-and-over as pattern matching
backtracks at execution. And because fc(x) may not occupy the same
number of bytes as x, and there is no easy way to know that size without
actually doing the fc(), we have to do the fold in the sizing pass.
Now, there are relatively few folds where sizeof(fc(x)) != sizeof(x), so
we could construct an exception table for those few cases where it is,
and look up through that.
But there is another reason that we have to fold in the sizing pass.
And that is because of the potential for multi-character folds being
split across regnodes. The regular expression compiler generates
EXACTish regnodes for matching sequences of characters exactly or via
/i. The limit for how many bytes in a sequence such a node can match is
255 because the length is stored in a U8. If the pattern has a sequence
longer than that, it is split into two or more EXACTish nodes in a row.
(Actually, the compiler splits at a size much lower than that; I'm not
sure why, but then two adjoining nodes whose total sum length is at most
255 get joined later in the third, optimizing pass.) Now consider,
matching the character U+FB03 LATIN SMALL LIGATURE FFI. It matches the
sequence of the three characters "f f i". Because of the design of the
regex pattern matching code, if these characters are such that the first
one or two are at the end of one EXACTish node, and the final two or one
are in another EXACTish node, then U+FB03 wrongly would not match them.
Matches can't cross node boundaries. If the pattern were tweaked so all
three characters were in either the first or second node, then the match
would succeed. And that is what the compiler does. When it reaches the
node's size limit, and the final character is one that is a non-terminal
character in a multi-char fold, what's in the node is backed-off until
it ends with a character without this characteristic. This has to be
done in the sizing pass, as we are repacking the nodes, which can affect
the size of the pattern, and we have to know what the folds are in order
to determine all this.
(We don't fold non-UTF-8 patterns. This is for two reasons. One is
that one character, the U+00B5 MICRO SIGN, folds to above-Latin1, and if
we folded it, we would have to change the pattern into UTF-8, and that
would slow everything down. I've thought about adding a regnode type
for the much more common case of a sequence that doesn't have this
character in it, and which could hence be folded at compile time. But
I've not been able to justify this because of the 2nd reason, which is
folds in this range are simple enough to be handled by an array lookup,
so folding is fast at runtime.)
Then there is the complication of matching under locale rules. This bug
manifested itself only under /l matching. We can't fold at pattern
compile time, because the folding rules won't be known until runtime.
This isn't a problem for non-UTF-8 locales, as all folds are 1-1, and so
there never will be a multi-char fold. But there could be such folds in
a UTF-8 locale, so the regnodes have to be packed to work for that
eventuality. The blamed commit did not do that, and because this issue
doesn't arise unless there is a string long enough to trigger the
problem, this wasn't found until now. What is needed, and what this
commit does, is for the unfolded characters to be accumulated in both
passes. The code that looks for potential multi-char fold issues
handles both folded and unfolded-inputs, so will work.
Steve Hay [Tue, 6 Jan 2015 18:13:26 +0000 (18:13 +0000)]
minitest needs config.h to build $(MINIPERL)
Since
f7219c0a9696421192a4830631fa6e3fd28adf39 didn't work out, just add
the config.h dependency directly to minitest instead (which was my main
reason for doing this anyway).
We can also drop the utils dependency from minitest since it doesn't seem
to be required other than to get git_version.h/Config_git.pl made along
the way, but we can add that dependency directly instead. In this way,
minitest still works, but now without building the full perl.exe and
perl5XX.dll as well (which was previously happening as a consequence of
the utils dependency).
Steve Hay [Tue, 6 Jan 2015 16:06:46 +0000 (16:06 +0000)]
Revert commit
f7219c0a9696421192a4830631fa6e3fd28adf39
That broke the (full) build. Sorry for only minitest-ing before pushing :-/
Father Chrysostomos [Tue, 6 Jan 2015 05:58:53 +0000 (21:58 -0800)]
pad.c: Remove unused context params
Daniel Dragan [Sun, 4 Jan 2015 22:49:09 +0000 (17:49 -0500)]
refactor gv_add_by_type
gv_add_by_type was added in commit
d5713896ec in 5.11.0 . Improve
gv_add_by_type by making it return the newly created SV*, instead of the
the GV *, which the caller must deref both the GV head to get svu and
then deref a slice into the GP, even though it already derefed svu and GP
right before, to figure out whether to call gv_add_by_type in the first
place. The original version of this patch had gv_add_by_type returning a
SV ** to ensure lvalue-ness but it was discovered it wasn't needed and not
smart.
-rename gv_add_by_type since it was removed from public api and its proto
changed
-remove null check since it is impossible to pass null through GvAVn(),
and unlikely with gv_AVadd, null segvs reliably crash in the rare case of
a problem
-instead of S_gv_init_svtype and gv_add_by_type using a tree of logic/
conditional jumps in asm, use a lookup table, GPe (e=enum or entry)
enums are identical to offsets into the GP struct, all of then fit under
0xFF, if the CC and CPU arch wants, CC can load the const once into a
register, then use the number for the 2nd deref, then use the number again
as an arg to gv_add_by_type, the low (&~0xf) or high (<<2) 2 bits in a
GPe can be used for something else in the future since GPe is pointer
aligned
-SVt_LAST triggers "panic: sv_upgrade to unknown type", so use that value
for entries of a GP which are not SV head *s and are invalid to pass as
an arg
-remove the tree of logic in S_gv_init_svtype, replace with a table
-S_gv_init_svtype is now tail call friendly and very small
-change the GV**n to be rvalues only, assigning to GV**n is probably a
memory leak
-fix 1 core GV**n as lvalue use
-GvSVn's unusual former definition is from commit
547f15c3f9 in 2005
and DEFSV as lvalue is gone in core as of commit
414bf5ae08 from 2008
since all the GV**n macros are now rvalues, this goes too
-PTRPTR2IDX and PTRSIZELOG2 could use better names
-in pp_rv2av dont declare strings like that VC linker won't dedup that, and
other parts of core also have "an ARRAY", perl521.dll previously had 2
"an ARRAY" and "a HASH" strings in it due to this
before VC 2003 32 perl521.dll .text 0xc8813 in machine code bytes after
.text 0xc8623
Father Chrysostomos [Tue, 6 Jan 2015 05:41:26 +0000 (21:41 -0800)]
perly.y: Don’t call op_lvalue on refgen kid
ck_spair also applies lvalue context to the kid ops, so we just end up
calling op_lvalue twice on the same ops. It’s harmless (being idempo-
tent), but wasteful.
Father Chrysostomos [Tue, 6 Jan 2015 05:32:03 +0000 (21:32 -0800)]
Revert "const + static vtables in threads::shared"
This reverts commit
7105b7e7a5e49caa06b8d7ef71008838ec902227.
Steve Hay [Tue, 6 Jan 2015 13:10:25 +0000 (13:10 +0000)]
miniperl needs config.h to build
Ricardo Signes [Tue, 6 Jan 2015 12:10:13 +0000 (07:10 -0500)]
perlpolicy: add a missing verb
Steve Hay [Tue, 6 Jan 2015 09:22:08 +0000 (09:22 +0000)]
Can't put a comment in the middle of a command broken across lines
Actually, you can in the nmake makefile (win32/Makefile), which is surely
how it slipped through in commit
4ea01bd3b4, but you can't do it in the
dmake makefile (win32/makefile.mk). Change it in both for consistency.
Father Chrysostomos [Tue, 6 Jan 2015 04:31:46 +0000 (20:31 -0800)]
Increase perl5db.pl’s $VERSION to 1.47
Father Chrysostomos [Tue, 6 Jan 2015 02:07:38 +0000 (18:07 -0800)]
Update address for E. Choroba
E. Choroba [Tue, 6 Jan 2015 02:05:17 +0000 (18:05 -0800)]
perl5db.pl: Undefined subroutine &DB::db_warn
Perl debugger sometimes tries to call a non-existent subroutine
db_warn. It's real name is _db_warn, though.
How to replicate:
perl -d -e1
!/
Output:
/bin/bash: /: Is a directory
Undefined subroutine &DB::db_warn called at /usr/lib/perl5/5.18.1/perl5db.pl line 6740.
at /usr/lib/perl5/5.18.1/perl5db.pl line 6740.
DB::_db_system('/bin/bash', '-c', '/') called at /usr/lib/perl5/5.18.1/perl5db.pl line 3923
DB::Obj::_handle_sh_command('DB::Obj=HASH(0x105df48)') called at /usr/lib/perl5/5.18.1/perl5db.pl line 2992
DB::DB called at -e line 1
Ricardo Signes [Tue, 6 Jan 2015 02:31:49 +0000 (21:31 -0500)]
Merge branch 'perlpolicy' into blead
Ricardo Signes [Fri, 19 Dec 2014 02:25:27 +0000 (21:25 -0500)]
perlpolicy: clarify what "feature can be replaced" means
Ricardo Signes [Fri, 19 Dec 2014 02:21:58 +0000 (21:21 -0500)]
perlpolicy: the point is caution, not low stakes
Ricardo Signes [Wed, 17 Dec 2014 00:33:00 +0000 (19:33 -0500)]
forward reference from "new features" to "experimental"
Ricardo Signes [Wed, 17 Dec 2014 00:32:47 +0000 (19:32 -0500)]
proposed changes for perlpolicy updates
see http://nntp.perl.org/group/perl.perl5.porters/219866
Chad Granum [Mon, 5 Jan 2015 16:30:00 +0000 (08:30 -0800)]
Test-Simple Version Bump, 1.301001_097 (RC17)
Daniel Dragan [Mon, 5 Jan 2015 06:44:59 +0000 (01:44 -0500)]
const + static vtables in threads::shared
This makes threads::shared have no non-NULL initialized RW static data.
Uninitialized and NULL filled RW data like PL_sharedsv_space and
prev_signal_hook remain, but on some OSes/CCs (Win32 with special tweaks),
this means that now the RW data section in threads::shared shared library
has no disk representation. Static the remaining RW vars to trim the
symbol table on non-Win32.
Daniel Dragan [Mon, 5 Jan 2015 06:27:11 +0000 (01:27 -0500)]
const a PERLIO vtable in PerlIO::encoding
This makes PerlIO::encoding's shared library free of any perl caused RW
static data.
Tony Cook [Tue, 6 Jan 2015 00:24:53 +0000 (11:24 +1100)]
make minitest (mostly) work on Win32
The only test left failing is op/glob.t, since I couldn't find the
cause of the failure
Tony Cook [Tue, 9 Dec 2014 04:13:04 +0000 (15:13 +1100)]
minitest: run the sames tests on win32 as on POSIXish systems
Tony Cook [Tue, 9 Dec 2014 04:06:05 +0000 (15:06 +1100)]
minitest: miniperl on win32 always displays the x86 arch, so skip testing it
Tony Cook [Tue, 9 Dec 2014 03:38:38 +0000 (14:38 +1100)]
minitest op/magic.t: skip the env_is() tests on Win32 miniperl
Since
1070c8d6 env_is() requires the Win32 module on Win32, which
miniperl can't load
Tony Cook [Mon, 8 Dec 2014 04:11:29 +0000 (15:11 +1100)]
Win32 minitest: -k is never available on Win32
Given the structure of the tests and the code, I can only assume
S_ISVTX is only unavailable on Win32 out of the systems we run
minitest on.
Tony Cook [Mon, 8 Dec 2014 02:27:35 +0000 (13:27 +1100)]
miniperl on Win32 doesn't have fork()
Tony Cook [Mon, 8 Dec 2014 01:56:07 +0000 (12:56 +1100)]
some socket functions aren't available under Win32 miniperl
This only skips for bind, connect, accept() and select().
Other functions are tested in coreamp.t, but either aren't called with
valid handles, so don't reach the "unimplemented" errors, or don't
trigger the errors for other reasons.
fixes: op/coreamp.t, op/sselect.t, op/tie_fetch_count.t
Tony Cook [Mon, 8 Dec 2014 00:44:52 +0000 (11:44 +1100)]
disable Win32 sloppy stat in io/fs.t, io/stat.t
8ce7a7e8b08f added a line to write_buildcustomize.pl to enable
${^WIN32_SLOPPY_STAT} in lib/buildcustomize.pl on Win32.
This meant the nlink value from stat wasn't being populated correctly
causing the link count tests to fail
Tony Cook [Tue, 16 Dec 2014 06:05:18 +0000 (17:05 +1100)]
use textmode when opening scripts in miniperl to match perl
fixes io/data.t
This could be considered a bug in io/data.t, since it writes the scripts
in text mode, but making miniperl behave closer to perl may fix
other issues too.
Tony Cook [Tue, 16 Dec 2014 06:04:09 +0000 (17:04 +1100)]
build miniperl with PerlIO
Several tests use PerlIO layers (:utf8, :pop) without testing for it.
non-PerlIO builds were vaguely deprecated in 5.18.0 and can no longer be
enabled on POSIX systems through Configure, so making miniperl PerlIO
on Win32 is no big stretch
minitests failing now:
io/data.t
io/fs.t
op/coreamp.t
op/filetest.t
op/fork.t
op/glob.t
op/heredoc.t
op/magic.t
op/sselect.t
op/stat.t
op/tie_fetch_count.t
Tony Cook [Mon, 8 Dec 2014 00:01:34 +0000 (11:01 +1100)]
t/TEST: glob the supplied filenames on Win32
since Win32 perl doesn't glob by default
at this point the following tests fail:
io/dup.t
io/fs.t
io/open.t
io/perlio_leaks.t
op/coreamp.t
op/filetest.t
op/fork.t
op/fresh_perl_utf8.t
op/glob.t
op/heredoc.t
op/magic.t
op/read.t
op/readline.t
op/sselect.t
op/stat.t
op/substr.t
op/tie_fetch_count.t
op/write.t
Tony Cook [Sun, 7 Dec 2014 23:48:32 +0000 (10:48 +1100)]
use TEST for minitest, same as POSIX systems
Test::Harness now requires IO at all times, which means it can't
be used with miniperl
many tests fail with minitest at this point
Father Chrysostomos [Mon, 5 Jan 2015 22:13:05 +0000 (14:13 -0800)]
b.t: Fix test sequence numbers
I should have tested more thoroughly before pushing
a462fa007.
Daniel Dragan [Mon, 5 Jan 2015 20:01:04 +0000 (15:01 -0500)]
fix test fail on unthreaded perl
../ext/B/t/b.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
part of [perl #123544]
Daniel Dragan [Mon, 5 Jan 2015 04:37:58 +0000 (23:37 -0500)]
const the custom op struct in Devel::Peek
This makes the Devel::Peek shared library free of perl caused RW static
data vars, and if CC/OS platform allows, removes RW data section from the
shared library.
Daniel Dragan [Mon, 5 Jan 2015 03:42:49 +0000 (22:42 -0500)]
pp.c pp_split GvAVn can't return NULL
clang optimized the function call free branch of GvAVn to skip the
"if (ary)" test, but the function call creation branch also will never
return NULL (but no CC knows that) so use goto to skip the test on both
halfs of GvAVn.
Daniel Dragan [Mon, 5 Jan 2015 03:27:04 +0000 (22:27 -0500)]
make B psuedofork safe
Previously B incorrectly used MY_CXT since commit
89ca4ac7af (5.7.2),
there was a MY_CXT declared, but it was never cloned after a win32
psuedofork, negating the whole point of using MY_CXT. This was probably
an oversight since the old code didn't use CLONE method, and would have
been threadsafe only if the module was loaded after a psuedofork/ithread
creation. Rearrange my_cxt_t so there isn't an alignment gap between the 32
bit and 32/64 bit ptrs.
This patch does not address the current lack of CLONE method in
Opcode:: and in File::DosGlob . File::Glob was fixed in commit
facf34ef48
DynaLoader in commit
8c472fc1d4 and re:: doesn't use MY_CXT anymore at all.
Failure message of the test before the fix was
not ok 88 - special SV table works after psuedofork
# Failed test 'special SV table works after psuedofork'
# at b.t line 229.
# got: 'B::PVNV'
# expected: 'B::SPECIAL'
Father Chrysostomos [Mon, 5 Jan 2015 07:18:02 +0000 (23:18 -0800)]
perldiag: Document ‘Bad symbol for scalar’
Originally this was a separate message in gv.c, with an exception
listed in diag.t
d5713896ec merged several functions together, changing the exception
to ‘Bad symbol for %s’.
bb85b28a added diag_listed_as in the wrong place.
de6f7947 moved it to the right place, removing the diag.t entry.
But all this time ‘Bad symbol for scalar’ remained undocumented.
Father Chrysostomos [Mon, 5 Jan 2015 07:16:58 +0000 (23:16 -0800)]
t/base/lex.t: Remove commented-out test
It has been commented out since it was added in
2b92dfceaa9d.
Father Chrysostomos [Mon, 5 Jan 2015 07:16:21 +0000 (23:16 -0800)]
complement can have OPpTARGET_MY
It always reads its argument out the outset and always returns its
target, so there is no reason its target cannot be a lexical. (The
OPpTARGET_MY optimisation makes $lexical = <some op> have the op
write directly to the lexical; the assignment gets optimised away.)
H.Merijn Brand [Mon, 5 Jan 2015 11:33:49 +0000 (12:33 +0100)]
Put pthread in front of libswanted and add cl
If pthread is found on HP-UX, it is required to be in front and
libcl is required too
Chris 'BinGOs' Williams [Sun, 4 Jan 2015 19:09:11 +0000 (19:09 +0000)]
Update Module-Metadata to CPAN version 1.000025
[DELTA]
1.000025 2015-01-04 18:56:00Z
- evaluate version assignment in a clean environment, to fix assignment in a
block (RT#101095)
Father Chrysostomos [Sun, 4 Jan 2015 02:55:49 +0000 (18:55 -0800)]
reg_nocapture.t: Skip %+ tests under miniperl
Father Chrysostomos [Sun, 4 Jan 2015 02:53:29 +0000 (18:53 -0800)]
perl.h:MY_CXT_CLONE: void *, not void **
C++ fails otherwise, and PL_my_cxt_list is void ** so individual
elephants (aka elements) should be void *.
Daniel Dragan [Sat, 3 Jan 2015 05:15:55 +0000 (00:15 -0500)]
const a table in B
B is now free of all RW static data except for my_cxt_index
Daniel Dragan [Fri, 2 Jan 2015 23:59:06 +0000 (18:59 -0500)]
reorder MY_CXT_CLONE for less memory reads
Nn VC 2003 32, taking a very simple CLONE XSUB, specifically
Time::HiRes::CLONE, shows a reduction from 0x53 to 0x47 bytes of machine
code. This is because my_cxt_index has to be reread after the memcpy
function call incase my_cxt_index was changed by memcpy (GCC usually
inlines short fixed length memcpys, on VC P5P perl, the option to inline
memcpy is off), also the new my_cxtp does not need to be saved in a non-vol
anymore, previously my_cxtp had to be copied to a non-vol for it be
available after the memcpy function call. In a simple XSUB like the one
mentioned here, saving and restoring the non-vol register is also
removed.
See details in perl #123534.
Father Chrysostomos [Sat, 3 Jan 2015 04:20:17 +0000 (20:20 -0800)]
pad.c: Obsolete comment
This comment, added by
3291825f, was made obsolete by
0f94cb1f.
Father Chrysostomos [Sat, 3 Jan 2015 04:15:10 +0000 (20:15 -0800)]
Fix CvOUTSIDE for state subs in predeclared subs
use 5.018;
use experimental 'lexical_subs';
$::x = "global";
sub x;
sub x {
state $x = 42;
state sub x { print eval '$x', "\n" }
\&x;
}
x()->();
__END__
Output:
Segmentation fault: 11
Because this line in pad.c:S_findpadlex:
1141 const PADLIST * const padlist = CvPADLIST(cv);
is trying to read this SV:
SV = UNKNOWN(0x76) (0xaa170e4fd) at 0x10060c928
REFCNT =
1697135711
FLAGS = (PADSTALE,TEMP,GMG,SMG,IOK,pNOK,pPOK,UTF8)
(i.e., gibberish).
During compilation, ‘sub x{’ creates a new CV. When the sub is about
to be installed (when the final ‘}’ is reached), the existing stub
must be reused. So everything is copied from the new CV (PL_compcv)
to the stub. Also, any CvOUTSIDE pointers of nested subs get updated
to point to the erstwhile stub.
State subs were not getting their CvOUTSIDE pointers updated. This
patch implements that.