develooper Front page | perl.perl6.compiler | Postings from March 2018

[perl #131393] [JVM] When reading from stdin, eof is not respected

From:
Christian Bartolomaeus via RT
Date:
March 5, 2018 20:31
Subject:
[perl #131393] [JVM] When reading from stdin, eof is not respected
Message ID:
rt-4.0.24-13710-1520281911-1073.131393-15-0@perl.org
On Sun, 28 May 2017 13:09:18 -0700, bartolin@gmx.de wrote:
> Currently rakudo on JVM does not respect eof when reading from stdin.
> 
> bartolin_     r: .say for lines()
> camelia       rakudo-moar 094e77: OUTPUT: «»Wann treffen wir drei
> wieder zusamm?«␤   »Um die siebente Stund‘, am Brückendamm.«␤     »Am
> Mittelpfeiler.«␤         »Ich lösche die Flamm.«␤ »Ich mit«␤␤ »Ich
> komme vom Norden her.«␤        »Und ich vom Süden.«…»
>               ..rakudo-jvm 094e77: OUTPUT:
> «␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤…»
> 
> For further discussion see https://irclog.perlgeek.de/perl6-dev/2017-
> 05-27#i_14645528
> 
> I've fudged some tests in roast that were hanging due to this problem
> and I'll add this ticket number to the fudge message. Also, I'll
> disable S19-command-line/repl.t in t/spectest.data.
> 
> Those changes should be reverted, once the problem is solved.

Some of the mentioned tests are passing again (unfudged with https://github.com/perl6/roast/commit/9ba8d28315). Also S19-command-line/repl.t is enabled for the JVM backend again: https://github.com/rakudo/rakudo/commit/90303c1e3e

Unfortunately, there is still something wrong with some tests in S32-io/pipe.t (and maybe elsewhere). I think it could be caused by nqp::readfh on stdin only returning when eof is encountered or 0x100000 bytes are read: https://github.com/rakudo/rakudo/blob/90303c1e3ec9b9b5f6aaef50bed85b4a9ff6455f/src/core/IO/Handle.pm6#L280



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About