| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
VM/ESA was a mainframe OS. IBM ended service on it in June 2003. It was
superseded by Z/VM.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes most register declarations in C code (and accompanying
documentation) in the Perl core. Retained are those in the ext
directory, Configure, and those that are associated with assembly
language.
See:
http://stackoverflow.com/questions/314994/whats-a-good-example-of-register-variable-usage-in-c
which says, in part:
There is no good example of register usage when using modern compilers
(read: last 10+ years) because it almost never does any good and can do
some bad. When you use register, you are telling the compiler "I know
how to optimize my code better than you do" which is almost never the
case. One of three things can happen when you use register:
The compiler ignores it, this is most likely. In this case the only
harm is that you cannot take the address of the variable in the
code.
The compiler honors your request and as a result the code runs slower.
The compiler honors your request and the code runs faster, this is the least likely scenario.
Even if one compiler produces better code when you use register, there
is no reason to believe another will do the same. If you have some
critical code that the compiler is not optimizing well enough your best
bet is probably to use assembler for that part anyway but of course do
the appropriate profiling to verify the generated code is really a
problem first.
|
|
|
|
|
|
| |
UTS was a mainframe version of System V created by Amdahl, subsequently sold
to UTS Global. The port has not been touched since before 5.8.0, and UTS
Global is now defunct.
|
|
|
|
|
| |
The subdirectory containing the port specific files was purged when 5.000
was released, but changes made to other files were not removed.
|
| |
|
|
|
|
| |
to make sure it really is never reached.
|
|
|
|
|
| |
In the error message, we shouldn’t omit a handle whose name begins
with "\0", but, rather, a handle whose name has no length to it.
|
|
|
|
| |
newSVhek (used to create this SV) always returns an SvPOK scalar.
|
|
|
|
|
| |
In the error message, we shouldn’t omit a handle whose name begins
with "\0", but, rather, a handle whose name has no length to it.
|
|
|
|
|
|
|
| |
Checking isGV_with_GP makes the isGV check redundant. The only case
in which isGV could be true when isGV_with_GP is false could be a GV
playing PVBM, but those don’t exist any more. When they did exist,
this check was probably wrong (and crashable).
|
|
|
|
|
| |
Now that sv_vcatpvfn supports HEKs directly, we don’t need to create a
temporary SV out of one.
|
|
|
|
|
|
|
| |
Checking isGV_with_GP makes the isGV check redundant. The only case
in which isGV could be true when isGV_with_GP is false could be a GV
playing PVBM, but those don’t exist any more. When they did exist,
this check was probably wrong (and crashable).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ ./perl -Ilib -e '$/=*foo; <>; warn' <./perl
Assertion failed: (!isGV_with_GP(_svcur)), function Perl_mess_sv, file util.c, line 1467.
Abort trap
The assertion happens when ‘<...> line 42’ is being appended to
the message.
The line of code in question is this:
const bool line_mode = (RsSIMPLE(PL_rs) &&
SvCUR(PL_rs) == 1 && *SvPVX_const(PL_rs) == '\n');
It uses this macro in perl.h:
#define RsSIMPLE(sv) (SvOK(sv) && (! SvPOK(sv) || SvCUR(sv)))
which was last modified by commit af7d13df559:
-#define RsSIMPLE(sv) (SvOK(sv) && SvCUR(sv))
-#define RsPARA(sv) (SvOK(sv) && ! SvCUR(sv))
+#define RsSIMPLE(sv) (SvOK(sv) && (! SvPOK(sv) || SvCUR(sv)))
+#define RsPARA(sv) (SvPOK(sv) && ! SvCUR(sv))
So it looks as though it has always called SvCUR on something that is
not necessarily a PV. As of commit af7d13df559, it has also called
SvPVX on a potential non-PV.
Fixing this simply involves using SvPV instead of SvPVX.
I don’t know that t/io/open.t is the best place for the test, but all
the other ‘<...> line 42’ tests are there.
|
|
|
|
|
|
|
|
|
|
|
|
| |
For some reason this is listed in the API, even though it is not docu-
mented and is only available under ithreads.
It was added by commit ed221c5717, which doesn’t explain why it needed
to be part of the API. (Presumably because a public macro used it,
even though there are better ways to solve that.)
It is unused on CPAN and (now) in core, so there is no reason
to keep it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this commit, a pointer to the cop’s stash was stored in
cop->cop_stash under non-threaded perls, and the name and name length
were stored in cop->cop_stashpv and cop->cop_stashlen under ithreads.
Consequently, eval "__PACKAGE__" would end up returning the
wrong package name under threads if the current package had been
assigned over.
This commit changes the way cops store their stash under threads. Now
it is an offset (cop->cop_stashoff) into the new PL_stashpad array
(just a mallocked block), which holds pointers to all stashes that
have code compiled in them.
I didn’t use the lexical pads, because CopSTASH(cop) won’t work unless
PL_curpad is holding the right pad. And things start to get very
hairy in pp_caller, since the correct pad isn’t anywhere easily
accessible on the context stack (oldcomppad actually referring to the
current comppad). The approach I’ve followed uses far less code, too.
In addition to fixing the bug, this also saves memory. Instead of
allocating a separate PV for every single statement (to hold the stash
name), now all lines of code in a package can share the same stashpad
slot. So, on a 32-bit OS X, that’s 16 bytes less memory per COP for
short package names. Since stashoff is the same size as stashpv,
there is no difference there. Each package now needs just 4 bytes in
the stashpad for storing a pointer.
For speed’s sake PL_stashpadix stores the index of the last-used
stashpad offset. So only when switching packages is there a linear
search through the stashpad.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This little statement:
if (SvSCREAM(sv))
return;
filters out not only studied strings, but also GVs.
Since studied strings are gone, it only filters out GVs now. Since
fbm_compile coerces its argument, we still want to filter out GVs, so
we use isGV_with_GP to make the intent clear.
|
|
|
|
|
|
|
|
|
|
| |
How did this ever end up in the API?
Anyway, this commit guts it by removing its guts and replacing it with
a panic message. This function would fail assertions if passed an
unstudied scalar, so it should never be called any more. But XS mod-
ules that still do if (SvSCREAM(sv)) screaminstr(...) should still be
able to compile.
|
| |
|
|
|
|
|
| |
This updates the editor hints in our files for Emacs and vim to request
that tabs be inserted as spaces.
|
|
|
|
|
| |
C++ requires #include directives to be at file scope, but we've
been lazy and haven't been doing that.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a follow-up to commits 6379d4a9a and 862504fb08.
As Karl Williamson (thank you!) pointed out, my changes were not suf-
ficient, because strEQ was still being used, which stops at the first
null, treating "foo\0bar" and "foo\0foo" as equivalent.
Under threads, strict vars was not respecting glob assignment from a
package with a null in its name to another also with a null in its
name, if the two package names shared a common prefix up to the null.
|
|
|
|
|
|
|
|
|
|
| |
In this particular case, the name of the current package in UTF-8 (it
cannot be expressed in Latin-1) is the same byte sequence as the name
of the package being assigned to in Latin-1.
Some of the logic in stashpv_hvname_match was faulty. It worked for
a Latin-1 current package assigning to a glob in a UTF-8 package, but
not the other way around.
|
|
|
|
|
|
| |
Under threads, strict vars was not respecting glob assignment from a
package with a null in its name if the name of the package assigned to
was equal to the prefix of the current package up to the null.
|
|
|
|
|
|
| |
Under threads, strict vars was not respecting assignment to a package
with a null in its name if the name of the package assigned from was
equal to the prefix of the destination package up to the null.
|
|
|
|
|
|
|
|
|
| |
This is a follow-up to commit 78e230aef16b.
It was using a temporary undef scalar and concatenating to it instead
of setting it, triggering the warning.
I haven’t added tests, out of paranoia.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On most systems, this is actually a panic, rather than an overflow,
because the overflow is detected before it can happen.
upg_version needs to use the equivalent of sprintf "%.9f" on a numeric
input before parsing it. For speed’s sake, I assume, it was done
using my_snprintf, with a C auto for the buffer, declared with a fixed
size of 64.
There is no guarantee that the number passed in will not overflow that
buffer, so upg_version should use an SV and sv_catpvf in those cases
where it would overflow.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Setting ${^WARNING_BITS} should not allow perl to read past the end of
a mallocked buffer. Previously the internal warning buffer would be
copied straight from ${^WARNING_BITS}, so a short value assigned to
that variable would cause the internal warning-checking code to read
past the end of the buffer (probably not in actual practice, due to
malloc’s rounding up, but theoretically). Now, the buffer that is
allocated for storing the warning bits is padded with nulls to make it
long enough to prevent bad reads.
The stored length is still the same as what was assigned to
${^WARNING_BITS}, so that the value that comes out of it is the same
length (UTF8-ness aside)--not that it makes much difference in prac-
tice though, since only warnings.pm should care about this.
This came up as part of perl #111500.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under POSIX threads the getpid() and getppid() functions return the
same values across multiple threads, i.e. threads don't have their own
PID's. This is not the case under the obsolete LinuxThreads where each
thread has a different PID, so getpid() and getppid() will return
different values across threads.
Ever since the first perl 5.0 we've returned POSIX-consistent
semantics for $$, until v5.14.0-251-g0e21945 when the getpid() cache
was removed. In 5.8.1 Rafael added further explicit POSIX emulation in
perl-5.8.0-133-g4d76a34 [1] by explicitly caching getppid(), so that
multiple threads would always return the same value.
I don't think all this effort to emulate POSIX sematics is worth it. I
think $$ and getppid() are OS-level functions that should always
return the same as their C equivalents. I shouldn't have to use a
module like Linux::Pid to get the OS version of the return values.
This is pretty much a complete non-issue in practice these days,
LinuxThreads was a Linux 2.4 thread implementation that nobody
maintains anymore[2], all modern Linux distros use NPTL threads which
don't suffer from this discrepancy. Debian GNU/kFreeBSD does use
LinuxThreads in the 6.0 release, but they too will be moving away from
it in future releases, and really, nobody uses Debian GNU/kFreeBSD
anyway.
This caching makes it unnecessarily tedious to fork an embedded Perl
interpreter. When someone that constructs an embedded perl interpreter
and forks their application, the fork(2) system call isn't going to
run Perl_pp_fork(), and thus the return value of $$ and getppid()
doesn't reflect the current process. See [3] for a bug in uWSGI
related to this, and Perl::AfterFork on the CPAN for XS code that you
need to run after forking a PerlInterpreter unbeknownst to perl.
We've already been failing the tests in t/op/getpid.t on these Linux
systems that nobody apparently uses, the Debian GNU/kFreeBSD users did
notice and filed #96270, this patch fixes that failure by changing the
tests to test for different behavior under LinuxThreads, I've tested
that this works on my Debian GNU/kFreeBSD 6.0.4 virtual machine.
If this change is found to be unacceptable (i.e. we want to continue
to emulate POSIX thread semantics for the sake of LinuxThreads) we
also need to revert v5.14.0-251-g0e21945, because currently we're only
emulating POSIX semantics for getppid(), not getpid(). But I don't
think we should do that, both v5.14.0-251-g0e21945 and this commit are
awesome.
This commit includes a change to embedvar.h made by "make
regen_headers".
1. http://www.nntp.perl.org/group/perl.perl5.porters/2002/08/msg64603.html
2. http://pauillac.inria.fr/~xleroy/linuxthreads/
3. http://projects.unbit.it/uwsgi/ticket/85
|
|
|
|
|
|
| |
Applied patch from John Peacock, but added whitespace fixes,
corrected pod link error and updated known Pod issues to reflect
a fix.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The convention is that when the interpreter dies with an internal error, the
message starts "panic: ". Historically, many panic messages had been terse
fixed strings, which means that the out-of-range values that triggered the
panic are lost. Now we try to report these values, as such panics may not be
repeatable, and the original error message may be the only diagnostic we get
when we try to find the cause.
We can't report diagnostics when the panic message is generated by something
other than croak(), as we don't have *printf-style format strings. Don't
attempt to report values in panics related to *printf buffer overflows, as
attempting to format the values to strings may repeat or compound the
original error.
|
| |
|
|
|
|
|
| |
cc on solaris is smart enough to figure out that this return isn't
reached.
|
|
|
|
|
|
| |
Also teach diag.t not to mistake /* die */ for a die() call, as
it did in this case, consequently ignoring the diag_listed_as,
which it thought was in the middle of the call.
|
|
|
|
|
| |
This means we have to call setlocale with a NULL second parameter
to get the correct old value; then call it with the new value
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following paragraph is in perlguts.pod:
To check if you've got an object derived from a specific class you have
to write:
if (sv_isobject(sv) && sv_derived_from(sv, class)) { ... }
which does the right thing with magical things like tied scalars.
Signed-off-by: David Golden <dagolden@cpan.org>
|
|
|
|
|
|
|
|
|
|
| |
When an XS module’s version is checked when it is loading, the string
"version" should be treated the same way as "versions" and emit the
‘Invalid version format’ error, instead of being treated as a version
object at first and then rejected by the validator with the ‘Invalid
version object’ error.
See also perl #102586.
|
|
|
|
|
|
| |
This adds an ROK check after calling sv_derived_from, as the latter
also works for class names. It is done after sv_derived_from, rather
than before, as sv_derived_from calls get-magic.
|
|
|
|
|
| |
a7999c089 inadvertently made pp_goto crash if the GV had no
stash pointer.
|
|
|
|
|
| |
This comment was copied from pp_goto by commit 005a8a35, but was not
adjusted to make sense in its new surroundings.
|
|
|
|
| |
Commit a7999c0893, you are at fault!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When DB::sub is about to be called (to handle a subroutine call under
the debugger), $DB::sub is set to the name of the subroutine or a ref-
erence to it.
Sometimes $DB::sub is set to the name when the subroutine is not call-
able under that name. That should not happen.
This logic in util.c:Perl_get_db_sub decides whether a reference
should be used:
if ( svp && ((CvFLAGS(cv) & (CVf_ANON | CVf_CLONED))
|| strEQ(GvNAME(gv), "END")
|| ((GvCV(gv) != cv) && /* Could be imported, and old sub redefined. */
!( (SvTYPE(*svp) == SVt_PVGV)
&& (GvCV((const GV *)*svp) == cv)
&& (gv = (GV *)*svp)
)
)
)) {
/* Use GV from the stack as a fallback. */
(That comment about using the GV from the stack as a fallback applies
to the assignment to gv, but was mistakenly divorced from it in commit
3de9ffa12.)
This logic (introduced in 71be2cbc7 [inseparable changes from
perl5.003_13 to perl5.003_14] and integrated into blead in 491527d02)
tries to find a GV that points to the CV, trying the CV’s own GV
first, and falling back to what is on the stack. But it does not
account for GVs that are not found under their names, which can hap-
pen when a glob is copied and the original is undefined ($foo = *bar;
undef *bar; &$foo) or when a stash element or package is deleted, such
as via Symbol::delete_package.
If the subroutine is not locatable under its own name or the name
under which it was called (the name of the GV argument to entersub),
then a reference should be passed. Otherwise a name that can access
the sub should be passed.
So this commit adds more (no, not more!) conditions to make sure the
gv is actually reachable under its name before using a string.
Since, for effiency, those conditions do not perform an actual symbol
lookup, but simply look inside the GV’s stash, we can no longer rely
on gv_efullname (or even gv_fullname), as the stash may have been
moved around, but use HvENAME and construct the GV name ourselves.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
long is 32-bit for the 64-bit Win32 memory model, so use the more
portable SSize_t.
Before the change:
C:\Users\tony\dev\perl\git\perl>perl -e "open my $f, 'dir |' or die; $x = ''; re
ad($f, $x, 4, 0x80000000)"
panic: realloc at -e line 1.
and after:
C:\Users\tony\dev\perl\git\perl>perl -e "open my $f, 'dir |' or die; $x = ''; re
ad($f, $x, 4, 0x80000000)"
C:\Users\tony\dev\perl\git\perl>git add util.c
|
|
|
|
|
|
|
|
|
|
|
| |
E.g., this overflows INT_MAX and overruns heap memory:
$ perl -le 'print "v"x(2**31+1)'
[Exit 139 (SEGV)]
(Perl_repeatcpy): Use the same type for "count" as our sole
callers in pp.c: IV (long), not I32 (int). Otherwise, passing
the wider value to a narrower "I32 count"
|
|
|
|
|
|
| |
Commit aa33328e8 inadvertently removed the null checks from
stashpv_hvname_match when adding UTF8 support, resulting in crashes it
List::Gen’s test suite.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
097ee67dff1c60f2 didn't need to include <locale.h> in locale.c (then
util.c) because it had been included by perl.h since 5.002 beta 1
3f270f98f9305540 missed removing the include of <unistd.h> from perl.c
or perlio.c
de8ca8af19546d49 changed perl.h to also include <sys/wait.h>, but didn't
notice that it code therefore be removed from perl.c, pp_sys.c and util.c
|
| |
|
|
|
|
|
|
|
|
| |
global.sym was a file listing the exported symbols, generated by regen/embed.pl
from embed.fnc and regen/opcodes, which was only used by makedef.pl
Move the code that generates global.sym from regen/embed.pl to makedef.pl,
and thereby eliminate the need to ship a 907 line generated file.
|