Skip to content

PerlIO: don't set the error flag when reading on an EAGAIN #23314

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

Open
wants to merge 1 commit into
base: blead
Choose a base branch
from

Conversation

tonycoz
Copy link
Contributor

@tonycoz tonycoz commented May 21, 2025

This allows questionable code that tries to combine select and buffered I/O to limp along. Such code is still
risky due to select() checking the underlying OS handle and not the perl handle.

Fixes #22883 but is perhaps a bit more daring.


  • This set of changes requires a perldelta entry, and I need help writing it.

@jkeenan
Copy link
Contributor

jkeenan commented May 21, 2025

This code in the pull request ...

+{
+    use IO::Select;
+

... causes a failure in make minitest.

$ ./miniperl -Ilib t/io/perlio.t
Can't locate IO/Select.pm in @INC (you may need to install the IO::Select module) (@INC entries checked: ... 
) at t/io/perlio.t line 250.
BEGIN failed--compilation aborted at t/io/perlio.t line 250.

Also failing on Windows runs in our CI.

This allows questionable code that tries to combine select and
buffered I/O to limp along.  Such code is still
risky due to select() checking the underlying OS handle and not
the perl handle.

Fixes Perl#22883
@tonycoz tonycoz force-pushed the 22883-perlio-eagain branch from 44a1622 to 44851a8 Compare May 21, 2025 23:11
@tonycoz
Copy link
Contributor Author

tonycoz commented May 21, 2025

Fixed minitest.

The Win32 failure was due to a missing SKIP: label (I adapted this from the other readline fix branch which used skip_alls) and that test now passes (and has passed in CI at this point)

@tonycoz
Copy link
Contributor Author

tonycoz commented May 22, 2025

I think an adaption of this might be useful for a longer term fix, but I don't think it's suitable this late in the release cycle, it changes the behaviour of read() (and getc() which is implemented in terms of get() read()) to effectively not return a failure condition which existing code may rely on.

@haarg haarg added the defer-next-dev This PR should not be merged yet, but await the next development cycle label May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defer-next-dev This PR should not be merged yet, but await the next development cycle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

close fails with irrelevant errors after perl 5.38
3 participants