-
-
Notifications
You must be signed in to change notification settings - Fork 684
MacVim occasionally stops rendering text after sleep #1164
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
Comments
Can you try running with a clean vimrc (by doing Also, if you say resize the window, would it have fixed the problem? |
Settings:
I'll try starting with mvim --clean next time the problem occurs. |
Problem recurred just now, I tried opening a new window with 'mvim --clean' but see the same problem in that new window. The geometry is different (230x56 instead of my default 120x56) and the color scheme is a bit different, but it has the same problem as a window opened with just 'mvim'. This time I waited for a while rather than restarting MacVim or detaching/reattaching the external display. The problem went away on its own after about 5 minutes, although at first it only rendered the top line of each file. Additional lines appeared as I moved the cursor up or down to each line... |
Huh that's annoying… @schveiguy can you also post your result of Also, for both @schveiguy and @mattooca , do your monitors support retina display? Or do you switch between retina and non-retina? I'm mostly just grasping at straws here since I can't seem to repro the issue. |
I'm seeing the same problem. I'm running MacVim 8.2.2164 (169) on macOS 10.15.7.
It occurs without sleeping. It persists for several minutes, and running ':redraw!' does not fix it. But after five-ish minutes, the line under the cursor suddenly becomes visible again, and ':redraw!' then brings the whole screen back. |
It might be a good grasp. Nearly all my time I spend on my 4k attached monitor instead of my retina screen. If I had to guess, I'd say it happens mostly on my 4k screen, and it might be 100% of the time, I'm not sure. I just spent about 5 days where I didn't have my screen, just the retina display of my macbook, and I didn't have the problem happen, but that's not really a meaningful detail, as it doesn't happen with any specific regularity. My font is Menlo 14 point. Here is the result of that defaults command:
|
I did just notice that Macvim supports dark mode, I was on the "evening" setting for colors, because it wasn't available when I started using dark mode. I just switched back to the default scheme, and maybe this will make a difference? Edit: eh, I went back. The blue that is used for the tildes at the bottom for the default scheme is hard on the eyes. |
The default MacVim color scheme never got updated for dark mode and doesn't work well under it. I need to fix it… Anyway that's a different issue. |
Regarding monitors, this is happening on a Macbook Pro with Retina display, but I usually have it attached to one or two lower-resolution external displays. The problem is happening right now, I tried dragging MacVim windows to different monitors but it makes no difference. |
I'm still struggling to repro this (even with an external 4K monitor), but if you see this again, try to change the font / font size. You could just do that by doing Also, if changing font/font size does indeed solve the issue, let me know as that would confirm what I think is going wrong. |
@mattooca can you clarify what you meant by this?
Are you saying that you saw that all of MacVim lost text rendering, then you opened a new window (either by Cmd-N or using the menu)? Or are you saying you already had a new window opened with text working, and then it lost its text rendering? |
I opened up a new window with command-N after noticing the problem, and
that new window had the same problem.
By the way, next time the problem occurs I'll try your suggestion of
changing the font size. The issue didn't occur today.
…On Thu, Feb 11, 2021, 8:14 PM Yee Cheng Chin ***@***.***> wrote:
@mattooca <https://github.com/mattooca> can you clarify what you meant by
this?
Attached image shows a new MacVim window opened up after the issue starts.
The only visible text is up on the title bar, the VIM splash screen doesn't
show up.
Are you saying that you saw that all of MacVim lost text rendering, *then*
you opened a new window (either by Cmd-N or using the menu)? Or are you
saying you already had a new window opened with text working, and then it
lost its text rendering?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1164 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABLBAL5XVTSTSTXXDVQUXEDS6STKJANCNFSM4V6KFQAA>
.
|
The problem recurred this morning, and I tried a few things. However, disconnecting the external display did fix the problem. Text showed up again on all open windows almost immediately. The text stayed visible when I then reconnected to the external display, at least so far (I tried disconnecting about 10 minutes ago). |
Oh… ok 😢. This is a little different from what I thought, but will help me prevent digging into a rabbit hole. Since I have trouble reproducing it, let me think about what to do over the weekend to see how this can be debugged and fixed. |
Also having this issue, but disconnecting my external monitor did not correct the problem. Waiting several minutes did. MacVim 8.2.2164
|
I will add that not all open windows are affected equally. I can have a window open that is displaying text and open a new window and have no text. |
More info: It just happened again. I was on a second desktop in this case, and I swiped back to the first desktop to report. Instantly, when I went back to the other desktop, it was working again. |
Happening again right now, this time swiping between desktops is not clearing the problem. Changing the font size does not clear the problem. When I moved the window from my 4k display to the retina display, it redrew the window completely and all text is now gone (except the highlights). |
It's still in a bad state if you want me to try anything else. |
@schveiguy Can you try to capture the system logs from MacVim? You could either use Console.app to get it, or just use the terminal and do The wiki for this (https://github.com/macvim-dev/macvim/wiki/Debugging) is a little outdated, but you may also want to do this step first by doing:
After we are done debugging you probably want to set it back to default logging level:
Thanks a lot for the help in debugging. |
OK, so my mac went to sleep. I came back to do these steps. I first logged in, and saw that it in fact was still in the bad state. So I ran the log command. Then I ran the defaults command, and switched back to my macvim window and it's now recovering (the text is coming back on lines that I put my cursor on). I took a second log dump. The newest logs after I did the defaults happened at 16:38:11. Attached is the log file. Should I leave the MMLogLevel at 7 for when this happens again? |
Yeah maybe leave it at that level for now if you could. It's just going to generate a little more logging but the logs you captured didn't provide quite enough info, so it would be nice to see if we could get more info from this. I'm trying different ways to see if I could replicate this. |
Happened again just now. And here is the weird thing. I was not even using MacVim, I was running a build in another window. And my eyes happen to notice a change on the MacVim window, where the text just disappeared. I have the logging level set to 7, let me know if you want me to try anything. |
And, it's now working again. Here is the last 30m of logs that happened during that time: |
Happened again, recovered again quickly. Logs: |
And again, it's happening a lot more today than usual. But it's also clearing up quickly too. This time I moved it to my retina screen, it got blanked, then I moved it back to my 4k screen, and it started working again. |
Unfortunately those logs do not have debug info on them. I think you need to somehow trigger the debug logging to be on per the steps in https://developer.apple.com/documentation/os/logging/customizing_logging_behavior_while_debugging?language=objc or something, but from local testing, seems like just having Console.app running would turn on debug logging as well. I think next time if you could, maybe have Console.app running in the background? But now I feel like we are just piling on more work for you to do. Currently the CoreText renderer doesn't have a lot of logging anyway, so I think I'll push an update out soon (last update was in 2020…) and call this out as a known issue, while adding more logging in suspicious points in the renderer so we will get better signal to noise ration in the logging and debugging effort. Also pinging @s4y to see if he encountered anything like this when implementing the current renderer (tldr: under certain situations such as waking from sleep or unplugging monitors, all texts stop rendering but other parts still draw) |
I wanted to note: I've seen this issue when no changes in hardware occur at all. Occasionally all the text just disappears. Sometimes it seems to come back after a few minutes or after fiddling with some display settings inside MacVim, but sometimes it does not. I may need to log a different issue, but I have consistently been able to get MacVim to crash. If I convert to HEX, and then convert back (from the Tools menu), and then switch to a different Dark Mode selection, MacVim crashes every time. I thought this was related to the disappearing text issue, but out of curiosity I just repeated the steps without that issue present, and it still crashed. |
Ok, I finally got the issue once on MBA 2015, after copy-pasting via Cmd-A, Cmd-C, Cmd-V. No external monitors or sleeping. But… just once |
Only quitting the app helped me. New window does not. Vim itself isn't broken, so I successfully saved my data. |
Ok. So, I just pushed release 170 out. It contains some extra logging that should help identify the issue. It does require debugging logging on for maximum logging, so interested parties, if you could turn on debug logging and capture logs again I would appreciate it, thanks. |
I had this problem with build 170. Resizing doesn't fix the issue, but if I go to dark mode and go back to normal a resize makes the text to re-appear. |
I've had this happen to me a couple of times over the last week, with build 169. I'm on an 2017 15" MacBook Pro, with an external monitor, running a current version of Catalina. Resizing and changing the fonts hasn't helped me. |
If any of you see this issue again, do you mind following the instructions at #1164 (comment) to capture logs and upload here? r170 contained more logging capability and it would be very useful, thanks. |
I ran into this this morning. Here are my logs from the last few hours: https://gist.github.com/stevematney/a694694e43f36c07b992c33929a697fc |
@stevematney If you don't mind, do you mind enabling debug logging by doing the following? The drawback is just slightly more logging from MacVim, and debug logging are all logged to an OS memory buffer so it shouldn't use more disk space.
You can revert the debug logging by doing this:
I'm now wondering if I should have just made these logging non-debug-only… |
An update: First, I don't have logs to attach, sorry. :-( I run on a MBP 13" 2019 model (8GB, quad core i5 1.4GHz), no external monitor. I just unlocked the screen saver, switched to MacVim, and watched the line under the cursor disappear, although the remainder of the text was visible. When I moved the cursor up a line, that line also disappeared. A ':redraw' made all the text disappear, though the 'misspelling carats' remained visible. After about five minutes (trying switching to full screen, decreasing and increasing the font size, and minimizing/restoring the window to no avail), the line under the cursor became visible. An interesting point: Even though text wrapping was enabled, and I was on the second line of a two line paragraph, only the "screen row" of text disappeared, and when it came back, only the screen row came back (until I did a ':redraw'). So it appears to be related to rows of text, rather than paragraphs/logical lines of text. |
Just encountered this, again, in build 170. Symptoms were similar to what timothy-knox described...
|
I'm running build 170 on an M1 MacBook Air and this issue happens for me multiple times a day. MacVim seems to be fine when my computer wakes up from sleep but an hour or 2 later, text starts disappearing from the screen as I click on the text or as I use the up and down keys to scroll past the text. Logs attached. defaults read org.vim.MacVim | grep MM |
I can trigger this immediately by simulating memory pressure: sudo memory_pressure -S -l critical -s 60 …so I suspect something is getting kicked out of a cache. Investigating but don't have any solid leads yet. |
When there's memory pressure, the cache just drops the line immediately. Fixes macvim-dev#1164.
I'm sorry for the delay in getting to this, all. The linked pull request should fix it. |
That's a nice trick! I'll keep that in mind next time. Also, thanks for looking into this. |
Ok this should be fixed! Thanks for the PR. Played around with it with the memory_pressure tool and confirmed the behavior and also that it's fixed. One of those things that if we switched to ARC instead of reference counting we may have avoided this bug :/ (but then this is a CoreFoundation object, so maybe there may still be chances to have screwed this up due to how you need to specify how the bridging works) |
@ychin This was making me think about ARC, too. I have some interest in investigating it; is there any history around talking about/trying to switch to ARC? |
@s4y I think there is a lack of history of trying to switch to ARC :). But no I don't know what the history is. I think we just never looked into it, and since MacVim tends to follow the Vim philosophy of backwards compatibility, it takes a while before we are ahead enough to be able to say "we can support ARC" without breaking backwards compatibility. Also, it's just not the kind of thing that brings immediate improvements, even though it does help prevent random memory leaks and potential retain bugs like this one. I'm not really opposed to switching over. I was hoping to take a look at some point in the future, but if you want to investigate it that's totally fine. FWIW the new tabs PR (#1120) is using ARC, and I explicitly OKed it. No point in making a new project that uses manual reference counting. |
FYI I recently updated to Big Sur and haven't seen this problem since (still on build 170). But it seems I probably won't see it again, thanks for all the support! |
I am still seeing this problem on MacOS Catalina (10.15.7) with retina display and an external monitor. My MacVim is Custom Version 8.2.2576 (170). MacVim seems to render everything correctly when I start it up, but after it has been running for a while, any new windows (e.g., when trying to edit a file from the command line using mvim) pop up with no visible text anywhere. The only way to fix the problem is to quit MacVim and start it again. Please let me know if I can provide any other information. |
@ekortright Note that this was committed just a week ago and snapshot 170 is 3 weeks old. |
Yeah I need to push an update with this fix. Will try to do tonight. Trying to go over other changes that went in and make sure they are ok. |
Updated to Vim 8.2.2681. This is a small update mostly containing a fix to rendering bug in Core Text renderer. Fixes ==================== - Fixed a rendering issue where MacVim would stop drawing text when the computer is running low on memory. Previously the user would have to restart MacVim in order to get the rendering back. #1164 Compatibility ==================== Requires macOS 10.9 or above. Script interfaces have compatibility with these versions: - Lua 5.4 - Perl 5.18 - Python2 2.7 - Python3 3.9 - Ruby 3.0
The update has been pushed so if you get the latest version it should be good now. |
I've been experiencing issue #1068 (where syntax highlighting turns off in existing MacVim windows when computer wakes from sleep). I also recently noticed a new issue where all text occasionally disappears in all open MacVim windows. I think the trigger is either waking the laptop from sleep or attaching / detaching external displays.
The problem occurs every two days or so, and impacts both windows that were already open and any new windows opened after. I can resolve the problem by quitting and restarting MacVim, but I often have many open windows so prefer to find a fix.
I'm currently using MacVim 8.2.2164 (169), running on OS X 10.15.7. I think this issue first appeared after the previous MacVim update (I tried updating when I first noticed the problem to see if it would resolve the issue, but no luck).
Attached image shows a new MacVim window opened up after the issue starts. The only visible text is up on the title bar, the VIM splash screen doesn't show up.
The text was updated successfully, but these errors were encountered: