Skip to content
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

When reading from stdin, eof is not respected #6288

Closed
p6rt opened this issue May 28, 2017 · 4 comments
Closed

When reading from stdin, eof is not respected #6288

p6rt opened this issue May 28, 2017 · 4 comments
Labels
JVM Related to Rakudo-JVM

Comments

@p6rt
Copy link

p6rt commented May 28, 2017

Migrated from rt.perl.org#131393 (status was 'open')

Searchable as RT131393$

@p6rt
Copy link
Author

p6rt commented May 28, 2017

From @usev6

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.

@p6rt
Copy link
Author

p6rt commented Mar 5, 2018

From @usev6

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 Raku/roast@9ba8d28315). Also S19-command-line/repl.t is enabled for the JVM backend again​: rakudo/rakudo@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

@p6rt
Copy link
Author

p6rt commented Mar 5, 2018

@usev6 - Status changed from 'new' to 'open'

@p6rt p6rt added the JVM Related to Rakudo-JVM label Jan 5, 2020
@usev6
Copy link

usev6 commented Nov 7, 2021

If I'm not mistaken, the remaining problem has nothing to do with eof not being respected. Instead the underlying problem seems to be, that connecting the stdout of one (asynchronously started) process to the stdin of another such process doesn't work on the JVM backend due to missing support for access to native file descriptors -- as described in: rakudo/rakudo#1899.

Since the main problem is fixed, I'm closing this old issue.

@usev6 usev6 closed this as completed Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JVM Related to Rakudo-JVM
Projects
None yet
Development

No branches or pull requests

2 participants