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
Race condition in SIGWINCH handling #424
Comments
Any progress on this issue? |
I'm running into this with Konsole when using split views. Whenever I change focus between the views, Konsole performs two window-size changes in rapid succession.
Vim often loses the second resize, and attempts to draw the screen too big, resulting in terminal corruption shortly thereafter. Edit: Actually, I think my issue is a separate bug where handle_resize() gets called recursively, which returns without doing any work because set_shellsize is busy. The select() race would cause a delay in performing the resize, but it shouldn't cause the resize event to be forgotten entirely. |
Problem: Second SIGWINCH signal may be ignored. Solution: When set_shellsize() is busy when called then run the inner code again when it's done. (issue #424)
Please try out with patch 9.0.0923 and see if this problem no longer occurs. |
vim catches SIGWINCH and sets a resize flag. However, vim uses select(), rather than pselect() or ppoll(), so another SIGWINCH could happen again while vim handles the first resize. As a result, if two quick resizes with SIGWINCHes occur in a row, vim may not notice the second size change, and may remain at the first size.
vim should block SIGWINCH, and use pselect() or ppoll() to atomically unblock it while waiting for an event.
This came up in the context of https://bugzilla.gnome.org/show_bug.cgi?id=731137 in gnome-terminal.
The text was updated successfully, but these errors were encountered: