Bug 31614 - savage fail in fb overlay privates
Summary: savage fail in fb overlay privates
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/savage (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-13 23:49 UTC by Dave Airlie
Modified: 2010-12-07 12:25 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Dave Airlie 2010-11-13 23:49:32 UTC
1.9.0 X server + savage from git

#0  0x00f10416 in __kernel_vsyscall ()
#1  0x00173941 in raise () from /lib/libc.so.6
#2  0x00176e42 in abort () from /lib/libc.so.6
#3  0x0016c8e8 in __assert_fail () from /lib/libc.so.6
#4  0x002e12e1 in dixGetPrivateAddr (pScrn=<value optimized out>, 
    r=<value optimized out>, g=0, b=0) at /usr/include/xorg/privates.h:122
#5  dixGetPrivate (pScrn=<value optimized out>, r=<value optimized out>, g=0, 
    b=0) at /usr/include/xorg/privates.h:137
#6  dixLookupPrivate (pScrn=<value optimized out>, r=<value optimized out>, 
    g=0, b=0) at /usr/include/xorg/privates.h:167
#7  SavageUpdateKey (pScrn=<value optimized out>, r=<value optimized out>, 
    g=0, b=0) at savage_driver.c:4270

#7  SavageUpdateKey (pScrn=<value optimized out>, r=<value optimized out>, 
    g=0, b=0) at savage_driver.c:4270
4270		|| !(pScrOvlPriv = fbOverlayGetScrPriv(pScreen))) 

assert 

X: /usr/include/xorg/privates.h:122: dixGetPrivateAddr: Assertion `key->initialized' failed.

may be a server bug.
Comment 1 Dave Airlie 2010-11-14 00:00:48 UTC
#5  0x080bb8ad in CMapRefreshColors (pmap=<value optimized out>, 
    defs=<value optimized out>, indices=0x9d770a0)
    at ../../../../hw/xfree86/common/xf86cmap.c:669
#6  0x080bc06b in CMapReinstallMap (pmap=0x0)
    at ../../../../hw/xfree86/common/xf86cmap.c:542
#7  0x080eb040 in compInstallColormap (pColormap=0x9fa3e78)
    at ../../composite/compinit.c:100
#8  0x08069d2a in ProcInstallColormap (client=0x9f7d5f8)
    at ../../dix/dispatch.c:2451
#9  0x0806e087 in Dispatch () at ../../dix/dispatch.c:432
#10 0x080625ba in main (argc=6, argv=0xbfddd1a4, envp=0xbfddd1c0)
    at ../../dix/main.c:291

other half of the backtrace.
Comment 2 Keith Packard 2010-11-23 08:55:00 UTC
Looks like the savage driver is trying to use fbOverlay functions without ever initializing it. I'll bet this fixes the problem:

diff --git a/src/savage_driver.c b/src/savage_driver.c
index 7c3ce90..324c4a4 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -4266,7 +4266,8 @@ SavageUpdateKey(ScrnInfoPtr pScrn, int r, int g, int b)
 	ul = 1;
 	ol = 0;
     }
-    if (!(pScreen = pScrn->pScreen) 
+    if (!(pScreen = pScrn->pScreen)
+	|| !psav->FBStart2nd
 	|| !(pScrOvlPriv = fbOverlayGetScrPriv(pScreen))) 
 	return;
     key = ((Shift(r,psav->overlay.redShift) & psav->overlay.redMask)
Comment 3 Toni Spets 2010-11-23 10:21:54 UTC
(In reply to comment #2)
> Looks like the savage driver is trying to use fbOverlay functions without ever
> initializing it. I'll bet this fixes the problem:
> 
> diff --git a/src/savage_driver.c b/src/savage_driver.c
> index 7c3ce90..324c4a4 100644
> --- a/src/savage_driver.c
> +++ b/src/savage_driver.c
> @@ -4266,7 +4266,8 @@ SavageUpdateKey(ScrnInfoPtr pScrn, int r, int g, int b)
>      ul = 1;
>      ol = 0;
>      }
> -    if (!(pScreen = pScrn->pScreen) 
> +    if (!(pScreen = pScrn->pScreen)
> +    || !psav->FBStart2nd
>      || !(pScrOvlPriv = fbOverlayGetScrPriv(pScreen))) 
>      return;
>      key = ((Shift(r,psav->overlay.redShift) & psav->overlay.redMask)

That fixes the crash, thank you both.
Comment 4 Julien Cristau 2010-11-23 10:55:27 UTC
Please don't close until the fix is in git.
Comment 5 Dave Airlie 2010-11-24 18:06:08 UTC
fix pushed to git.
Comment 6 Toni Spets 2010-12-07 12:25:12 UTC
Fixed in xf86-video-savage-2.3.2.

Closing bug.


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.