Bug 20087 - [Patch] DeleteInputDeviceRequest function doesn't handle "virtual" devices
Summary: [Patch] DeleteInputDeviceRequest function doesn't handle "virtual" devices
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Input/Core (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Peter Hutterer
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-12 09:51 UTC by Adam Tkac
Modified: 2009-02-23 00:57 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
proposed patch (556 bytes, patch)
2009-02-12 09:51 UTC, Adam Tkac
no flags Details | Splinter Review

Description Adam Tkac 2009-02-12 09:51:08 UTC
Created attachment 22867 [details] [review]
proposed patch

Bug exists in both server-16-branch and master, server-1.5-branch works fine.

DeleteInputDeviceRequest function doesn't handle "virtual" devices well. TightVNC libvnc.so module to X (which makes bare Xorg VNC capable) uses such kind of devices.

libvnc.so devices are slave devices but they doesn't have LocalDevice structure.
Comment 1 Peter Hutterer 2009-02-12 15:04:53 UTC
I see the problem, but I'm not quite sure why it happens. How comes the xfree86's DeleteInputDeviceRequest is called on removal, but the same (i.e. xfree86) API isn't used to create the devices in the first place?
Comment 2 Adam Tkac 2009-02-13 00:37:20 UTC
Well, let me try to explain why.

Bare Xvnc (it is something like Xvfb) simply uses AddInputDevice & RegisterDevice functions. Xvnc uses DeleteInputDeviceRequest from Xi/stubs.c so everything works fine (now I see that DeleteInputDeviceRequest in Xi/stubs.c should call RemoveDevice function, shouldn't it? :) )

Situation is quite different when you use libvnc.so module. It uses same schema as Xvnc, so it simply calls AddInputDevice & RegisterDevice. Thus device is created correctly. When server is terminated it calls DeleteInputDeviceRequest (now from hw/xfree86/common/xf86Xinput.c) for each device. Here is the difference - Xvnc calls DeleteInputDeviceRequest from Xi/stubs.c as I wrote above. Thus Xorg gets sigsegv because "VNC" devices don't have real input driver.
Comment 3 Peter Hutterer 2009-02-15 19:54:26 UTC
so switching libvnc to use the right API isn't an option?
(that's an honest question, I'm trying to understand why it's using this approach)

Comment 4 Peter Hutterer 2009-02-23 00:57:53 UTC
Fix pushed as 1df6716281579e2937743d840ab1079343c503ac.


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.