Bug 21007 - SIGSEGV in libdrm_intel (drm_intel_bo_unpin) when entering DPMS
Summary: SIGSEGV in libdrm_intel (drm_intel_bo_unpin) when entering DPMS
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: 7.4 (2008.09)
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Jesse Barnes
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords: NEEDINFO
: 21025 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-01 15:35 UTC by Norman Yarvin
Modified: 2009-04-06 14:40 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
xorg.conf (707 bytes, application/octet-stream)
2009-04-01 15:35 UTC, Norman Yarvin
no flags Details
Xorg.0.log (23.12 KB, text/plain)
2009-04-01 15:37 UTC, Norman Yarvin
no flags Details
Patch for Ubuntu xserver-xorg-video-intel 2.6.3-ubuntu5 (653 bytes, patch)
2009-04-06 10:29 UTC, unggnu
no flags Details | Splinter Review

Description Norman Yarvin 2009-04-01 15:35:49 UTC
Created attachment 24448 [details]
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.)
Comment 1 Norman Yarvin 2009-04-01 15:37:07 UTC
Created attachment 24449 [details]
Xorg.0.log
Comment 2 Norman Yarvin 2009-04-01 15:40:02 UTC
I'm willing to help debug this one; please let me know what additional information would be desirable.
Comment 3 Norman Yarvin 2009-04-04 22:45:53 UTC
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.
Comment 4 Jesse Barnes 2009-04-06 09:37:38 UTC
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 <kalev@smartlink.ee>
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 <kalev@smartlink.ee>

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;
Comment 5 Jesse Barnes 2009-04-06 09:40:35 UTC
*** Bug 21025 has been marked as a duplicate of this bug. ***
Comment 6 unggnu 2009-04-06 10:28:29 UTC
Works for me but I had to change the top of the patch a little because one part is a little different.
Comment 7 unggnu 2009-04-06 10:29:28 UTC
Created attachment 24609 [details] [review]
Patch for Ubuntu xserver-xorg-video-intel 2.6.3-ubuntu5
Comment 8 Jesse Barnes 2009-04-06 11:03:19 UTC
Great, thanks for confirming.
Comment 9 Norman Yarvin 2009-04-06 11:12:39 UTC
Yes, works for me too (with similarly-changed patch).
Comment 10 unggnu 2009-04-06 14:40:16 UTC
Thanks for fixing/pointing out the patch so fast :)


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.