| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
Revert "[perl #92828] eintr.t hangs on FreeBSD"
This reverts commit 6e59d93aee950461947904b4f24a7f52c6c85f58.
Revert "eintr.t: skip based on capability rather than OS"
This reverts commit df375c6d048b938ecdeaecc7b264a7f1a190120a.
My attempt to skip based on capability hung freebsd, and my attempt to fix
that failed. Give up for now.
|
|
|
|
|
|
|
| |
My commit df375c6d048b938ecdeaecc7b264a7f1a190120a attempted to
convert t/io/eintr.t from OS-based skipping to capability-based skipping,
but it only tested whether reads from pipes are interruptible.
Some OSes (like FreeBSD) only hang on write; so probe for that too.
|
|
|
|
|
| |
This commit allows feature.pm-enabled keywords to work with CORE::*
even outside the scope of ‘use feature’.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The t/io/eintr.t tests require read/write system to calls to be
interruptible (to see if anything nasty can be done by the signal
handler).
Many platforms aren't interruptible, which means the tests would hang.
We currently work round this by skipping based on a hard-coded list of
OSes (such as win32, VMS etc).
Change this so that we instead do an initial test as to whether they are
interruptible, and if not, skip the whole test file.
|
|
|
|
|
|
|
|
|
| |
Opening a file handle to \$glob causes assertion failures
(under debugging) or hangs or other erratic behaviour without
debugging. This might even crash in some cases.
It never really worked properly, but it didn’t start hanging
apparently until 5.12.2 and 5.14.0.
|
|
|
|
|
|
|
| |
We already skip this test file on many platforms which don't
have interruptible IO system calls. Extend this to unconditionally
skip if it's an even (production) release version, so that we don't get
false positives for other platforms we didn't know about.
|
|
|
|
|
|
|
| |
When Perl reads the script in text mode, then the tell() position
on the script handle may include stripped carriage return characters.
Therefore the file position after reading the first line of the
script may be one larger than the length of the input buffer.
|
| |
|
|
|
|
| |
(see tickets perl #85842 and #84688).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We used to read Perl code in binary mode to make life easier for
ByteLoder to include binary data in a source file. To maintain the
illusion of text mode for the DATA handle the filehandle was
transformed from binary mode to text mode when the parser reached the
__END__ or __DATA__ tokens.
This however never worked correctly, as the positions returned by
tell(DATA) were still based on reading part of the stream in binary
mode. And even worse, flushing all filehandles before calling
system(), backticks, or fork() would actually reposition the DATA
filehandle incorrectly, so future reads from it returned the wrong
data.
http://rt.perl.org/rt3/Ticket/Display.html?id=28106 contains several
bug reports that are all related to this problem. The new t/io/data.t
file contains the failing code samples from those bugs.
This patch changes the default build option for Windows to text mode.
ByteLoader will have to deal with this internally, e.g. by rewinding
DATA and switching to binary mode itself.
|
|
|
|
|
|
| |
All callers were using it with dynamic extensions, and also had a
skip_all_if_miniperl() for the same extension. Merge the two tests into one
function to save repetition.
|
|
|
|
|
|
|
|
|
| |
It appears that a larger PerlIO buffer combined with writing to a
pipe triggers an alternate write mechanism in FreeBSD called a
direct write, which is not interruptible by signals. That's
somewhat speculative and has not been confirmed by someone with
knowledge of FreeBSD internals, but we do know the test hangs, so
it's best not to run it for now.
|
| |
|
|
|
|
|
|
|
|
|
| |
The tautological 3 way logic
if (...) { print "1..7\n" } elsif (...) { print "1..7\n" } else { ... }
had actually been in the test since it was first added in a43cb6b7285a7b60,
although it was initially "1..4\n" in each block.
Also use plan(), and set test.pl's idea of the current test before exiting.
|
| |
|
|
|
|
|
| |
It's a common idiom in the tests. This makes it easier to find, read, and
remove.
|
|
|
|
|
|
|
|
|
| |
If Errno is loaded after the compiler has parsed the C<exists &Errno::EBADF>
later in the script, then the intent of that test is subverted - &Errno::EBADF
does not exist, at least as far as the typeglob bound to that op is concerned,
and the test for $! is skipped. I suspect that these have been skipping since
the implementation of Errno was changed in 42607a60df6df19b in May 2010 to
reduce its memory footprint by 55%.
|
|
|
|
| |
This reduces the startup boilerplate code by more than half.
|
|
|
|
| |
Use it in t/io/layers.t to skip if Encode is not built.
|
|
|
|
|
|
| |
Skip under minitest using skip_all_if_miniperl().
skip_all() once rather than skipping every test if Encode is not built, or
PerlIO is not available.
|
|
|
|
|
| |
Skip a test under minitest using skip_if_miniperl().
Use eq(), like() and unlike() where appropriate, instead of ok().
|
|
|
|
|
|
|
| |
Remove redundant C<use Config;>
If C<find PerlIO::Layer 'perlio'> fails, use skip() rather than ok() to skip.
Make the indenting on 2 inconsistent lines consistent with the rest of the file.
Die if Errno can't be loaded, unless it's miniperl.
|
|
|
|
|
| |
Although File::Spec is pure Perl, it is part of the Cwd distribution, and
that isn't built for minitest. So we can't rely on it.
|
|
|
|
|
|
| |
All platforms Perl builds on can already support Unix-style paths (given that
make_ext.pl is using them). This makes 7 more tests pass under minitest, which
doesn't build File::Spec, because it's part of an XS module.
|
| |
|
|
|
|
| |
This is analogous to skipping all of t/op/iofile.t under miniperl.
|
|
|
|
| |
All require dynamic loading to work, so all should be skipped under minitest.
|
|
|
|
|
| |
When pushed on top of the stack, crlf will no longer enable crlf layers
lower in the stack. This will prevent unexpected results.
|
|
|
|
|
|
|
| |
# New Ticket Created by (Peter J. Acklam)
# Please include the string: [perl #81916]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81916 >
|
|
|
|
| |
Previously runs would leave a GLOB(0x...) file in t/
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a method call on a filehandle would die because the method can not
be resolved and L<IO::File> has not been loaded, Perl now loads IO::File
via C<require> and attempts method resolution again:
open my $fh, ">", $file;
$fh->binmode(":raw"); # loads IO::File and succeeds
This also works for globs like STDOUT, STDERR and STDIN:
STDOUT->autoflush(1);
Because this on-demand load only happens if method resolution fails, the
legacy approach of manually loading an IO::File parent class for partial
method support still works as expected:
use IO::Handle;
open my $fh, ">", $file;
$fh->autoflush(1); # IO::File not loaded
|
| |
|
|
|
|
|
| |
Apperently it's causing smokers to hang, so skip until
I find out what's happening.
|
|
|
|
|
|
|
|
| |
It's doing select() on a pipe, but only sockets work with select(),
and the read() on a pipe is not interruptible by an alarm. That's
probably because our pipe implementation is doing mailbox reads at
AST level but the alarm signal is also an AST and can't interrupt
another AST at the same mode.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently if an operation on a file handle is interrupted, and if
the signal handler accesses that same file handle (e.g. closes it),
then perl will crash. See [perl #75556].
This commit provides some basic infrastructure to avoid segfaults.
Basically it adds a lock count field to each handle (by re-purposing the
unused flags field in the PL_perlio array), then each time a signal
handler is called, the count is incremented. Then various parts of PerlIO
use a positive count to change behaviour. Most importantly, when layers
are popped, the PerlIOl structure is cleared, but not freed, and is left
in the chain of layers. This means that callers still holding pointers to
the various layers won't access freed structures. It does however mean
that PerlIOl structs may be leaked, and possibly slots in PL_perlio. But
this is better than crashing.
Not much has been done to give sensible behaviour on re-entrancy; for
example, a buffer that has already been written once might get written
again. Fixing this sort of thing would require a large-scale audit of
perlio.c.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
t/io/defout.t pollutes the output of 'make test':
t/io/defout....................................................$a;
# write
ok
The attached patch fixes this.
|
|
|
|
| |
This reverts commit 4d2eb54d4d30c9c5b093de9a57c324d5551c58fe.
|
|
|
|
|
|
|
|
|
|
|
|
| |
t/io/defout.t pollutes the output of 'make test':
t/io/defout....................................................$a;
# write
ok
The attached patch fixes this.
Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
|
|
|
|
|
|
|
|
|
|
| |
Stop *{} from returning globs with the SVf_FAKE flag on.
It removes three tests from t/op/gv.t (that I added) that test buggy
edge cases that can no longer occur.
It also modifies tests in t/io/defout.t to keep them passing. I am not
sure that test script serves any purpose any more.
|
|
|
|
|
|
|
|
|
| |
This restores the perl 5.10/12 behaviour, making open treat \$foo as a
scalar reference if it is a glob copy (SvFAKE).
It also fixes an existing assertion failure that the test now trig-
gers. PerlIOScalar_pushed was not downgrading the sv before set-
ting SvCUR.
|
|
|
|
|
| |
PerlIO_layer_from_ref must not treat a real glob as a scalar. This
function was not updated when SVt_PVGV was moved before SVt_PVLV.
|
|
|
|
|
| |
It's way too easy to forget to "local $!" in signal handlers and
changing $! when signal hits between two ops is probably never useful.
|