Bug 16622 - [R300] SDL apps using SDL_SetGamma crashes X
Summary: [R300] SDL apps using SDL_SetGamma crashes X
Status: RESOLVED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/Radeon (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high major
Assignee: xf86-video-ati maintainers
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-05 03:14 UTC by Toni Spets
Modified: 2018-06-12 19:06 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
X.org log when the crashing app is executed (43.36 KB, text/plain)
2008-07-05 03:18 UTC, Toni Spets
no flags Details

Description Toni Spets 2008-07-05 03:14:29 UTC
When SDL_SetGamma() is called by any SDL app it will crash the X server. This happens only with ati drivers, vesa works fine.

Crashing snippet:
-- snip --
#include <SDL/SDL.h>

int main()
{
        SDL_Init(SDL_INIT_VIDEO);
        SDL_SetVideoMode(640, 480, 16, 0); 
        SDL_SetGamma(1.0f, 1.0f, 1.0f);
}
-- snap --

After more digging the SDL source I found X11_SetGammaRamp() function produces the crash when it calls XStoreColors() at the end of it.

xgamma works and it uses XF86VidModeSetGamma().


Software:
Debian unstable with xf86-video-ati 6.9.0

X.Org X Server 1.4.2
Release Date: 11 June 2008
X Protocol Version 11, Revision 0
Build Operating System: Linux Debian (xorg-server 2:1.4.2-1)
Current Operating System: Linux debian 2.6.25-2-686 #1 SMP Fri Jun 27 03:23:20 UTC 2008 i686
Build Date: 26 June 2008  01:58:50AM

Hardware:
01:00.0 VGA compatible controller: ATI Technologies Inc RV350 AP [Radeon 9600]
Comment 1 Toni Spets 2008-07-05 03:18:55 UTC
Created attachment 17546 [details]
X.org log when the crashing app is executed

The log is not very informative but attached it anyway.
Comment 2 Alex Deucher 2008-07-05 14:02:16 UTC
can you use gdb and get a backtrace of the crash?
Comment 3 Lukasz Krotowski 2008-07-05 23:19:28 UTC
FWIW: attached test case works fine with git master of xf86-video-ati and (more or less fresh) git master of xserver. It might be some radeon/xserver1.4 regression. It might be worth to test 1.5rc5 (aka 1.4.99.905) or git master.
Comment 4 Toni Spets 2008-07-05 23:52:09 UTC
(In reply to comment #2)
> can you use gdb and get a backtrace of the crash?
> 

The trace was useless when I tried, it couldn't access X's memory address and the backtrace was empty when it crashed.
Comment 5 Toni Spets 2008-07-06 01:15:44 UTC
(In reply to comment #3)
> FWIW: attached test case works fine with git master of xf86-video-ati and (more
> or less fresh) git master of xserver. It might be some radeon/xserver1.4
> regression. It might be worth to test 1.5rc5 (aka 1.4.99.905) or git master.
> 

I might need to wait until 1.5rc5 comes to debian unstable if no one else can confirm and test this on both. RC2 was on experimental but the package by itself was useless without the dependencies which were not there.
Comment 6 Toni Spets 2008-07-06 08:29:05 UTC
On another note this doesn't happen when X is started with root.
Comment 7 Alex Deucher 2010-10-19 16:34:57 UTC
Is this still an issue on a newer xserver or driver?
Comment 8 Adam Jackson 2018-06-12 19:06:27 UTC
Mass closure: This bug has been untouched for more than six years, and is not
obviously still valid. Please reopen this bug or file a new report if you continue to experience issues with current releases.


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.