Sometimes a black rectangle appears briefly under the mouse cursor

Bug #1585329 reported by Bruno Nova
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

I'm on 16.04, using a laptop with Nvidia Optimus (Nvidia driver installed, Intel card selected).
The problem also occurs in a guest session.
It didn't occur in 14.04.

Sometimes I see a black rectangle appear for a very brief moment (a flash).
Horizontally, the rectangle occupies the whole screen.
Vertically, the rectangle seems to start in the mouse cursor and ends in the bottom of the screen.

The easiest way to reproduce the bug is to open a Gnome terminal, move the mouse cursor inside the window and press Alt+Backspace repeatedly.

WORKAROUND: Switch to the nvidia card.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: compiz 1:0.9.12.2+16.04.20160415-0ubuntu1
ProcVersionSignature: Ubuntu 4.4.0-22.40-generic 4.4.8
Uname: Linux 4.4.0-22-generic x86_64
.tmp.unity_support_test.0:

ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
CompizPlugins: [core,composite,opengl,compiztoolbox,decor,vpswitch,snap,mousepoll,resize,place,move,wall,grid,regex,imgpng,session,gnomecompat,animation,fade,staticswitcher,workarounds,scale,expo,ezoom,dbus]
CompositorRunning: compiz
CompositorUnredirectDriverBlacklist: '(nouveau|Intel).*Mesa 8.0'
CompositorUnredirectFSW: true
CurrentDesktop: Unity
Date: Tue May 24 19:44:19 2016
DistUpgraded: Fresh install
DistroCodename: xenial
DistroVariant: ubuntu
EcryptfsInUse: Yes
GraphicsCard:
 Intel Corporation Core Processor Integrated Graphics Controller [8086:0046] (rev 02) (prog-if 00 [VGA controller])
   Subsystem: Acer Incorporated [ALI] Core Processor Integrated Graphics Controller [1025:0488]
 NVIDIA Corporation GF108M [GeForce GT 420M] [10de:0df1] (rev ff) (prog-if ff)
GsettingsChanges:
 b'org.compiz.core' b'outputs' b"['1366x768+0+0']"
 b'org.compiz.core' b'hsize' b'2'
 b'org.compiz.core' b'active-plugins' b"['core', 'composite', 'opengl', 'compiztoolbox', 'imgpng', 'snap', 'titleinfo', 'grid', 'vpswitch', 'move', 'regex', 'copytex', 'place', 'mousepoll', 'session', 'commands', 'wall', 'resize', 'winrules', 'dbus', 'unitymtgrabhandles', 'animation', 'expo', 'ezoom', 'fade', 'workarounds', 'scale', 'unityshell']"
 b'org.compiz.core' b'vsize' b'2'
 b'org.compiz.core' b'focus-prevention-level' b'0'
InstallationDate: Installed on 2016-04-25 (28 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
Lsusb:
 Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
 Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 001 Device 003: ID 064e:a219 Suyin Corp. 1.3M WebCam (notebook emachines E730, Acer sub-brand)
 Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
MachineType: Acer Aspire 5742G
PackageArchitecture: all
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-4.4.0-22-generic root=UUID=68a53fa4-4cfc-45bc-84de-762947ea37e1 ro locale=pt_PT quiet splash
SourcePackage: compiz
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 08/13/2012
dmi.bios.vendor: Acer
dmi.bios.version: V1.30
dmi.board.asset.tag: Base Board Asset Tag
dmi.board.name: Aspire 5742G
dmi.board.vendor: Acer
dmi.board.version: V1.30
dmi.chassis.type: 10
dmi.chassis.vendor: Acer
dmi.chassis.version: V1.30
dmi.modalias: dmi:bvnAcer:bvrV1.30:bd08/13/2012:svnAcer:pnAspire5742G:pvrV1.30:rvnAcer:rnAspire5742G:rvrV1.30:cvnAcer:ct10:cvrV1.30:
dmi.product.name: Aspire 5742G
dmi.product.version: V1.30
dmi.sys.vendor: Acer
version.compiz: compiz 1:0.9.12.2+16.04.20160415-0ubuntu1
version.ia32-libs: ia32-libs N/A
version.libdrm2: libdrm2 2.4.67-1
version.libgl1-mesa-dri: libgl1-mesa-dri 11.2.0-1ubuntu2
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 11.2.0-1ubuntu2
version.xserver-xorg-core: xserver-xorg-core 2:1.18.3-1ubuntu2
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.10.1-1ubuntu2
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:7.7.0-1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20160325-1ubuntu1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.12-1build2
xserver.bootTime: Tue May 24 19:18:29 2016
xserver.configfile: default
xserver.errors:

xserver.logfile: /var/log/Xorg.0.log
xserver.outputs:
 product id 592
 vendor LGD
xserver.version: 2:1.18.3-1ubuntu2

Revision history for this message
Bruno Nova (brunonova) wrote :
Revision history for this message
Bruno Nova (brunonova) wrote :

This may be an issue specific to Unity, not Compiz.

I tried reproducing the bug (using Gnome Terminal) in Gnome Session Flashback, both with Compiz and Metacity, and I couldn't reproduce it.

Revision history for this message
Bruno Nova (brunonova) wrote :

Another place where I've seen this occur is in Gedit, when moving text using Alt+Arrow keys while the mouse cursor is over the window.

Revision history for this message
Bruno Nova (brunonova) wrote :

Interesting...
This issue doesn't happen if I configure the Unity plugin in CompizConfig both these options in the "General" tab to some other key other than Alt: show_menu_bar, show_hud.

So, is this something related to the menu bar and the HUD?

Revision history for this message
Bruno Nova (brunonova) wrote :

Even more interesting...

I'm developing a small game in SDL.
It runs in a window, hides the cursor, and in every frame moves the cursor to the center of the window.
But if I move the mouse fast enough for the cursor to exit the window, it is shown for a split second and, more importantly, that black rectangle flashes in the screen under the cursor.

So, this graphical glitch occurs when the mouse cursor is shown or hidden!

This bug can be easily reproduced by following these steps:
1. Open a gnome-terminal
2. Move the mouse cursor to inside the window
3. Press and hold any letter in the keyboard, like 'A', to enter that letter repeatedly into the terminal, which will also hide the mouse cursor
4. Start moving the mouse cursor, keeping it inside the window, and the problem will manifest

This issue occurs also in a guest session and a live session (after I disable the phantom 2nd monitor due to NVidia Optimus), so it's not because of any change I made to the system.
And like I said above, I'm using a laptop with Nvidia Optimus (Nvidia driver installed, Intel card selected).

I also just now tried reproducing this bug in GNOME Session Flashback, and I managed to reproduce it both with Compiz and Metacity.
So, this issue isn't neither in Unity nor in Compiz! Maybe in X11.

Could a developer take a look into this issue?
I think there's enough info to go on now.
If you need more info, just ask.

Changed in compiz (Ubuntu):
status: New → Invalid
Changed in unity (Ubuntu):
status: New → Invalid
Revision history for this message
Bruno Nova (brunonova) wrote :

I now switched to the NVidia card, and I couldn't reproduce the bug.
So this may be specific to Intel.

Revision history for this message
penalvch (penalvch) wrote :

Bruno Nova, thank you for reporting this and helping make Ubuntu better.

Would it be possible to obtain a screenshot, video, or screencast of this issue via https://help.ubuntu.com/community/Screencast ?

tags: added: latest-bios-1.30
tags: added: regression-release
no longer affects: compiz (Ubuntu)
no longer affects: unity (Ubuntu)
Changed in xorg-server (Ubuntu):
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Bruno Nova (brunonova) wrote :

Sure Christopher!

A screencast couldn't record the graphical glitches, so I recorded a video with my phone and attached it to this comment.

In the video I have gnome-terminal open.

At the start, I press and hold the 'A' key on the keyboard and move the mouse cursor *inside* the terminal window. The cursor is constantly being hidden and shown, and the graphical glitch is visible.

Then I move the cursor to outside the window. The cursor isn't hidden and the glitch doesn't occur.
Then I move it back to the window.

Bruno Nova (brunonova)
Changed in xorg-server (Ubuntu):
status: Incomplete → New
Revision history for this message
penalvch (penalvch) wrote :

Bruno Nova, to clarify, if you remove the nvidia proprietary driver, is this still reproducible?

description: updated
Changed in xorg-server (Ubuntu):
status: New → Incomplete
Revision history for this message
Bruno Nova (brunonova) wrote :

Yes, after removing the nvidia proprietary driver and replacing it with nouveau I can still reproduce the issue.

Changed in xorg-server (Ubuntu):
status: Incomplete → New
Revision history for this message
penalvch (penalvch) wrote :

Bruno Nova, in order to allow additional upstream developers to examine the issue, at your earliest convenience, could you please test the latest upstream kernel available from http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D ? Please keep in mind the following:
1) The one to test is at the very top line at the top of the page (not the daily folder).
2) The release names are irrelevant.
3) The folder time stamps aren't indicative of when the kernel actually was released upstream.
4) Install instructions are available at https://wiki.ubuntu.com/Kernel/MainlineBuilds .

If testing on your main install would be inconvenient, one may:
1) Install Ubuntu to a different partition and then test this there.
2) Backup, or clone the primary install.

If the latest kernel did not allow you to test to the issue (ex. you couldn't boot into the OS) please make a comment in your report about this, and continue to test the next most recent kernel version until you can test to the issue. Once you've tested the upstream kernel, please comment on which kernel version specifically you tested. If this issue is fixed in the mainline kernel, please add the following tags by clicking on the yellow circle with a black pencil icon, next to the word Tags, located at the bottom of the report description:
kernel-fixed-upstream
kernel-fixed-upstream-X.Y-rcZ

Where X, and Y are the first two numbers of the kernel version, and Z is the release candidate number if it exists.

If the mainline kernel does not fix the issue, please add the following tags:
kernel-bug-exists-upstream
kernel-bug-exists-upstream-X.Y-rcZ

Please note, an error to install the kernel does not fit the criteria of kernel-bug-exists-upstream.

Also, you don't need to apport-collect further unless specifically requested to do so.

It is most helpful that after testing of the latest upstream kernel is complete, you mark this report Status Confirmed.

Lastly, to keep this issue relevant to upstream, please continue to test the latest mainline kernel as it becomes available.

Thank you for your help.

Changed in xorg-server (Ubuntu):
status: New → Incomplete
Revision history for this message
Bruno Nova (brunonova) wrote :

I had an old hard drive around, so I installed Ubuntu to it.

I installed the latest kernel from that link (v4.8-rc5), and the bug is fixed there.
I haven't installed the NVidia proprietary drivers.

$ uname -a
Linux bruno-mitsai 4.8.0-040800rc5-generic #201609041832 SMP Sun Sep 4 22:34:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial

tags: added: kernel-fixed-upstream kernel-fixed-upstream-4.8-rc5
Changed in xorg-server (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Bruno Nova (brunonova) wrote :

This bug has some similarities with this one: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1553503

Revision history for this message
Bruno Nova (brunonova) wrote :

I tested a few more kernels.
The bug is also fixed in v4.6-rc1.
Don't know about earlier kernels.

Revision history for this message
penalvch (penalvch) wrote :

Bruno Nova, the next step is to fully reverse commit bisect from kernel 4.4 to 4.8-rc5 in order to identify the last bad commit, followed immediately by the first good one. Once this good commit has been identified, it may be reviewed for backporting. Could you please do this following https://wiki.ubuntu.com/Kernel/KernelBisection#How_do_I_reverse_bisect_the_upstream_kernel.3F ?

Please note, finding adjacent kernel versions is not fully commit bisecting.

Also, the kernel release names are irrelevant for the purposes of bisecting.

It is most helpful that after the fix commit (not kernel version) has been identified, you then mark this report Status Confirmed.

Thank you for your help.

affects: xorg-server (Ubuntu) → linux (Ubuntu)
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Bruno Nova (brunonova) wrote :

OK, I'll try, but I can't promise anything.

But I must say, after I removed and reinstalled the NVidia driver through software-properties-gtk, Ubuntu has shut down or completely frozen several times.
I'm going to "autoremove --purge" the driver and reinstall it to see if that stops this.

Revision history for this message
Bruno Nova (brunonova) wrote :

Hmm... this issue hasn't been happening lately. Maybe one of the recent kernel updates fixed this.
I'll wait a few more days before I mark this as fixed, to see if this wasn't a fluke.

As for the freezing/shutting down problems I mentioned before, they started happening in Windows as well, so I guess it's a hardware problem.

Revision history for this message
Bruno Nova (brunonova) wrote :

This seems to be fixed, indeed.
I can't reproduce this issue anymore. I'm currently on kernel version 4.4.0-38.
I'm marking this as fixed, then.

Changed in linux (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.