[i855 i915] Xorg crashed with SIGSEGV in drm_intel_bo_unpin()

Bug #345796 reported by Anand Kumria on 2009-03-20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fix Released
xserver-xorg-video-intel (Ubuntu)
Bryce Harrington

Bug Description

eve% lsb_release -rd
Description: Ubuntu jaunty (development branch)
Release: 9.04

eve% apt-cache policy xorg
  Installed: 1:7.4~5ubuntu16
  Candidate: 1:7.4~5ubuntu16
  Version table:
 *** 1:7.4~5ubuntu16 0
        500 http://uk.archive.ubuntu.com jaunty/main Packages
        100 /var/lib/dpkg/status

eve% apt-cache policy xserver-xorg-video-intel
  Installed: 2:2.6.3-0ubuntu2
  Candidate: 2:2.6.3-0ubuntu2
  Version table:
 *** 2:2.6.3-0ubuntu2 0
        500 http://uk.archive.ubuntu.com jaunty/main Packages
        100 /var/lib/dpkg/status

ProblemType: Crash
Architecture: i386
DistroRelease: Ubuntu 9.04
ExecutablePath: /usr/bin/Xorg
Package: xserver-xorg-core 2:1.6.0-0ubuntu3
ProcAttrCurrent: unconfined
ProcCmdline: /usr/X11R6/bin/X :0 -br -audit 0 -auth /var/lib/gdm/:0.Xauth -nolisten tcp vt7
ProcEnviron: PATH=(custom, no user)
ProcVersion: Linux version 2.6.29-020629rc6-generic (root@zinc) (gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)) #020629rc6 SMP Mon Feb 23 12:53:58 UTC 2009
Signal: 11
SourcePackage: xorg-server
 drm_intel_bo_unpin () from /usr/lib/libdrm_intel.so.1
 ?? () from /usr/lib/xorg/modules/drivers//intel_drv.so
 i830_crtc_dpms_video ()
 ?? () from /usr/lib/xorg/modules/drivers//intel_drv.so
 ?? () from /usr/lib/xorg/modules/drivers//intel_drv.so
Title: Xorg crashed with SIGSEGV in drm_intel_bo_unpin()
Uname: Linux 2.6.29-020629rc6-generic i686

Anand Kumria (wildfire) wrote :

StacktraceTop:drm_intel_bo_unpin () from /usr/lib/libdrm_intel.so.1
I830StopVideo (pScrn=0x91e1858, data=0x925239c, shutdown=1)
i830_crtc_dpms_video (crtc=0x0, on=0)
i830_crtc_dpms (crtc=0x9217ff0, mode=3)
RestoreHWState (pScrn=0x91e1858)

Changed in xorg-server:
importance: Undecided → Medium
Bryce Harrington (bryce) on 2009-03-30
tags: added: crash
Changed in xorg-server (Ubuntu):
status: New → Confirmed

Created an attachment (id=24448)

I've just gotten about five crashes of the X server, each with the backtrace:

0: X(xorg_backtrace+0x26) [0x4ea426]
1: X(xf86SigHandler+0x39) [0x47e0f9]
2: /lib/libc.so.6 [0x7f4d381e7040]
3: /usr/lib/libdrm_intel.so.1(drm_intel_bo_unpin+0) [0x7f4d3705db70]
4: /usr/lib64/xorg/modules/drivers//intel_drv.so [0x7f4d3729cb89]
5: /usr/lib64/xorg/modules/drivers//intel_drv.so(i830_crtc_dpms_video+0x4a) [0x7f4d3729cc0a]
6: /usr/lib64/xorg/modules/drivers//intel_drv.so [0x7f4d37289fa1]
7: X(xf86DPMSSet+0x95) [0x4a3805]
8: X(xf86SaveScreen+0x29) [0x4a3fa9]
9: X(dixSaveScreens+0x241) [0x43a2d1]
10: X [0x4e733b]
11: X [0x4e7728]
12: X(WaitForSomething+0x56b) [0x4e7d7b]
13: X(Dispatch+0x7f) [0x449fff]
14: X(main+0x44d) [0x430b2d]
15: /lib/libc.so.6(__libc_start_main+0xe6) [0x7f4d381d25c6]
16: X [0x42ff19]

The crashes only seem to happen when I'm not using the X server (probably right when it turns off the monitors): the system seems quite reliable so long as I'm actually using it. But then when I go away, and come back to find the monitors in power-saving mode, often the server has crashed, leaving the keyboard in an unusable state, requiring a reboot via the power button.

My setup is:

G965 with dual-DVI ADD2 card, driving two monitors.
Gentoo Linux
Linux kernel 2.6.29. (I also tested it with 2.6.28, and got the same crash.)

Created an attachment (id=24449)

I'm willing to help debug this one; please let me know what additional information would be desirable.

Bryce Harrington (bryce) on 2009-04-03
visibility: private → public
unggnu (unggnu) on 2009-04-03
affects: xorg-server (Ubuntu) → xserver-xorg-video-intel (Ubuntu)
Changed in xserver-xorg-video-intel:
status: Unknown → Confirmed

I have the same problem with i915. X crashed shortly after initiating suspend which results in gdm/kdm login screen. After that changing to text console isn't possible anymore because of a black screen. Sometimes it seems to happen on dpms activation too.

At least in my case Suspend works fine until XV is used (first XV usage results in a short flicker). I still using Overlay because the tearing problem isn't gone.

summary: - Xorg crashed with SIGSEGV in drm_intel_bo_unpin()
+ [i855 i915] Xorg crashed with SIGSEGV in drm_intel_bo_unpin()
Julian Lam (julian-lam) wrote :

This crash occurred again last night.

I believe it was due to the computer trying to suspend/hibernate when becoming dangerously close to running out of battery.

Computer did not successfully hibernate, and soon halted completely when the battery ran out.

Some more information: the crashes only seem to occur after the video overlay (Xv adaptor 1) has been used. That is, if I play a video using the video overlay, then later let DPMS activate, the X server crashes on DPMS activation; this seems to happen every time. If I use the textured video adaptor instead, crashes don't seem to happen at all. At least that's the pattern so far.

I think this is fixed upstream already, can you try git master or this patch on top of your 2.6.3 driver?

commit 74d0713e002a9781ed00fdd10eb6f75907ae796c
Author: Kalev Lember <email address hidden>
Date: Fri Mar 20 02:21:41 2009 +0200

    Fix VT switch with XV overlay video enabled.

    drm_intel_bo_unpin() was called with NULL argument.

    Signed-off-by: Kalev Lember <email address hidden>

diff --git a/src/i830_video.c b/src/i830_video.c
index 3c6fbf3..3f3aaac 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -1048,11 +1048,14 @@ I830StopVideo(ScrnInfoPtr pScrn, pointer data, Bool shut
        if (pPriv->videoStatus & CLIENT_VIDEO_ON) {
- if (!pPriv->textured)
- drm_intel_bo_unpin(pPriv->buf);
- drm_intel_bo_unreference(pPriv->buf);
- pPriv->buf = NULL;
- pPriv->videoStatus = 0;
+ if (pPriv->buf) {
+ if (!pPriv->textured)
+ drm_intel_bo_unpin(pPriv->buf);
+ drm_intel_bo_unreference(pPriv->buf);
+ pPriv->buf = NULL;
+ pPriv->videoStatus = 0;
+ }
     } else {
        if (pPriv->videoStatus & CLIENT_VIDEO_ON) {
            pPriv->videoStatus |= OFF_TIMER;

*** Bug 21025 has been marked as a duplicate of this bug. ***

Works for me but I had to change the top of the patch a little because one part is a little different.

Created an attachment (id=24609)
Patch for Ubuntu xserver-xorg-video-intel 2.6.3-ubuntu5

Great, thanks for confirming.

Yes, works for me too (with similarly-changed patch).

Thanks for fixing/pointing out the patch so fast :)

unggnu (unggnu) on 2009-04-06
Changed in xserver-xorg-video-intel:
status: Confirmed → Unknown
unggnu (unggnu) wrote :

Upstream has posted a patch. It seems to work for me.

Changed in xserver-xorg-video-intel:
status: Unknown → Fix Released
Julian Lam (julian-lam) wrote :

To follow up on unggnu's original comment:
After experiencing a broken suspend (computer goes back to login screen instead), the commands pm-suspend and pm-hibernate no longer output anything. The computer does not go to bed.

Bryce Harrington (bryce) on 2009-04-07
Changed in xserver-xorg-video-intel (Ubuntu):
assignee: nobody → bryceharrington
status: Confirmed → Triaged
unggnu (unggnu) wrote :

With the patch the suspend test https://wiki.ubuntu.com/KernelTeam/SuspendResumeTesting runs through without problems (about 30 times).

I have also suspended the system while glxgears was running and xv in use and it resumes fine. Even the movie keeps going with image and sound output.

Bryce Harrington (bryce) wrote :

Sweet, thanks for chasing this through unggnu, the patch looks good, I'll stick it in.

Changed in xserver-xorg-video-intel (Ubuntu):
status: Triaged → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xserver-xorg-video-intel - 2:2.6.3-0ubuntu9

xserver-xorg-video-intel (2:2.6.3-0ubuntu9) jaunty; urgency=low

  * Add 120_fix_vt_switch.patch: Fix null pointer deref in
    I830StopVideo(), which can lead to segfaults calling
    drm_intel_bo_unpin or drm_intel_bo_unreference when entering DPMS.
    Thanks to unggnu for shepherding this bug to solution!
    (LP: #345796)

 -- Bryce Harrington <email address hidden> Wed, 08 Apr 2009 19:12:39 -0700

Changed in xserver-xorg-video-intel (Ubuntu):
status: Fix Committed → Fix Released
Changed in xserver-xorg-video-intel:
importance: Unknown → Medium
Changed in xserver-xorg-video-intel:
importance: Medium → Unknown
Changed in xserver-xorg-video-intel:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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