1*4882a593SmuzhiyunFrom 29665ab1a97bb0ca4b74275f5526e9afe09ccc64 Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Martin Jansa <Martin.Jansa@gmail.com>
3*4882a593SmuzhiyunDate: Tue, 18 Dec 2018 17:38:21 +0000
4*4882a593SmuzhiyunSubject: [PATCH] VirtualboxTouchScreenHandler initialize m_mouse
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun* make sure m_mouse is initialized for cases where shutdown is called before:
7*4882a593Smuzhiyun  m_mouse = EvdevMouseHandler::create(evdev_device, specification);
8*4882a593Smuzhiyun  e.g. with following ioctl fails with vboxguest driver from vanila 4.19 kernel:
9*4882a593Smuzhiyun  ioctl(m_fd, _IOWR('V', 10, features), &features);
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun* fixes following crash:
12*4882a593Smuzhiyun(gdb) set args -plugin evdevkeyboard -plugin vboxtouch
13*4882a593Smuzhiyun(gdb) r
14*4882a593SmuzhiyunStarting program: /usr/sbin/luna-next -plugin evdevkeyboard -plugin vboxtouch
15*4882a593Smuzhiyunwarning: File "/usr/lib/libstdc++.so.6.0.25-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
16*4882a593SmuzhiyunTo enable execution of this file add
17*4882a593Smuzhiyun        add-auto-load-safe-path /usr/lib/libstdc++.so.6.0.25-gdb.py
18*4882a593Smuzhiyunline to your configuration file "/media/internal/.gdbinit".
19*4882a593SmuzhiyunTo completely disable this security protection add
20*4882a593Smuzhiyun        set auto-load safe-path /
21*4882a593Smuzhiyunline to your configuration file "/media/internal/.gdbinit".
22*4882a593SmuzhiyunFor more information about this security protection see the
23*4882a593Smuzhiyun"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
24*4882a593Smuzhiyun        info "(gdb)Auto-loading safe path"
25*4882a593Smuzhiyun[Thread debugging using libthread_db enabled]
26*4882a593SmuzhiyunUsing host libthread_db library "/lib/libthread_db.so.1".
27*4882a593Smuzhiyun** Message: 17:05:20.472: App to allow in Low memory: org.webosports.app.phone
28*4882a593Smuzhiyun** Message: 17:05:20.479: App to allow in Low memory: org.webosports.app.contacts
29*4882a593Smuzhiyun** Message: 17:05:20.479: App to allow in Low memory: org.webosports.app.messaging
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun** (process:993): WARNING **: 17:05:20.485: Settings::load(): 6 application paths defined:
32*4882a593Smuzhiyun** Message: 17:05:20.487: Running on authenticamd with hardware type emulator
33*4882a593Smuzhiyunpci id for fd 7: 80ee:beef, driver (null)
34*4882a593SmuzhiyunBFD: error: /usr/lib/llvm6.0/.debug/libLLVM-6.0.so(.debug_info) is too large (0x2a793ad1 bytes)
35*4882a593Smuzhiyunwarning: Can't read data for section '.debug_info' in file '/usr/lib/llvm6.0/.debug/libLLVM-6.0.so'
36*4882a593Smuzhiyun[New Thread 0xafe21b40 (LWP 997)]
37*4882a593Smuzhiyun[New Thread 0xaf620b40 (LWP 998)]
38*4882a593SmuzhiyunBFD: error: /usr/lib/.debug/libQt5Quick.so.5.11.3(.debug_info) is too large (0x5a05c4d bytes)
39*4882a593Smuzhiyunwarning: Can't read data for section '.debug_info' in file '/usr/lib/.debug/libQt5Quick.so.5.11.3'
40*4882a593SmuzhiyunDEBUG: 17:05:39.393: vboxtouch: Using vbox device /dev/vboxguest
41*4882a593SmuzhiyunWARNING: 17:05:39.402: vboxtouch setpointershape: ioctl error: Invalid argument
42*4882a593SmuzhiyunWARNING: 17:05:39.403: vboxtouch init: ioctl error: Invalid argument
43*4882a593SmuzhiyunDEBUG: 17:05:39.403: shutting down vboxtouch
44*4882a593Smuzhiyun
45*4882a593SmuzhiyunThread 1 "luna-next" received signal SIGSEGV, Segmentation fault.
46*4882a593Smuzhiyun0xaee18e1c in VirtualboxTouchScreenHandler::shutdown (this=0x80da570) at /usr/src/debug/qt5-plugin-generic-vboxtouch/1.1.4+gitrAUTOINC+3f2bdb5a1d-r0/git/vboxtouch/vboxtouch.cpp:179
47*4882a593Smuzhiyun179             delete m_mouse;
48*4882a593Smuzhiyun(gdb) bt
49*4882a593Smuzhiyun #0  0xaee18e1c in VirtualboxTouchScreenHandler::shutdown (this=0x80da570) at /usr/src/debug/qt5-plugin-generic-vboxtouch/1.1.4+gitrAUTOINC+3f2bdb5a1d-r0/git/vboxtouch/vboxtouch.cpp:179
50*4882a593Smuzhiyun #1  0xaee19319 in VirtualboxTouchScreenHandler::VirtualboxTouchScreenHandler (this=0x80da570, specification=..., parent=0x0) at /usr/src/debug/qt5-plugin-generic-vboxtouch/1.1.4+gitrAUTOINC+3f2bdb5a1d-r0/git/vboxtouch/vboxtouch.cpp:122
51*4882a593Smuzhiyun #2  0xaee1877b in VirtualboxTouchScreenPlugin::create (this=0x80d7a30, key=..., specification=...) at /usr/src/debug/qt5-plugin-generic-vboxtouch/1.1.4+gitrAUTOINC+3f2bdb5a1d-r0/git/vboxtouch/main.cpp:51
52*4882a593Smuzhiyun #3  0xb7afc6c1 in qLoadPlugin<QObject, QGenericPlugin, QString const&> (key=..., loader=<optimized out>) at ../../include/QtCore/../../../git/src/corelib/kernel/qobject.h:499
53*4882a593Smuzhiyun
54*4882a593SmuzhiyunSigned-off-by: Martin Jansa <Martin.Jansa@gmail.com>
55*4882a593SmuzhiyunUpstream-Status: Pending
56*4882a593Smuzhiyun---
57*4882a593Smuzhiyun vboxtouch/vboxtouch.cpp | 2 +-
58*4882a593Smuzhiyun 1 file changed, 1 insertion(+), 1 deletion(-)
59*4882a593Smuzhiyun
60*4882a593Smuzhiyundiff --git a/vboxtouch/vboxtouch.cpp b/vboxtouch/vboxtouch.cpp
61*4882a593Smuzhiyunindex 6e0aac8..345fdcb 100644
62*4882a593Smuzhiyun--- a/vboxtouch/vboxtouch.cpp
63*4882a593Smuzhiyun+++ b/vboxtouch/vboxtouch.cpp
64*4882a593Smuzhiyun@@ -82,7 +82,7 @@ const static vbox_mouse_status_request blank_mouse_status_request = {
65*4882a593Smuzhiyun #define VBOXMOUSE_IS_ABSOLUTE 2
66*4882a593Smuzhiyun
67*4882a593Smuzhiyun VirtualboxTouchScreenHandler::VirtualboxTouchScreenHandler(const QString &specification, QObject *parent)
68*4882a593Smuzhiyun-    : QObject(parent), m_fd(-1), m_notifier(0), m_device(0), m_failures(0),
69*4882a593Smuzhiyun+    : QObject(parent), m_fd(-1), m_notifier(0), m_device(0), m_failures(0), m_mouse(0),
70*4882a593Smuzhiyun       m_button(false), m_x(0), m_y(0)
71*4882a593Smuzhiyun {
72*4882a593Smuzhiyun     setObjectName("Virtualbox Touch Handler");
73*4882a593Smuzhiyun--
74*4882a593Smuzhiyun2.17.1
75*4882a593Smuzhiyun
76