RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1523007 - Vim distorts graphics with dual monitors
Summary: Vim distorts graphics with dual monitors
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gnome-terminal
Version: 7.3
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Debarshi Ray
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-07 01:18 UTC by junk
Modified: 2020-02-18 18:27 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-18 18:27:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Picture of distortment (639.46 KB, image/png)
2017-12-08 20:26 UTC, junk
no flags Details

Description junk 2017-12-07 01:18:45 UTC
Description of problem:

When dual monitors are present (using an extended format) and two separate terminals are running, one on each monitor, and when vim is running on one terminal, the graphics of the other monitor get distorted, rendering the screen unreadable. If the screen is clicked on, the graphics restore to normal and the other monitor shows distorted graphics. This can be repeated any number of times. Only solution that seems to work to fix the graphics on both screens is to quit vim. The issue occurs about 40% of the time. Vim is usually running across ssh from a CentOS machine, though it occurs locally, too.


Version-Release number of selected component (if applicable):

Red Hat Enterprise Linux Server 7.3

VIM 7.4.160

CentOS 7.4

How reproducible:

40% of the time.

Steps to Reproduce:
1. Have dual monitors in extended mode (mine use a Lenovo dual displayport adapter.
2. Run terminals on each of the monitors.
3. Open vim in at least one of the terminals.
4. Observe graphical distortion. If not present, may need to try again, or run vim in both terminals, or run vim across ssh.

Actual results:

Graphical distortion (totally white screen, green screen, data printed several times, diagonal white lines, etc.)

Expected results:

Normal graphics.

Additional info:

Comment 2 junk 2017-12-07 18:05:39 UTC
I should also mention that tmux is running on both terminals.

Comment 3 junk 2017-12-08 20:26:26 UTC
Created attachment 1365032 [details]
Picture of distortment

Here is one example of a common distortment.

Comment 4 junk 2017-12-08 20:28:25 UTC
That was actually outside of vim, I had just entered ls, I think this issue occurs when the terminal is trying to load a lot of text.

Comment 5 junk 2017-12-08 20:29:03 UTC
(In reply to junk from comment #4)
> That was actually outside of vim, I had just entered ls, I think this issue
> occurs when the terminal/tmux is trying to load a lot of text.

Comment 6 Egmont Koblinger 2017-12-12 13:39:06 UTC
Hi,

I've never seen anything like this.

There are two different bugs in the screenshot.

One is all those diagonal lines of exactly the same gray-ish (but not exactly gray) color as the text ("threadxxx.bad" filenames). They are way too pixelated (non-antialiased) for erroneously drawn lines, they much more look like the pixels of the filenames scattered around.

The other one is text overlapping with other text, this shouldn't be possible. The two gnome-terminal windows aren't exactly aligned vertically, right right one is 1px above. But the overlapping texts are perfectly aligned. So it's not a see-through from the other window (unless there's a third window behind this one).

I'm uncertain about the bottom line of the right terminal window: Is that just text painted with a color so similar to the background, or is that also buggy? Is it supposed to be there (e.g. status line of tmux) or not?

You mentioned other weird behavior, e.g. green screen as well.

I don't think these are two (or even more) independent bugs, that would be such an unlikely coincidence. I suspect that these are symptoms of a common cause.

tmux, vim, ssh etc. cannot be the cause of the issue, they have no means of asking the terminal emulator to paint what's seen here. They just trigger the issue.

My suspects are:

- cairo, when should give us an empty surface to paint on, somehow erroneously leaves the previous contents there or even mangles it. (I'm not really familiar with these bits of painting, so I might not use the proper terms.)

- video driver / GPU problem (I don't know whether/how cairo uses the video card to do its drawing/computations; or if not then maybe CPU issue)

- RAM problem

- the transparency patch could also be relevant.

Is gnome-terminal the only application where you expect weird behavior? Anything like apps crashing frequently, display glitches elsewhere, overclocking, overheating?

What happens when you highlight some problematic area with the mouse? Is it correctly repainted then?

Comment 7 Egmont Koblinger 2017-12-12 13:43:24 UTC
(typo) Is gnome-terminal the only application where you experience weird behavior?

Comment 8 junk 2017-12-12 17:12:44 UTC
Hi, thanks for your help! I have been rather mystified by this issue as well.

There are only those two terminal screens, not a third one beneath. 

That bottom line should be there as the tmux status bar, but it is distorted (I think, I can't open the picture on my phone, so if it is a green, readable bar on the bottom it is correct, otherwise it is distorted).

Yes, gnome-terminal is the only application I have experienced this issue with, though I have not tried other terminal emulators. I have no issue with apps crashing at all, no glitches except in gnome-terminal, I'm not overclocking, nor experiencing overheating. 

Whwn you highlight the problem area with the mouse, it does redraw the area correctly. In fact, when I click on one terminal window and make it the active window, it usually redraws correctly (though not always, but it always does when I highlight the text). And like I mentioned earlier, if I have the two terminal windows up, if I get distortion in one and click on the distorted window, it usually clears up and the other window becomes distorted. I can then click on the other, now distorted window, it becomes not distorted and the other window goes back to being distorted. And I can usually do this ad infinitum.

This is a brand new machine and I used it for about a month with a single monitor and never saw any graphical issues, but after switching to two monitors for about a month, I am seeing these issues. So I don't know if it is related to dual monitors or the display adapter I am using, or if the issue simply wasn't presenting itself earlier.

Thanks again for your help,
Oliver

Comment 9 junk 2017-12-12 18:50:59 UTC
I can confirm now that sometimes it is obvious that one terminal screen is being partially drawn on the other terminal screen. I saw some text that was only on one screen appearing on the other screen, in a distorted fashion. When I clicked back and forth, sometimes the screen would obviously have the other text on it, sometimes it would have green or grey stripes.

Comment 10 Egmont Koblinger 2017-12-12 20:11:49 UTC
> That bottom line [...] so if it is a green, readable bar on the bottom it is
> correct, otherwise it is distorted

It is distorted, then.

> In fact, when I click on one terminal window and make it the active window,
> it usually redraws correctly (though not always, but it always does when I
> highlight the text).

VTE redraws its contents on focus in/out. Not exactly sure why, probably to provide some workaround for these kinds of situations.

Your experiences show that probably the bug arises when there's a lot to repaint at once.

When the contents don't get repaired, does it stay at more or less the same corruption, or does it get something brand new (e.g. diagonally lines appearing randomly somewhere else)?

What you could do and share the results with us (not sure if it would help, though) is to highlight different amounts of text with your mouse, and then click somewhere to deselect. I assume that if you highlight a small area only, upon deselecting it'll usually be repainted correctly. As you highlight bigger and bigger areas, up to (almost) the entire visible part, I assume that upon deselecting the chance of corruption will noticeably increase.

_If_ the corruption (e.g. diagonal lines) always appears at the same place, it would be nice to see what happens usually if you highlight a smaller area within the corruption and then deselect, and what happens usually if you highlight a slightly larger area encapsulating the entire corrupted region and then deselect.

> I can confirm now that sometimes it is obvious that one terminal screen
> is being partially drawn on the other terminal screen.

Hmmm, weird. All terminal windows of gnome-terminal are handled by a single gnome-terminal-server process, and we can't fully exclude the possibility of some data or context not being properly separated (it would be truly surprising though).

Could you please instead run separate gnome-terminal-server for each window you have? You can find instructions at https://wiki.gnome.org/Apps/Terminal/Debugging (omit the gdb bits), or use this tiny script which I use myself for debugging purposes:

#!/bin/bash
/usr/libexec/gnome-terminal-server --app-id a.b$$ "$@" &
sleep 0.2
/usr/bin/gnome-terminal --app-id a.b$$ "$@"

Is the bug reproducible in this setup? Do you still get to see contents from another terminal?


What desktop environment are you running? Looks gnome2-y, but I can't find gnome2 or mate packages in centos 7.4's package listing. I might be wrong though. (On a side note, I'm not affiliated with Red Hat, Fedora or CentOS in any way.)

Let me link two bugs that might have a slim chance of being relevant (but I don't think they are):

https://bugzilla.xfce.org/show_bug.cgi?id=14079: output stalling on non-compositing window managers in xfce4-terminal.

https://bugzilla.gnome.org/show_bug.cgi?id=721761 comments 47-49: a drawing glitch that almost made in to VTE the other day.

I'm really puzzled by this issue, and even though I'm curious to hear the responses, I'm truly afraid I won't be able to move forward. I still primarly suspect some lower level (X11, video driver, CPU/GPU) component.

Comment 11 Egmont Koblinger 2017-12-12 20:28:12 UTC
You mentioned RHEL 7.3 and CentOS 7.4 too, how is that exactly? Wait, if I understand you correctly then CentOS is over ssh, it's irrelevant then. Locally it's a RHEL 7.3, right?

What's the version of gnome-terminal and vte (package vte291, or echo $VTE_VERSION)?

Just for the record: VTE is the terminal emulation widget behind gnome-terminal (and many other apps).

What I would do next if I were sitting in front of that computer: search around on the Internet to figure out how to disable hardware graphics acceleration and give that a try. And/or install a (potentially 3rd party) video driver specifically suited for your video card. Or if it's done then uninstall it :-) If it's a computer with two video cards (which is quite usual on laptops, maybe even desktops nowadays, I don't know) I would try switching to the other one.

For future reference, it would be great if you could share these technical parameters of your computer (video card etc.).

Also, if you can afford (i.e. don't need the computer running nonstop), I'd run memtest86 overnight.

But again, I cannot promise these will take us any closer to a solution.

Comment 12 junk 2017-12-20 01:06:09 UTC
Yes, it is running RHEL 7.3 locally. gnome-terminal is version 3.14.3 and vte is version 3804. I will look into the hardware graphics acceleration and see if that works. I only have a single video card, an NVIDIA Corporation GM107GL [Quadro K620] (rev a2). I will look into your suggestions and see if any help. Thanks for your continued help. I haven't been able to post any more screenshots, due to this being a work computer and of course the screen only seems to be distorted when it's displaying non-Internet appropriate material.

Comment 13 Debarshi Ray 2020-02-11 17:28:46 UTC
Are you still experiencing this problem?

Do you see this bug if you don't use the two monitors in an extended format - I see that GNOME Shell's top and bottom bars are single continuous entities? What if you decouple the two monitors with one being the primary and the other being secondary? I am asking because this extended set-up that you have isn't so common and bugs might be lurking in the associated code paths.

You mentioned that you have a NVIDIA card. Are you using the proprietary NVIDIA driver or Nouveau?

You mentioned that you can make the glitches go back and forth across the windows by clicking on them. What if one of those windows wasn't a GNOME Terminal window? Are you still able to reproduce the bug in that case?

Were you able to run memtest86?

Comment 14 junk 2020-02-18 04:35:51 UTC
Hi Debarshi,

I appreciate you taking a look at this issue, but unfortunately, that issue was on a work computer for a company that I no longer work for. So as far as I am concerned, you can close this bug (although I certainly experienced it everyday with that setup).

I don't recall if the bug occurred with decoupled monitors and I believe I was using the proprietary NVIDIA driver. I also can't remember if different programs besides GNOME Terminal exhibited this behavior. I primarily used GNOME Terminal on that machine. I also did not run memtest86.

I apologize not being able to give better answers, but 2 years is a while to keep the behavior of a bug in one's head (: 

Thanks,
Oliver

Comment 15 Debarshi Ray 2020-02-18 18:27:56 UTC
No need to apologize at all! Thanks for staying engaged for so long. Much appreciated.

I wish we could have fixed it in time.


Note You need to log in before you can comment on or make changes to this bug.