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);
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) {
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!
*** Bug 53598 has been marked as a duplicate of this bug. ***
*** Bug 65487 has been marked as a duplicate of this bug. ***
*** Bug 64695 has been marked as a duplicate of this bug. ***
Bug #64695 has an alternative patch attached also: http://bugzilla.redhat.com/bugzilla/attachment.cgi?id=70164&action=view
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.