[PATCH] xfree86: When xf86CrtcCloseScreen is called, the randr CRTCs are gone

Knut Petersen Knut_Petersen at t-online.de
Tue Jul 31 06:38:21 PDT 2012


Am 11.07.2012 23:33, schrieb Dave Airlie:
> On Wed, Jul 11, 2012 at 7:09 AM, Keith Packard <keithp at keithp.com> wrote:
>> The RandR CRTC structures are freed when their resource IDs are
>> destroyed during server shut down, which is before the screen is
>> closed. Calling back into RandR with stale pointers just segfaults the
>> server.
>>
>> Signed-off-by: Keith Packard <keithp at keithp.com>
>> Cc: Daniel Stone <daniel at fooishbar.org>
> Okay I'll have to revisit this when I get back online,
>
> but explanation makes sense, this was one of those changes I made
> during review without doing near as much testing on my original stack.
>
> So
> Reviewed-by: Dave Airlie <airlied at redhat.com>
>> ---
>>   hw/xfree86/modes/xf86Crtc.c |    3 ---
>>   1 file changed, 3 deletions(-)
>>
>> diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
>> index d20152c..9b73805 100644
>> --- a/hw/xfree86/modes/xf86Crtc.c
>> +++ b/hw/xfree86/modes/xf86Crtc.c
>> @@ -734,9 +734,6 @@ xf86CrtcCloseScreen(ScreenPtr screen)
>>       for (c = 0; c < config->num_crtc; c++) {
>>           xf86CrtcPtr crtc = config->crtc[c];
>>
>> -        if (crtc->randr_crtc->scanout_pixmap)
>> -            RRCrtcDetachScanoutPixmap(crtc->randr_crtc);
>> -
>>           crtc->randr_crtc = NULL;
>>       }
>>       /* detach any providers */
>> --
>> 1.7.10.4
>>
>> _______________________________________________
>>

After debugging xorg I see that three weeks ago Keith already published
the the solution I found today. Maybe I should have spend my time on sudoku instead ;-)

It´s definitely time to commit that patch, calling RRCrtcDetachScanoutPixmap()
in xf86CrtcCloseScreen() is too late to be usefull.

Adam, I added you to the CC as you reviewed the commit that introduced
the problem (2ed3f64d9d453628ab5c03b8aee006093019c933)

Tested-by: Knut Petersen <knut_petersen at t-online.de>



More information about the xorg-devel mailing list