Skip Menu |
Report information
Id: 128047
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: alex.jakimenko [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: Rakudo may crash if you use get() when -n is used (perl6 -ne 'say get' <<< 'hello')
Download (untitled) / with headers
text/plain 429b
This bug report is somewhat related to https://rt.perl.org/Ticket/Display.html?id=128046 get() crashes with a weird error if the stream has ended. Command: perl6 -ne 'get' <<< $'hello\nworld\ntest' Result: world Nil readline requires an object with REPR MVMOSHandle in block <unit> at -e line 1 But it works if the number of lines is even. Command: perl6 -ne 'get' <<< $'hello\nworld' Result: world It should not crash.
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 973b
On Sun, 01 May 2016 04:12:34 -0700, alex.jakimenko@gmail.com wrote: Show quoted text
> This bug report is somewhat related to > https://rt.perl.org/Ticket/Display.html?id=128046 > > get() crashes with a weird error if the stream has ended. > > Command: > perl6 -ne 'get' <<< $'hello\nworld\ntest' > > Result: > world > Nil > readline requires an object with REPR MVMOSHandle > in block <unit> at -e line 1 > > But it works if the number of lines is even. > > Command: > perl6 -ne 'get' <<< $'hello\nworld' > > Result: > world > > > It should not crash.
lines() appears to have a similar affliction, though I don't see any difference if the number of lines is even. $ cat foo.txt a b c $ perl6 -ne '@ = lines' foo.txt readline requires an object with REPR MVMOSHandle in block <unit> at -e line 1 $ perl6 -ne 'lines.eager' foo.txt readline requires an object with REPR MVMOSHandle in block <unit> at -e line 1
Download (untitled) / with headers
text/plain 1.1k
On Tue, 21 Feb 2017 11:05:15 -0800, cpan@zoffix.com wrote: Show quoted text
> On Sun, 01 May 2016 04:12:34 -0700, alex.jakimenko@gmail.com wrote:
> > This bug report is somewhat related to > > https://rt.perl.org/Ticket/Display.html?id=128046 > > > > get() crashes with a weird error if the stream has ended. > > > > Command: > > perl6 -ne 'get' <<< $'hello\nworld\ntest' > > > > Result: > > world > > Nil > > readline requires an object with REPR MVMOSHandle > > in block <unit> at -e line 1 > > > > But it works if the number of lines is even. > > > > Command: > > perl6 -ne 'get' <<< $'hello\nworld' > > > > Result: > > world > > > > > > It should not crash.
> > lines() appears to have a similar affliction, though I don't see any > difference if the number of lines is even. > > $ cat foo.txt > a > b > c > > $ perl6 -ne '@ = lines' foo.txt > readline requires an object with REPR MVMOSHandle > in block <unit> at -e line 1 > > > $ perl6 -ne 'lines.eager' foo.txt > readline requires an object with REPR MVMOSHandle > in block <unit> at -e line 1 > >
Behavior has changed, the examples above now fail with: Cannot do 'get' on a handle in binary mode


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org