Bug 39745 - Xconfigurator --kickstart fails to read video memory size
Xconfigurator --kickstart fails to read video memory size
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: Xconfigurator (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Mike A. Harris
David Lawrence
:
: 53598 64695 65487 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-05-08 20:17 EDT by Fred Feirtag
Modified: 2007-04-18 12:33 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-01-10 10:23:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Fred Feirtag 2001-05-08 20:17:56 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.3-diskless i686)

Description of problem:
Xconfigurator --kickstart fails for cards that report:
(--) ATI(0): 8192 kB of SDRAM (1:1) detected.
because it's looking for the last colon in the line (strrchr)

How reproducible:
Always

Steps to Reproduce:
1.Use any video card that reports as in the description
2.run Xconfigurator --kickstart
3."Fatal error: Invalid amount of video memory." will appear
	

Actual Results:  --kickstart function failed with above error

Expected Results:  an /etc/X11/XF86Config-4 file to be created

Additional info:

Since Xconfigurator.c (version 4.9.29) searches for
"kB of S[DG]RAM", it seems safer to key off this string
and work backwards, rather than look at colons, at all.
Here is patch:
--- Xconfigurator.c     Fri Apr 27 09:48:33 2001
+++ Xconfigurator.c.fixed       Tue May  8 17:04:51 2001
@@ -3173,9 +3173,9 @@
        char *s, *t, *e;
        int vram;
 
-       s = strrchr(buf, ':');
-       for (s=s+1; *s && !isdigit(*s); s++);
-       for (t=s; *t && isdigit(*t); t++);
+       s = strstr(buf, " kB");
+       for (s--; *(s-1) && isdigit(*(s-1)); s--);
+       for (t=s+1; *t && isdigit(*t); t++);
        *t = '\0';
        vram = strtol(s, &e, 10);
Comment 1 Fred Feirtag 2001-05-10 21:34:06 EDT
The patch I previously entered works, but the following patch
is more correct.  Overall, even if the problem of having X report
with an unexpected colon character is not widespread among all
possible video cards, the search pattern used in processing the "kB"
of video memory string should EXACTLY match the search of the prior
grep--anything else would seem to introduce unnecessary risk.

The card I have with X reporting:
(--) ATI(0): 8192 kB of SDRAM (1:1) detected.
is (lspci)
01:00.0 VGA compatible controller: ATI Technologies Inc 3D Rage Pro AGP 1X/2X
(rev 5c)

Revised suggested patch:
--- Xconfigurator.c     Thu May 10 19:20:14 2001
+++ Xconfigurator.c.fixed       Thu May 10 19:20:04 2001
@@ -3170,13 +3170,15 @@
 
     f = fopen(tfilenm3, "r");
     if (fgets(buf, 8192, f)) {
-       char *s, *t, *e;
+       char *s, *e;
        int vram;
 
-       s = strrchr(buf, ':');
-       for (s=s+1; *s && !isdigit(*s); s++);
-       for (t=s; *t && isdigit(*t); t++);
-       *t = '\0';
+       /* locate sentinal, as found in prior grep */
+       s = strstr(buf, "kB of S");
+       /* enter null byte(s) after size string to make it ASCIZ */
+        for (; *(s-1) && ! isdigit(*(s-1)); s--, *s = '\0');
+       /* locate the beginning of the size string */
+       for (; *(s-1) && isdigit(*(s-1)); s--);
        vram = strtol(s, &e, 10);
 
        if (e != s && *e == 0 && vram > 0) {

Comment 2 Mike A. Harris 2001-05-22 05:27:09 EDT
Hmm, thanks for bringing this to our attention, and doubly so for the patch!
I will fix this matter next time I am digging into Xconfigurator.

Thanks, again!
Comment 3 Mike A. Harris 2002-05-30 18:13:50 EDT
*** Bug 53598 has been marked as a duplicate of this bug. ***
Comment 4 Mike A. Harris 2003-04-20 13:04:31 EDT
*** Bug 65487 has been marked as a duplicate of this bug. ***
Comment 5 Mike A. Harris 2003-04-20 13:04:50 EDT
*** Bug 64695 has been marked as a duplicate of this bug. ***
Comment 6 Mike A. Harris 2003-04-20 13:06:35 EDT
Bug #64695 has an alternative patch attached also:

http://bugzilla.redhat.com/bugzilla/attachment.cgi?id=70164&action=view
Comment 7 Mike A. Harris 2004-01-10 10:23:51 EST
Xconfigurator never ended up getting any erratum, and is now no
longer supported, as all versions of Red Hat Linux which shipped
with Xconfigurator are discontinued at the end of December 2003.

Since Red Hat Linux 8.0 however, we have replaced Xconfigurator
with a new tool "redhat-config-xfree86", which will be renamed
soon to "system-config-x" or something similar, so this problem
is solved in our current OS releases due to Xconfigurator's
obsolescence now.

Closing as CURRENTRELEASE.

Note You need to log in before you can comment on or make changes to this bug.