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

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

Bug Description

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

eve% apt-cache policy xorg
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
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
StacktraceTop:
 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
UserGroups:

Revision history for this message
Anand Kumria (wildfire) wrote :
Revision history for this message
Apport retracing service (apport) wrote : Symbolic stack trace

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)

Revision history for this message
Apport retracing service (apport) wrote : Symbolic threaded stack trace
Changed in xorg-server:
importance: Undecided → Medium
Bryce Harrington (bryce)
tags: added: crash
Changed in xorg-server (Ubuntu):
status: New → Confirmed
Revision history for this message
In , Norman Yarvin (yarvin-yarchive) wrote :

Created an attachment (id=24448)
xorg.conf

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
xf86-video-intel-2.6.3-r1
libdrm-2.4.5
xorg-server-1.5.3-r5
Linux kernel 2.6.29. (I also tested it with 2.6.28, and got the same crash.)

Revision history for this message
In , Norman Yarvin (yarvin-yarchive) wrote :

Created an attachment (id=24449)
Xorg.0.log

Revision history for this message
In , Norman Yarvin (yarvin-yarchive) wrote :

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

Bryce Harrington (bryce)
visibility: private → public
unggnu (unggnu)
affects: xorg-server (Ubuntu) → xserver-xorg-video-intel (Ubuntu)
Changed in xserver-xorg-video-intel:
status: Unknown → Confirmed
Revision history for this message
unggnu (unggnu) wrote : Re: Xorg crashed with SIGSEGV in drm_intel_bo_unpin()

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()
Revision history for this message
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.

Revision history for this message
In , Norman Yarvin (yarvin-yarchive) wrote :

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.

Revision history for this message
In , Jesse Barnes (jbarnes-virtuousgeek) wrote :

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) {
            i830_overlay_off(pScrn);
        }
- 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;

Revision history for this message
In , Jesse Barnes (jbarnes-virtuousgeek) wrote :

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

Revision history for this message
In , unggnu (unggnu) wrote :

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

Revision history for this message
In , unggnu (unggnu) wrote :

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

Revision history for this message
In , Jesse Barnes (jbarnes-virtuousgeek) wrote :

Great, thanks for confirming.

Revision history for this message
In , Norman Yarvin (yarvin-yarchive) wrote :

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

Revision history for this message
In , unggnu (unggnu) wrote :

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

unggnu (unggnu)
Changed in xserver-xorg-video-intel:
status: Confirmed → Unknown
Revision history for this message
unggnu (unggnu) wrote :

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

Changed in xserver-xorg-video-intel:
status: Unknown → Fix Released
Revision history for this message
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)
Changed in xserver-xorg-video-intel (Ubuntu):
assignee: nobody → bryceharrington
status: Confirmed → Triaged
Revision history for this message
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.

Revision history for this message
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
Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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