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
Regression between 5.26 and 5.28 in handling of filehandles in piped open #16788
Comments
From @jmdhCreated by @jmdhThis is a bug report for perl from dom@earth.li, ----------------------------------------------------------------- ------------ perl -e 'close(STDIN); open(CHILD, "|wc -l")' On Debian stable (5.24.1-3+deb9u5) it produces: $ perl -e 'close(STDIN); open(CHILD, "|wc -l")' but on Debian testing/unstable (5.28.1-1, 5.28.1-3) it produces: $ perl -e 'close(STDIN); open(CHILD, "|wc -l")' Other variants of open to a command This wreaks havoc on Perl filter scripts that pass data between child I have bisected this change in behaviour to Thanks to leont for looking at the problem on IRC and advising me to file Perl Info
|
From @jkeenanOn Sat, 15 Dec 2018 15:19:21 GMT, dom wrote:
Different OSes appear to (mis)handle the command in question differently. I first confirmed Dom's finding on Linux (Ubuntu). I then tried it out on FreeBSD-11.2, first on 5.26.2 (the "vendor perl") and then on blead. ##### $ perl -v | head -2 | tail -1 $ ./perl -Ilib -v | head -2 | tail -1 ##### Regardless of perl version, the command hung and I had to Ctrl-C to get back to the prompt. Related? Thank you very much. -- |
The RT System itself - Status changed from 'new' to 'open' |
From @jkeenanOn Sat, 15 Dec 2018 15:19:21 GMT, dom wrote:
We've apparently been back and forth on this. Looking at 'git log' and searching for that SHA, I get: ##### Revert "Revert "make PerlIO handle FD_CLOEXEC"" Which refers to this revert commit: ##### Revert "make PerlIO handle FD_CLOEXEC" -- |
From @jkeenanOn Sat, 15 Dec 2018 16:08:37 GMT, jkeenan wrote:
For research purposes, I have created a smoke branch which reverts the original commit: smoke-me/jkeenan/133726-revert-2cdf406a However, it should be noted that that commit was one of a sizable number of commits by Zefram dealing with "*_cloexec() I/O functions". Thank you very much. -- |
From @LeontOn Sat, Dec 15, 2018 at 4:20 PM Dominic Hargreaves (via RT)
I've just pushed c6fe5b9, which fixes This should be backported to 5.28.2 as well. Leon |
From @jkeenanOn Sat, 15 Dec 2018 22:05:41 GMT, LeonT wrote:
With that commit, I'm no longer getting the warning on either Linux or FreeBSD. We should write a test for this behavior -- but that test would have to take into account the different behaviors on different OSes of the Perl code Dom originally mentioned. Thank you very much. |
From @steve-m-hayOn Sun, 16 Dec 2018 10:38:18 -0800, LeonT wrote:
Now both cherry-picked into maint-5.28 for 5.28.2. |
@steve-m-hay - Status changed from 'open' to 'pending release' |
From @LeontOn Sun, Dec 16, 2018 at 3:35 PM James E Keenan via RT
Agreed. It turns out that writing a portable testcase is quite Leon |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.30.0, this and 160 other issues have been Perl 5.30.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#133726 (status was 'resolved')
Searchable as RT133726$
The text was updated successfully, but these errors were encountered: