New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perlio forget about buffering settings on EAGAIN #8701
Comments
From perlbug@plan9.deCreated by perlbug@plan9.deIt seems that $| and autoflush ability is lost on the first EAGAIN. Here is a test program that might or might not work (it should be run !/usr/bin/perl use Fcntl; open my $fh, ">&1" or die; $|=1; print "-"; Here is an explanation of what the program does: 1. get another filehandle for stdout Here is what I expect: -* <---cursor here (-+* is another expected possibility) here is what I usually get: - <---cursor here If I strace the program (carefully), I get (among others), this: write(1, "-", 1) = 1 As you can see, "-" gets printed, then our 8k dump fills the tty buffer, After a second, we write another "*", but perl will not even attempt the This is IMHO a bug, as $| should cause a flush, and thus a write(). Doing Please note that I didn't investigate this further (it could quite likely I still think perl most be involved somehow, as an explicit flush (setting Please also note that the "+" usually gets lost, which is somehow expected Perl Info
|
From @dcollinsnI get some very inconsistent results from this: dcollins@nightshade64:~/toolchain$ perl5.25.0 41043.pl Which is also what 5.8.8 does: dcollins@nightshade64:~/toolchain$ perl5.8.8 41043.pl Even a `reset` doesn't get back to the original behavior, but Ctrl-D, script /dev/null does. What is going on here? -- |
From [Unknown Contact. See original ticket]I get some very inconsistent results from this: dcollins@nightshade64:~/toolchain$ perl5.25.0 41043.pl Which is also what 5.8.8 does: dcollins@nightshade64:~/toolchain$ perl5.8.8 41043.pl Even a `reset` doesn't get back to the original behavior, but Ctrl-D, script /dev/null does. What is going on here? -- |
From zefram@fysh.orgThis can be tested more cleanly by creating a pipe and never reading The behaviour seen arises from the sticky error status of an I/O handle. Further enlightenment can be gained by changing the print operations to You can clear the sticky error flag by using the ->clearerr method This behaviour isn't a bug in perl. However, it might be less strange We could also probably document this better. -zefram |
The RT System itself - Status changed from 'new' to 'open' |
From @cpansproutOn Sun, 26 Mar 2017 17:01:37 -0700, zefram@fysh.org wrote:
I still consider it unacceptable. (I reported a similar bug some years ago with the same underlying cause. I don’t know the number or remember the subject line.)
If print is going to do two separate print operations behind the scenes when given two arguments, then both operations should happen the same way. I.e., what you suggested above (which is unhelpful), or print("a","b") should be equivalent to print("a"),print("b"). If it can print the "a" without checking the error status, it should be able to print the "b" the same way. -- Father Chrysostomos |
From zefram@fysh.orgFather Chrysostomos via RT wrote:
With autoflush processing after the "a"? Someone's bound to be annoyed
If we go that way, presumably we'd also do the autoflush (whether once or We could expect that user code would contain higher-level I/O sequences So I'd favour what I proposed: that the sticky error state should -zefram |
Migrated from rt.perl.org#41043 (status was 'open')
Searchable as RT41043$
The text was updated successfully, but these errors were encountered: