Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.bugs.dist > #1111459
| From | Ian Jackson <ijackson@chiark.greenend.org.uk> |
|---|---|
| Newsgroups | linux.debian.bugs.dist |
| Subject | Bug#1016369: IO::Handle ->error does not work, always saying "fine" |
| Date | 2022-07-30 14:50 +0200 |
| Message-ID | <EOU4N-ePfX-7@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Package: perl
Version: 5.34.0-4
Severity: grave
To reproduce
perl -MIO::Handle -e 'open X, "<", "." or die $!; $_ = <X>; printf "%s %s %s\n", X->error(), $!;'
perl -MIO::Handle -e 'open X, ">", "/dev/full" or die $!; print X 1; flush X; printf "%s %s %s\n", X->error(), $!; close X'
Expected output
-1 Bad file descriptor
-1 No space left on device
Actual output
0 Bad file descriptor
0 No space left on device
This is quite alarming. I think it makes it in fact impossible to
read files fully reliably in Perl. "use autodie" does not seem to help.
And scripts might reasonably have expected that they could defer error
handling by testing error() rather than each call (as one can in C).
I think this used to work, but, evidently, only in the distant past,
since my jessie chroot doesn't get this right either.
Justification for the severity:
Can cause data loss: if a file is opened but unreadable for any
reason, the program will process the part (if any) that will is
readable and then
Ian.
--
Ian Jackson <ijackson@chiark.greenend.org.uk> These opinions are my own.
Pronouns: they/he. If I emailed you from @fyvzl.net or @evade.org.uk,
that is a private address which bypasses my fierce spamfilter.
Back to linux.debian.bugs.dist | Previous | Next — Next in thread | Find similar | Unroll thread
Bug#1016369: IO::Handle ->error does not work, always saying "fine" Ian Jackson <ijackson@chiark.greenend.org.uk> - 2022-07-30 14:50 +0200
Bug#1016369: IO::Handle ->error does not work, always saying "fine" Niko Tyni <ntyni@debian.org> - 2022-08-06 20:10 +0200
Bug#1016369: IO::Handle ->error does not work, always saying "fine" Ian Jackson <ijackson@chiark.greenend.org.uk> - 2022-08-06 21:50 +0200
Bug#1016369: IO::Handle ->error does not work, always saying "fine" Niko Tyni <ntyni@debian.org> - 2022-08-07 20:10 +0200
csiph-web