Bug 124800

Summary: Unusual Modeline names in X server config file crash system-config-display
Product: [Fedora] Fedora Reporter: Ed Avis <ed>
Component: rhplAssignee: Jeremy Katz <katzj>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 2CC: bradley.g.smith, mattdm
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-21 19:11:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ed Avis 2004-05-30 10:57:08 UTC
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__
    self.init_from_xconfig(xconfig)
  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
report.)

Comment 1 Brent Fox 2004-06-16 20:58:26 UTC
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 14:04:17 UTC
*** Bug 123398 has been marked as a duplicate of this bug. ***

Comment 3 Ed Avis 2004-06-19 09:13:10 UTC
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 15:20:37 UTC
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 19:11:11 UTC
Closing as fixed in later releases