Port-sparc64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Strange X11 crashes on 5.0



On Thu, 6 Aug 2009 23:37:16 -0400 (EDT)
der Mouse <mouse%Rodents-Montreal.ORG@localhost> wrote:

[ snip ]
> 
> In this case, the broken code is in XListInputDevices.  In particular,
> if there is a ValuatorClass device with an odd number of axes, then,
> on a sparc64 with the usual compilers, the next device after that (if
> such a "next device" exists) will attempt to access 64-bit data at
> addresses that are odd multiples of 4.  This is probably what's going
> wrong here, and it quite definitely is a bug in the implementation of
> XListInputDevices; it is making assumptions about alignment for which
> there is no justification in C - basically, that a malloc()ed pointer
> can be advanced by sizeof() one struct and still be correctly aligned
> for storing a completely unrelated struct.

I think you're right about the odd number of axes. I have subsequently
found that the bug can be simply demonstrated using 'xinput list' run on
the sparc64 box from a remote X server running on Mac OS X 10.5.7 on my
G4 Mac Mini. Running 'xinput list' on a Linux i386 box, from the same
Mac X server, shows that the Mac is indeed advertising input devices
with an odd number of axes (full output included below). For comparison,
the X server on a recent-ish Linux box shows only devices with 2 axes
and doesn't trigger the bug.

George

# Output from 'xinput list' for Mac OS X 10.5.7 X server

"Virtual core keyboard" id=0    [XKeyboard]
        Num_keys is 248
        Min_keycode is 8
        Max_keycode is 255
"Virtual core pointer"  id=1    [XPointer]
        Num_buttons is 32
        Num_axes is 2
        Mode is Relative
        Motion_buffer is 256
        Axis 0 :
                Min_value is 0
                Max_value is -1
                Resolution is 0
        Axis 1 :
                Min_value is 0
                Max_value is -1
                Resolution is 0
"keyboard"      id=2    [XExtensionKeyboard]
        Num_keys is 248
        Min_keycode is 8
        Max_keycode is 255
"pointer"       id=3    [XExtensionPointer]
        Num_buttons is 7
        Num_axes is 2
        Mode is Absolute
        Motion_buffer is 256
        Axis 0 :
                Min_value is 0
                Max_value is -1
                Resolution is 0
        Axis 1 :
                Min_value is 0
                Max_value is -1
                Resolution is 0
"pen"   id=4    [XExtensionPointer]
        Num_buttons is 3
        Num_axes is 5
        Mode is Absolute
        Motion_buffer is 256
        Axis 0 :
                Min_value is 0
                Max_value is 65536
                Resolution is 1
        Axis 1 :
                Min_value is 0
                Max_value is 65536
                Resolution is 1
        Axis 2 :
                Min_value is 0
                Max_value is 65536
                Resolution is 1
        Axis 3 :
                Min_value is -65536
                Max_value is 65536
                Resolution is 1
        Axis 4 :
                Min_value is -65536
                Max_value is 65536
                Resolution is 1
"cursor"        id=5    [XExtensionPointer]
        Num_buttons is 3
        Num_axes is 5
        Mode is Absolute
        Motion_buffer is 256
        Axis 0 :
                Min_value is 0
                Max_value is 65536
                Resolution is 1
        Axis 1 :
                Min_value is 0
                Max_value is 65536
                Resolution is 1
        Axis 2 :
                Min_value is 0
                Max_value is 65536
                Resolution is 1
        Axis 3 :
                Min_value is -65536
                Max_value is 65536
                Resolution is 1
        Axis 4 :
                Min_value is -65536
                Max_value is 65536
                Resolution is 1
"eraser"        id=6    [XExtensionPointer]
        Num_buttons is 3
        Num_axes is 5
        Mode is Absolute
        Motion_buffer is 256
        Axis 0 :
                Min_value is 0
                Max_value is 65536
                Resolution is 1
        Axis 1 :
                Min_value is 0
                Max_value is 65536
                Resolution is 1
        Axis 2 :
                Min_value is 0
                Max_value is 65536
                Resolution is 1
        Axis 3 :
                Min_value is -65536
                Max_value is 65536
                Resolution is 1
        Axis 4 :
                Min_value is -65536
                Max_value is 65536
                Resolution is 1



Home | Main Index | Thread Index | Old Index