-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
0.26.1 i386 deb package completely broke the compiler #6624
Comments
@stronny I am checking the installer using a vagrant xenial 32 bits and I was able to run the installer as documented here without troubles.
|
My setup is a debian stable virtualbox guest. I've just noticed that the bug is reproduced only as a particular user, but not as another one. I think it has to do with fd reopening in the update, here's the tail of an strace:
Do you need any additional details from me to narrow down the fault? |
@stronny since you are using a vagrant machine and it happens with certain user but not all it would be create to have steps to reproduce the issues consistently. From there it will be easier to narrow the cause. Otherwise we would need to guess in the dark what are the difference between these two users. |
I'm not using a vagrant machine though. Comparing straces I can point to this: This is a normal run:
This is a faulty one:
I think there is a lack of an error check somewhere and an error sentinel of |
Like in 2530bb6#diff-97b852ed0df274031d263857a85db195R30 maybe? |
Oof, ok. Checking the error is one thing, but what to do after a failure. |
@Timbus no, just act as if |
So the problem is that the second user (the one that's failing) runs under I don't think I've seen any problems with this fairly standard setup with any other nonblocking IO, so either I'm just ignorant of other programs that can't use read_nonblock(), or perhaps they do something differently? |
The problem is that there is no such thing as So, in order for crystal to read a handle without blocking, you need to set the handle into nonblocking mode. This would be fine except it is the same handle as the current interactive terminal's handle, and setting nonblock on it will force anything else sharing the handle to perform nonblocking reads (this includes the shell, piped/sibling processes, and forked subprocesses). So yes, it can be done differently without reopening the TTY. It just breaks many other things. Perhaps in the future there may be a threaded fallback mode or something, but for now it just goes back to blocking on a TTY read. |
Just a quick clarification if I may. IIUC what you are doing is something like 1) new_fd = reopen(STDIN); 2) set_nonblock(new_fd) which makes perfect sense, except what is done is fcntl(char_device), which is not a handle, it's a device file itself. So what's the point of reopening the tty if at the end you operate on the same tty? If your goal is to set nonblocking mode separately for this process, how is it achieved by mutating global state? Edit: I'm wrong, fcntl indeed accepts an fd, not a device. Please disregard the above comment. |
Another thing I wanted to ask. It seems that Crystal doesn't reopen the tty, it just opens 3 new fds, and leaves the old ones hanging. Is that intentional behaviour? I've checked with this:
which gives me:
|
Fix PR was merged. |
as a side note, maybe add a description to the package?
The text was updated successfully, but these errors were encountered: