Bug 9803 - elographics divide by zero crasher
Summary: elographics divide by zero crasher
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Input/elographics (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-29 10:02 UTC by Daniel Drake
Modified: 2007-12-27 21:57 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
fix (1.48 KB, patch)
2007-01-29 10:03 UTC, Daniel Drake
no flags Details | Splinter Review

Description Daniel Drake 2007-01-29 10:02:57 UTC
By accident, we ended up using these values for the elographics input driver:

   Option  "MaxX" "4050"
   Option  "MinX" "4051"
   Option  "MinY" "3973"
   Option  "MaxY" "3973"

With these values, X crashes when you touch the screen:

Program received signal SIGFPE, Arithmetic exception.
0x00002b6f559946f0 in xf86EloConvert (local=0x80dea0, 
    first=<value optimized out>, num=<value optimized out>, v0=2886, v1=1618, 
    v2=0, v3=0, v4=0, v5=0, x=0x7fff5764525c, y=0x7fff57645258)
    at xf86Elo.c:736
736       *y = (priv->screen_height -
(gdb) bt 
#0  0x00002b6f559946f0 in xf86EloConvert (local=0x80dea0, 
    first=<value optimized out>, num=<value optimized out>, v0=2886, v1=1618, 
    v2=0, v3=0, v4=0, v5=0, x=0x7fff5764525c, y=0x7fff57645258)
    at xf86Elo.c:736
#1  0x00002b6f55995a29 in xf86EloReadInput (local=0x80dea0) at xf86Elo.c:846
#2  0x0000000000490c6f in xf86AddEnabledDevice ()
#3  0x000000000046af2f in xf86InstallSIGIOHandler ()
#4  0x00002b6f53db35d0 in killpg () from /lib/libc.so.6
#5  0x0000000000000000 in ?? ()

The line of code in question:

  *y = (priv->screen_height -
	(priv->screen_height * (input_y - priv->min_y)) / height);

In this case, height is 0.
Comment 1 Daniel Drake 2007-01-29 10:03:27 UTC
Created attachment 8539 [details] [review]
fix

This avoids the crash by detecting the bad configuration early on and generating an error message.
Comment 2 Daniel Stone 2007-02-27 01:36:02 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 3 Peter Hutterer 2007-12-27 21:57:34 UTC
Pushed as e4071358e3047127fe0476cab3e9fb63e180e940


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.