Bug 124800 - Unusual Modeline names in X server config file crash system-config-display
Unusual Modeline names in X server config file crash system-config-display
Product: Fedora
Classification: Fedora
Component: rhpl (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
: 123398 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2004-05-30 06:57 EDT by Ed Avis
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-09-21 15:11:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ed Avis 2004-05-30 06:57:08 EDT
When I run system-config-display I get

Traceback (most recent call last):
  File "/usr/share/system-config-display/xconf.py", line 346, in ?
    hardware_state = XF86HardwareState(xconfig)
  File "/usr/lib/python2.3/site-packages/rhpl/xhwstate.py", line 151,
in __init__
  File "/usr/lib/python2.3/site-packages/rhpl/xhwstate.py", line 284,
in init_from_xconfig
    self.all_resolutions.sort (compare_resolution)
  File "/usr/lib/python2.3/site-packages/rhpl/xhwstate.py", line 55,
in compare_resolution
    a1 = resolution_area(res1)
  File "/usr/lib/python2.3/site-packages/rhpl/xhwstate.py", line 51,
in resolution_area
    (w, h) = resolution_from_string(res)
  File "/usr/lib/python2.3/site-packages/rhpl/xhwstate.py", line 48,
in resolution_from_string
    return (string.atoi(w), string.atoi(h))
  File "/usr/lib/python2.3/string.py", line 220, in atoi
    return _int(s, base)
ValueError: invalid literal for int(): 900_100.00

This is because my /etc/X11/XF86Config file contains

        ModeLine     "1200x900_100.00" 157.1 1200 1296 1424 1648 900
901 904 953 -hsync +vsync

It seems that system-config-display expects the mode name to always be
'NxM' with N and M integer, but other names are also quite valid (the
above was generated by the standard 'gtf' program).

Suggest that system-config-display be changed to not make assumptions
about the mode name, or at least that if you do try to convert strings
to integers there is suitable exception handling when it fails.

(BTW, I don't fully understand why I still have an XF86Config file
when FC2 uses xorg - but I don't think the filename affects this bug
Comment 1 Brent Fox 2004-06-16 16:58:26 EDT
Changing component to rhpl since that's where this code lives.

Jeremy:  I'm not sure how to handle this.  Aside from the contents of
the second token in the ModeLine line, I don't know another easy way
to tell what resolution the mode line is set to.  I guess you could
try to calculate it by the rest of the tokens in the line, but that
seems kindof hackish too.

I guess it would be valid to have "Foobar" in the modeline name field,
but that's not really helpful to anybody.  My inclination is to say
that even though non-integer fields are technically valid, it's bad
practice to do this.  I'd almost be in favor of changing gtf and xorg
to only accept integer values in this field.  
Comment 2 Brent Fox 2004-06-17 10:04:17 EDT
*** Bug 123398 has been marked as a duplicate of this bug. ***
Comment 3 Ed Avis 2004-06-19 05:13:10 EDT
Surely it's quite simple - the second number in the modeline gives
horizontal resolution and the sixth gives vertical.  This seems a lot
less hackish than expecting a magic string as the modeline name.
Comment 4 Matthew Miller 2005-04-26 11:20:37 EDT
Fedora Core 2 is now maintained by the Fedora Legacy project for
security updates only. If this problem is a security issue, please
reopen and reassign to the Fedora Legacy product. If it is not a
security issue and hasn't been resolved in the current FC3 updates or
in the FC4 test release, reopen and change the version to match.
Comment 5 Jeremy Katz 2005-09-21 15:11:11 EDT
Closing as fixed in later releases

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