-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
reading output from readandwrite freezes on Windows #7082
Comments
It should work, but the julia repl subprocess is waiting to read one more character before it dies. @Keno |
So any chance of fixing #7174 for the release, or do we |
It's on the list for 0.3, if someone has any idea how to patch it. This seems an especially hard windows bug to work around well |
duplicate of #7174 |
this is only an issue for |
Happens outside of Mintty too. |
oh. i guess it could happen to any NamedPipe if anyone wants to fix this, I've posted several useful links on the upstream issue page: |
Read those links, were interesting but over my head. Would love to help fix this, but don't think I'm capable of it. Last time writing a Windows kernel module was mentioned (#6144 (comment)), I thought it was a joke. That sounds like the kind of thing that could (?) complicate the Julia installation process on Windows in terms of permissions or antivirus false-positives, which are thankfully in good shape right now. |
There will be no writing of julia kernel modules. |
That one might have been a joke, but this "feature" is a lot more annoying. It doesn't sound like it triggers antivirus detection, but it does apparently trigger hacking detection in some games (according the FAQ http://processhacker.sourceforge.net/faq.php). It apparently loads from memory when launching the program, thereby avoiding issues with installation or needing permissions. If we didn't mind linking with GPL3 code, it would be as simple as copying the relevant file from their project (perhaps their developers would be willing to relicense it?) @Keno, it would be a libuv kernel module, not a Julia kernel module :) |
#7611 made me realize that a simple kernel module for replacing NtQueryInformationFile would be utterly insufficient to fix this bug. Actually we just need to reimplement NamedPipes with a less buggy ReadFile implementation (I consider all possible deadlock situations to be bugs, especially ones that the user can't actually avoid). Perhaps we could just ship with Qemu instead, or wubi? |
Are we sure we can't just get the CancelRead approach to work? |
Are Node, Rust, etc capable of spawning themselves, sending commands, and successfully reading the resulting output back on Windows? (cc @jhasse, looks like you also use Rust, do you know the answer to this?) We can't be the only ones gnashing teeth about this. What about the non-libuv languages, Python, Ruby, Perl? Do they not use named pipes? Are their default Windows implementations built with Visual Studio and using a less-broken .NET version of named pipes (presumably PowerShell is also not this broken)? |
it's pretty rare to have a program that demands as much of it's process spawn system as Julia. despite having roughly the same backend as node, Keno and I significantly patched the spawn code about a year ago to fix a number of libuv bugs which they haven't fully noticed yet (aside from our pull request to incorporate it back into the trunk). and it's actually pretty trivial to spawn yourself, send commands, and read the result back, if you have full control of both ends of the pipe (because it's easy to use only the API's that work). it's also trivial to use process-blocking I/O (since the guarantee of synchronous operation only breaks if there happens to be a call to CancelIo). those are very boring situations, however. But Julia has tests for lots of boundary cases, and the set of @Keno yes, I'm attempting a version with CancelRead |
Three cheers for @vtjnash, don't say "too hard to fix" around this guy. Or maybe do. It's not 100% fixed yet, but I have a feeling it's most of the way there. The newer two blocks in the repl test, having to do with control characters and history issues, are still freezing. The first block is freezing at
(this was running the test from cmd - it seems okay inside mintty, unless I run the tests with In 64 bit, from cmd, it looks a little different:
|
@tkelman Sorry, I don't know enough about Rust. |
@tkelman please delete your sys.dll file before posting backtraces @Keno, can you code review this. I'm wondering if I need to check edit: I see the problem: in uv_pipe_cleanup, we delete the mutex, but in uv_pipe_zero_readfile_thread_proc we need to reaquire that mutex to ensure we don't delete the thread handle too early. We need to delay the final deletion of this mutex until |
@vtjnash whoops, sorry, forgot about that. backtraces don't look any different here without sys.dll. |
Very nice, JuliaLang/libuv@88b6ceb fixed the access violations. Still have to figure out the other 2 freezes. |
Here are the 2 freezing cases, unfolded a bit to determine exactly which line freezes: In both cases it's a write command to a fake REPL. @Keno should this be able to work on Windows? |
those examples share a common trait that they are made with but also: stdin_read,stdin_write = (Base.Pipe(C_NULL), Base.Pipe(C_NULL));
Base.link_pipe(stdin_read,true,stdin_write,true);
write(stdin_write,"hi")
#= Julia completely frozen =# cause unknown, but we appear to be stuck in a (supposedly) non-blocking syscall to the window's API function GetQueuedCompletionStatusEx (which we called to determine if there is anything that is ready for us to do without blocking...) |
oh, well, i guess the cause wasn't actually /that/ unknown |
ping @ihnorton I think we need to force a libuv rebuild for the Win32 nightlies |
Done. |
not to be a pain, but I just bumped the libuv version again :P |
Done again. |
These freeze otherwise, the fix in libuv for #7082 does not work on XP
repl tests freeze otherwise, the fix in libuv for #7082 does not work on XP dllist tests also fail on xp since oddly Libdl.dllist() is only listing file names, not full absolute paths udp recvfrom tests give ERROR: LoadError: bind: address family not supported (EAFNOSUPPORT)
repl tests freeze otherwise, the fix in libuv for #7082 does not work on XP dllist tests also fail on xp since oddly Libdl.dllist() is only listing file names, not full absolute paths udp recvfrom tests give ERROR: LoadError: bind: address family not supported (EAFNOSUPPORT)
repl tests freeze otherwise, the fix in libuv for JuliaLang#7082 does not work on XP dllist tests also fail on xp since oddly Libdl.dllist() is only listing file names, not full absolute paths udp recvfrom tests give ERROR: LoadError: bind: address family not supported (EAFNOSUPPORT)
repl tests freeze otherwise, the fix in libuv for JuliaLang#7082 does not work on XP dllist tests also fail on xp since oddly Libdl.dllist() is only listing file names, not full absolute paths udp recvfrom tests give ERROR: LoadError: bind: address family not supported (EAFNOSUPPORT)
test/repl.jl
was added in #6955, most of the file is@unix_only
at the moment except a few lines at the very end. These lines are freezing for me on Windows, but they're using process commands that you'd think should work.This last command never exits, I have to manually kill the julia process(es).
The text was updated successfully, but these errors were encountered: