X crashes in drm_intel_gem_bo_close_vma <- drm_intel_gem_bo_unreference_final <- drm_intel_gem_bo_unreference_final ...

Bug #1056039 reported by Daniel van Vugt
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
xserver-xorg-video-intel (Ubuntu)
Fix Released
Critical
Bryce Harrington
Precise
Fix Released
High
Bryce Harrington

Bug Description

TEST CASE:
Setup:
#. CCSM > Composite > Unredirect Fullscreen Windows = ON
#. Install Chromium or Chrome browser.
#. Run ccsm and ensure the Scale plugin is loaded and "Initiate Window Picker"
   is bound to Shift+Alt+Up.

Actions:
#. Open a Chrome/Chromium window.
#. Open a gnome-terminal window (Ctrl+Alt+T)
#. Move the gnome-terminal to the centre of the screen, above the Chrome
   window.
#. Click on the Chrome window and make it fullscreen (F11).
#. Hold Shift+Alt and tap Up to engage scale mode. Keep holding Shift+Alt
   for a few seconds.

Expected Result:
  Windows get scaled and you can see both the Chrome and Terminal windows.

crashes Xorg in:

(gdb) bt
#0 0x00007fb5122afc62 in drm_intel_gem_bo_close_vma (
    bufmgr_gem=0x7fb518abb990, bo_gem=0x7fb518abb940)
    at ../../intel/intel_bufmgr_gem.c:1017
#1 0x00007fb5122b152f in drm_intel_gem_bo_unreference_final (
    bo=0x7fb518abb940, time=80627) at ../../intel/intel_bufmgr_gem.c:1073
#2 0x00007fb5122b14a0 in drm_intel_gem_bo_unreference_final (
    bo=0x7fb519032d10, time=80627) at ../../intel/intel_bufmgr_gem.c:1048
#3 0x00007fb5122b16cc in drm_intel_gem_bo_unreference (bo=0x7fb519032d10)
    at ../../intel/intel_bufmgr_gem.c:1118
#4 drm_intel_gem_bo_unreference (bo=0x7fb519032d10)
    at ../../intel/intel_bufmgr_gem.c:1105
#5 0x00007fb5124d25f5 in intel_batch_submit (scrn=0x7fb518537da0)
    at ../../src/intel_batchbuffer.c:305
#6 0x00007fb51615d004 in _CallCallbacks (pcbl=0x7fb5165187a8, call_data=0x0)
    at ../../dix/dixutils.c:768
#7 0x00007fb516295f9b in CallCallbacks (call_data=0x0, pcbl=0x7fb5165187a8)
    at ../../include/callback.h:86
#8 FlushAllOutput () at ../../os/io.c:647
#9 0x00007fb516158757 in Dispatch () at ../../dix/dispatch.c:465
#10 0x00007fb5161477ba in main (argc=8, argv=<optimised out>,
    envp=<optimised out>) at ../../dix/main.c:287

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: xserver-xorg 1:7.6+12ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-31.50-generic 3.2.28
Uname: Linux 3.2.0-31-generic x86_64
.tmp.unity.support.test.0:

ApportVersion: 2.0.1-0ubuntu13
Architecture: amd64
CompizPlugins: [core,composite,opengl,compiztoolbox,decor,mousepoll,gnomecompat,resize,vpswitch,grid,move,imgpng,regex,animation,wall,place,fade,session,expo,workarounds,scale,ezoom,unityshell]
CompositorRunning: compiz
Date: Tue Sep 25 17:01:24 2012
DistUpgraded: Fresh install
DistroCodename: precise
DistroVariant: ubuntu
ExtraDebuggingInterest: Yes,
GraphicsCard:
 Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller [8086:0102] (rev 09) (prog-if 00 [VGA controller])
   Subsystem: Dell Device [1028:047e]
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
MachineType: Dell Inc. OptiPlex 990
ProcEnviron:
 LANGUAGE=en_AU:en
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_AU.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.2.0-31-generic root=UUID=9f6f99e2-1189-4bf1-bff7-af137071f572 ro quiet splash vt.handoff=7
SourcePackage: xorg
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 09/10/2011
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A07
dmi.board.name: 0D6H9T
dmi.board.vendor: Dell Inc.
dmi.board.version: A00
dmi.chassis.type: 15
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.:bvrA07:bd09/10/2011:svnDellInc.:pnOptiPlex990:pvr01:rvnDellInc.:rn0D6H9T:rvrA00:cvnDellInc.:ct15:cvr:
dmi.product.name: OptiPlex 990
dmi.product.version: 01
dmi.sys.vendor: Dell Inc.
version.compiz: compiz 1:0.9.7.8-0ubuntu1.4
version.ia32-libs: ia32-libs N/A
version.libdrm2: libdrm2 2.4.32-1ubuntu1
version.libgl1-mesa-dri: libgl1-mesa-dri 8.0.3+8.0.2-0ubuntu3.2
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 8.0.3+8.0.2-0ubuntu3.2
version.xserver-xorg-core: xserver-xorg-core 2:1.11.4-0ubuntu10.7
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.7.0-0ubuntu1.2
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:6.14.99~git20111219.aacbd629-0ubuntu2
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.17.0-1ubuntu4.1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20111201+b5534a1-1build2

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

dmesg at the time the crash happened.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Xorg log at the time the crash happened.

affects: xorg (Ubuntu) → xserver-xorg-video-intel (Ubuntu)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Testing the same code on quantal with Intel HD 3000, I can't reproduce this or any of the other Xorg crashes.

bugbot (bugbot)
tags: added: crash
Bryce Harrington (bryce)
Changed in xserver-xorg-video-intel (Ubuntu):
assignee: nobody → Bryce Harrington (bryce)
importance: High → Critical
status: New → Triaged
Bryce Harrington (bryce)
Changed in xserver-xorg-video-intel (Ubuntu Precise):
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → Bryce Harrington (bryce)
Bryce Harrington (bryce)
description: updated
Revision history for this message
Bryce Harrington (bryce) wrote :

Testing this on precise on gm45 (i965), I do not reproduce this bug using the test case outlined in the description.

From comment #4 it sounds like you are not reproducing it in quantal. Can you check whether your system still reproduces it on current precise?

Changed in xserver-xorg-video-intel (Ubuntu Precise):
status: Triaged → Incomplete
Changed in xserver-xorg-video-intel (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

No promises I will have time to retest this before UDS and upgrading to quantal.

When I did test it last, I was getting a different Xorg crash each time. So reproducing one specific crash was difficult. (But reproducing /any/ crash was easy)

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Actually.... Bryce; there's an implicit setup step (very important) missing from the above test case, which applies to all tests in Unredirect.txt:

    CCSM > Composite > Unredirect Fullscreen Windows = ON

Please try that.

Changed in xserver-xorg-video-intel (Ubuntu):
status: Incomplete → New
Changed in xserver-xorg-video-intel (Ubuntu Precise):
status: Incomplete → New
description: updated
Revision history for this message
Bryce Harrington (bryce) wrote :

I've re-tested with your updated test case, but still works fine for me. I'll need to have you re-test.

Changed in xserver-xorg-video-intel (Ubuntu Precise):
status: New → Incomplete
status: Incomplete → New
Changed in xserver-xorg-video-intel (Ubuntu):
status: New → Incomplete
Bryce Harrington (bryce)
Changed in xserver-xorg-video-intel (Ubuntu Precise):
status: New → Incomplete
Revision history for this message
Achim (ach1m) wrote :

I also can't reproduce the problem outlined in the bug description.

intel(0): Integrated Graphics Chipset: Intel(R) Ivybridge Desktop (GT2)

Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal

$ uname -r
3.5.0-17-generic

$ apt-cache policy xserver-xorg-video-intel compiz
xserver-xorg-video-intel:
  Installiert: 2:2.20.9-0ubuntu2
  Kandidat: 2:2.20.9-0ubuntu2
  Versionstabelle:
 *** 2:2.20.9-0ubuntu2 0
        500 http://de.archive.ubuntu.com/ubuntu/ quantal/main amd64 Packages
        100 /var/lib/dpkg/status
compiz:
  Installiert: 1:0.9.8.4+bzr3407-0ubuntu1
  Kandidat: 1:0.9.8.4+bzr3407-0ubuntu1
  Versionstabelle:
 *** 1:0.9.8.4+bzr3407-0ubuntu1 0
        100 /var/lib/dpkg/status
     1:0.9.8.4-0ubuntu3 0
        500 http://de.archive.ubuntu.com/ubuntu/ quantal-updates/main amd64 Packages
     1:0.9.8.4-0ubuntu2 0
        500 http://de.archive.ubuntu.com/ubuntu/ quantal/main amd64 Packages

I hope that "unredirect fullscreen" gets enabled by default for the intel driver for ubuntu 13.04 (raring).

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Bryce, All,

I think I also failed to mention that you need to be using Compiz 0.9.8.4 or later, even on precise. So maybe use trunk (lp:compiz).

The features to make unredirect mode toggle reliably have not yet been backported to compiz 0.9.7 for precise.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Confirmed quantal is still free of this and other intel crashes I had in precise.

Bryce Harrington (bryce)
Changed in xserver-xorg-video-intel (Ubuntu):
status: Incomplete → Fix Released
Revision history for this message
Bryce Harrington (bryce) wrote :

I didn't spot anything in the libdrm changelog relevant to this. There's a few buffer flushing changes in the newer ddx driver, but they appeared related to corruption issues rather than crashes.

I'd built compiz from source and installed it, but on restart unity didn't come up. Does compiz need to be installed to /usr or is the default /usr/local supposed to work? Or does unity need rebuilt against the new compiz or something?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Yes I think you would have to install compiz to /usr. However to avoid clobbering your system I'd recommend:
    cmake .. -DCMAKE_INSTALL_PREFIX=~/staging
and then:
    cd staging
    env DISPLAY=:0 LD_LIBRARY_PATH=./lib XDG_DATA_DIRS="./share:$XDG_DATA_DIRS" COMPIZ_CONFIG_PROFILE=ubuntu ./bin/compiz --replace ccp
or more reliably:
    env DISPLAY=:0 LD_LIBRARY_PATH=./lib ./bin/compiz --replace composite opengl move resize decor compiztoolbox mousepoll wall expo scale switcher

Alternatively, wait for compiz-core 0.9.7.10 which we're working on getting to precise soon. Then you can just turn on unredirect mode to test it.

I should also note I saw at least three different intel crashes in my precise testing. I think I logged bugs for two of them (this is one) and then gave up on the third. I was getting different Xorg crashes each time.

Bryce Harrington (bryce)
Changed in xserver-xorg-video-intel (Ubuntu Precise):
status: Incomplete → Confirmed
Revision history for this message
Bryce Harrington (bryce) wrote :

I'm not able to reproduce the crash using compiz-core 1:0.9.7.12-0ubuntu1.
I cleared Unredirect Driver Blacklist and verified Unredirect Fullscreen Windows is checked, and reproduced the test case a number of times, but never got a crash.

Changed in xserver-xorg-video-intel (Ubuntu Precise):
importance: Critical → High
status: Confirmed → Incomplete
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Bryce,

I wrote a stress tester that will successfully crash the intel driver on precise (at least within minutes). It's in the compiz source at tests/system/untest/ and is built with the source but never packaged. Just build lp:compiz and then run:
    <cmake_build_dir>/tests/system/untest/untest

I will email you a binary for convenience if you like.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I should point out that in writing "untest" I discovered the crash only happens when you're running fullscreen OpenGL apps. Fullscreen regular windows won't trigger it.

Revision history for this message
Bryce Harrington (bryce) wrote :

> It's in the compiz source at tests/system/untest/ and is built with the source but never packaged. Just build lp:compiz and then run:
> <cmake_build_dir>/tests/system/untest/untest

Ah, that's handy.

Fwiw, just building lp:compiz did not compile the test, but I was able to manually make it successfully. I ran it to completion several times (runs took a few minutes and were very flashy and colorful, with "Pop Up" printed now and then.) Output was always:

Unredirect Fullscreen Windows Stress Tester
Copyright (c) 2012 Canonical Ltd.

GL Vendor: Intel Open Source Technology Center
GL Renderer: Mesa DRI Mobile Intel® GM45 Express Chipset
GL Version: 2.1 Mesa 9.0

Congratulations! Nothing crashed.

I've run several different apps full screen, including openarena, and switched between them, with and without the test running. Compiz seemed to have some trouble rendering everything properly, but there were no compiz or X crashes.

Changed in xserver-xorg-video-intel (Ubuntu Precise):
status: Incomplete → New
Revision history for this message
Bryce Harrington (bryce) wrote :

I don't doubt there are some X crashes hiding here amongst this functionality, however I am not able to reproduce any crashes on my hardware.

Possibly the changes for kernel/X/etc. that have gone in since this was originally reported have fixed whatever was crashing, or perhaps there is something hardware-specific to the crash you saw. I'm going to optimistically assume the former, but you may want to doublecheck if it's the latter; if you do please collect a full backtrace from X (see http://wiki.ubuntu.com/X/Backtracing for directions - I would recommend the gdb approach rather than using apport in this case), reopen this bug (or file a new one), and get my attention on it.

The stacktrace indicates a crash in libdrm code; libdrm is really just an interface layer on top of the kernel, so it's certainly plausible that the "real" bug was in the kernel and was fixed with a newer kernel.

Changed in xserver-xorg-video-intel (Ubuntu Precise):
status: New → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK but I fear for if we declare precise "fixed" and enable unredirection for intel in Mesa 8. With the large number of Ubuntu users, even a crash that effects 1% will cause a large headache and lots of bug reports. On the plus side, that would result in a good number of stack traces, one would hope :P

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.