Paul Ackersviller wrote:
> > > With athena gui version on AIX, vim will consistently go into an
> > > infinite loop if the network connection drops. Trussing such a process
> > > points to a select system call, so I found this one without any check on
> > > the return value. This patch mostly prevents the problem, although
> > > not quite 100% of the time.
> > >
> > > My EINTR check is just what I'm guessing some other OSes might need, it
> > > doesn't seem to matter for AIX. In fact the error-handling I'm doing
> > > below doesn't seem to matter either, as I can't get it to execute, nor
> > > can I stop there in a debugger, but the check seems enough for exiting
> > > the process via somewhere in X libraries.
> >
> > It looks like this code depends on undocumented or system-specific
> > behavior. At least for what I could find poll() and select() called
> > with no file descriptors will always wait until the timeout and then
> > return zero. Do you have documentation about when the error code would
> > be returned?
>
> I can pass on man pages if you want to know possible errno values, but
> that won't help with EINTR, as no OSes I use have that behaviour. I put
> that check in only to mimic how vim is already handling select() errors
> elsewhere, i.e. in RealWaitForChar() also in os_unix.c, as well as
> can_write_buf_line() in the channel.c file.
Not errno values, but just why it would return an error at all. It's
documented that select() without any file descriptors can be used to
wait with sub-second accuracy, for systems that don't have usleep(). But
nowhere does it say it returns any error.
> > Also, I don't see how a hang can occur here when poll() or select()
> > returns without waiting. Vim would simply continue. Or is the delay
> > critical in some situation?
>
> Yes, continues infinitely, which is the issue... chewing up 100% of a CPU
> until killed. Not sure how you got th idea of a hang.
Where does it loop then? The place where you have the change doesn't
loop, it returns.
--
All good vision statements are created by groups of people with bloated
bladders who would rather be doing anything else.
(Scott Adams - The Dilbert principle)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/201910290203.x9T23h7A012679%40masaka.moolenaar.net.