Bug 10934 - segfault in SavageDoAdjustFrame()
Summary: segfault in SavageDoAdjustFrame()
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/savage (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL: http://bugs.debian.org/423485
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-12 15:11 UTC by Julien Cristau
Modified: 2007-07-11 18:10 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg log (43.71 KB, text/plain)
2007-05-12 15:11 UTC, Julien Cristau
no flags Details
backtrace (3.30 KB, text/plain)
2007-05-12 15:12 UTC, Julien Cristau
no flags Details
gdb session (5.35 KB, text/plain)
2007-05-12 15:12 UTC, Julien Cristau
no flags Details
set currentMode after switching, before adjusting frame (730 bytes, patch)
2007-05-13 01:28 UTC, Tormod Volden
no flags Details | Splinter Review

Description Julien Cristau 2007-05-12 15:11:07 UTC
This was reported by Tormod Volden <debian.tormod@gmail.com> to the debian BTS.

"Trying to start an old q3demo, the X server crashed."

Tormod had the following comment:

"Playing around with gdb, I see that pScrn-currentMode has been set to
NULL by xf86VidMode. If I manually set it to pScrn->modes:
(gdb) set pScrn->currentMode = pScrn->modes
the program will start and seems to run normally.

AFAICS the problem is that xf86VidMode sets it intentionally to NULL
before calling xf86SwitchMode, and that it's then used as a
pointer by SavageDoAdjustFrame inside the xf86SwitchMode call."

I'll attach the backtrace and gdb session he provided.
Comment 1 Julien Cristau 2007-05-12 15:11:47 UTC
Created attachment 9950 [details]
Xorg log
Comment 2 Julien Cristau 2007-05-12 15:12:24 UTC
Created attachment 9951 [details]
backtrace
Comment 3 Julien Cristau 2007-05-12 15:12:48 UTC
Created attachment 9952 [details]
gdb session
Comment 4 Tormod Volden 2007-05-13 01:28:28 UTC
Created attachment 9953 [details] [review]
set currentMode after switching, before adjusting frame

(From http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=423485)

The attached patch fixes (or works around) the problem by setting currentMode to the new mode as soon as the mode switching has occured, and before SavageAdjustFrame is called.

There are probably better ways to fix this. It seems like the pScrn->frameX? adjustment is done in xf86SwitchMode as well, so maybe it could be taken out from SavageDoAdjustFrame which then would not need the currentMode.
Comment 5 Alex Deucher 2007-07-11 18:10:02 UTC
fixed:
90692b3a123861ca02100f86b4c80f070fd4196d


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.