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

Julia not recognizing/handling end of input stream #2446

Closed
kmsquire opened this issue Mar 2, 2013 · 3 comments
Closed

Julia not recognizing/handling end of input stream #2446

kmsquire opened this issue Mar 2, 2013 · 3 comments
Labels
bug Indicates an unexpected problem or unintended behavior priority This should be addressed urgently
Milestone

Comments

@kmsquire
Copy link
Member

kmsquire commented Mar 2, 2013

At a bash prompt, the following hangs:

$ for ((i=1; i <=10; i++)); do echo $i; done | julia -e 's = 0; for _ in each_line(STDIN) println(s); s += int(_) end; println(s)'
0
1
3
6
10
15
21
28
36
45
@JeffBezanson
Copy link
Member

Hang is here:

#0  0x00007f1aaa21ddf9 in syscall () from /lib/libc.so.6
#1  0x00007f1aaae43d06 in uv__epoll_wait (epfd=5, events=0x7fff49f328b0, 
    nevents=1024, timeout=-1) at src/unix/linux/syscalls.c:282
#2  0x00007f1aaae40a6c in uv__io_poll (loop=0x7f1aabe3efc0, timeout=-1)
    at src/unix/linux/linux-core.c:184
#3  0x00007f1aaae2b952 in uv__run (loop=0x7f1aabe3efc0) at src/unix/core.c:271
#4  0x00007f1aaae2b9b1 in uv_run (loop=0x7f1aabe3efc0) at src/unix/core.c:279
#5  0x00007f1aaae09d72 in jl_run_event_loop (loop=0x7f1aabe3efc0)
    at jl_uv.c:226
#6  0x00007f1aa9c8356c in ?? ()
#7  0x0000000000000000 in ?? ()

@JeffBezanson
Copy link
Member

Possibly related: #2331, #1469

@JeffBezanson
Copy link
Member

During the looping, uv__epoll_wait is returning events==UV__POLLHUP, which isn't handled in uv__stream_io so no callbacks are triggered and we just keep going around the event loop.

@vtjnash vtjnash closed this as completed in 32f365d Mar 7, 2013
vtjnash added a commit that referenced this issue Mar 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior priority This should be addressed urgently
Projects
None yet
Development

No branches or pull requests

3 participants