[PATCH] Avoid segfaults in XF86VidMode GammaRamp functions if randr_crtc is NULL

Michel Dänzer michel at daenzer.net
Thu Feb 25 01:43:05 PST 2010

On Tue, 2010-02-23 at 09:25 -0800, Keith Packard wrote: 
> On Tue, 23 Feb 2010 15:02:40 +0100, Brice Goglin <Brice.Goglin at ens-lyon.org> wrote:
> > See some debugging in
> > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=554450#31
> > 
> > Does this ring any bell ?
> yeah, this makes sense -- the compat_output has recently been redefined
> to be the same as the 'primary' output, and that output may well be
> turned off, in which case you'd get a crash looking for the crtc
> attached to it.
> Fixing this will require reviewing all uses of compat_output and
> ensuring that they check for a NULL crtc.

Unfortunately that doesn't seem to work well in all cases either, see
http://bugs.freedesktop.org/show_bug.cgi?id=24532#c3 and following
comments (though maybe the semantics for when there's no compat
output/CRTC could be improved from that patch).

I think the ideal solution would be to make sure the compat output
always has a CRTC associated with it. Of course if that isn't always
possible, something like the above is needed as a fallback anyway. But I
think at least for scenarios like in the bug report above it should be

Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer

More information about the xorg-devel mailing list