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
perl 5.12 consumes all the memory on: open FILE, '<', \*STDIN or die; <FILE>; #11418
Comments
From vincent@vinc17.netCreated by vincent@vinc17.netperl 5.12 consumes all the memory on: perl -e "open FILE, '<', \*STDIN or die; <FILE>;" perl 5.10 didn't have this problem. Reproducible under both Mac OS X (this bug report) and GNU/Linux http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=629363 Perl Info
|
From @cpansproutOn Sun Jun 05 15:12:28 2011, vincent@vinc17.net wrote:
If you are trying to duplicate STDIN, you need to use '<&' rather than '>': $ echo "foo" | perl5.10.1 -le 'open FILE, "<&", \*STDIN or die $!; print If you use '<', on a reference, it’s meant to read the scalar, or fall $ perl -le 'open FILE, "<", \*STDIN or die $!; print $_ while <FILE>;' $ perl5.12.0 -le 'open FILE, "<", \*STDIN or die $!; print $_ while <FILE>;' It hangs for me, too, in 5.12.2. Presumably it’s trying to read one huge This was fixed in 5.14.0, which restores the 5.8.x behaviour: $ perl5.8.8 -le 'open FILE, "<", \*STDIN or die $!; print $_ while <FILE>;' |
The RT System itself - Status changed from 'new' to 'open' |
@cpansprout - Status changed from 'open' to 'resolved' |
From @cpansproutOn Sun Jun 05 18:05:41 2011, sprout wrote:
Having said that, opening a glob copy (which is treated as a regular $ perl5.14.0 -le 'open FILE, "<", \( |
@cpansprout - Status changed from 'resolved' to 'open' |
From @cpansproutOn Sun Jun 05 19:38:00 2011, sprout wrote:
With debugging turned on, I get an assertion failure: Assertion failed: (!isGV_with_GP(_svcur)), function That should make it easy to fix.... |
From @cpansproutOn Sun Jun 05 22:06:44 2011, sprout wrote:
This is now fixed with commit 71edc89. Is there any chance this, too, could be backported to 5.14.1? |
@cpansprout - Status changed from 'open' to 'resolved' |
From @cpansproutOn Sun Jun 05 22:40:16 2011, sprout wrote:
I forgot to mention: This never really worked properly (strings read |
From [Unknown Contact. See original ticket]On Sun Jun 05 22:40:16 2011, sprout wrote:
I forgot to mention: This never really worked properly (strings read |
From vincent@vinc17.netOn 2011-06-05 18:05:41 -0700, Father Chrysostomos via RT wrote:
Yes, but the main problem is the memory consumption, as my machine I tried '<' to see whether this worked (I couldn't see any reason open FILE, '<', defined $file ? $file : \*STDIN or die; -- |
From @cpansproutOn Aug 28, 2011, at 10:26 AM, Jesse Vincent wrote:
Actually it does.
5.10 is what broke it originally. What you are seeing there is memory corruption. What happened to the IN in STDIN? $ perl5.10.1 -le "open FILE, '<', \*a::a or die; print <FILE>;" That one’s reading past the glob name into random memory.
Same in 5.8. But your one-liner doesn’t trigger the exact bug that 71edc89 is fixing. Your one-liner is fixed in 5.14: But glob copies were missed: Both one-liners behave the same way in all previous versions.
The ‘whether it’s doing it right’ part makes me laugh. Several parts of the perl core weren’t ‘doing it right’, resulting in some of the bugs I’ve fixed lately. In this particular case, that patch turns off the temp flag to avoid perpetuating an existing bug: pp_return and pp_leavesub return as-is anything marked TEMP, instead of copying it the way they are supposed to. Later in blead I fixed that return bug and removed the SvTEMP_off that that patch added. It could also be backported without the SvTEMP_off, and with some of the tests removed.
To clarify: The test in a9 relies on the bug that 3e fixes. So 3e depends on d5 iff a9 is backported.
|
Migrated from rt.perl.org#92258 (status was 'resolved')
Searchable as RT92258$
The text was updated successfully, but these errors were encountered: