Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-133962

Segmentation fault in QInputDevicePrivate::unregisterDevice when calling exit() while Wacom Tablet is plugged in

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 6.8.2
    • None
    • Operating system: Arch Linux, kernel: 6.13.3-arch1-1
      Qt version: 6.8.2
      libwacom version: 2.14.0
      Wacom tablet model: Wacom Intuos S
    • Linux/X11

    Description

      When I call libc's `exit` function while my Wacom Tablet is plugged in I receive a Segmentation fault.

      Minimal example to reproduce:

      
      #include <QApplication>
      
      int main(int argc, char** argv)  
      {  
          QApplication a(argc, argv);  
          exit(0);  
      }
      
      

      Compiled with `g++ main.cpp -I /usr/include/qt6 -I /usr/include/qt6/QtWidgets -lQt6Core -lQt6Widgets -g` this leads to a Segmentation fault but only when my tablet is plugged in.

      Using gdb I get the following backtrace:

      Thread 1 "a.out" received signal SIGSEGV, Segmentation fault.  
      QInputDevicePrivate::unregisterDevice (dev=0x5555555c5660) at /usr/src/debug/qt6-base/qtbase/src/gui/kernel/qinputdevice.cpp:360  
      360 deviceList()->removeOne(dev);  
      (gdb) backtrace  
      #0 QInputDevicePrivate::unregisterDevice (dev=0x5555555c5660) at /usr/src/debug/qt6-base/qtbase/src/gui/kernel/qinputdevice.cpp:360  
      #1 0x00007ffff59cfa1f in QInputDevice::~QInputDevice (this=<optimized out>, this=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/gui/kernel/qinputdevice.cpp:110  
      #2 QPointingDevice::~QPointingDevice (this=<optimized out>, this=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/gui/kernel/qpointingdevice.cpp:168  
      #3 0x00007ffff3450cb0 in QXcbScrollingDevice::~QXcbScrollingDevice (this=<optimized out>, this=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/plugins/platforms/xcb/qxcbscrollingdevice_p.h:29  
      #4 QXcbScrollingDevice::~QXcbScrollingDevice (this=<optimized out>, this=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/plugins/platforms/xcb/qxcbscrollingdevice_p.h:29  
      #5 0x00007ffff79a2e5e in QObject::event (this=0x5555555c5660, e=0x5555555c5680) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:1403  
      #6 0x00007ffff70ff0ca in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5555555c5660, e=0x5555555c5680) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3296  
      #7 0x00007ffff7955b00 in QCoreApplication::notifyInternal2 (receiver=0x5555555c5660, event=event@entry=0x5555555c5680) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1172  
      #8 0x00007ffff7955edc in QCoreApplication::sendEvent (receiver=<optimized out>, event=0x5555555c5680) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1612  
      #9 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=52, data=0x555555581460) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1946  
      #10 0x00007ffff7c2fc50 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=52) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1800  
      #11 operator() (__closure=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/thread/qthread_unix.cpp:403  
      #12 (anonymous namespace)::terminate_on_exception<QThreadPrivate::finish()::\{lambda()#1}>(QThreadPrivate::finish()::\{lambda()#1}&&) [clone .isra.0] (t=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/thread/qthread_unix.cpp:311  
      #13 0x00007ffff7ad8515 in set_thread_data(QThreadData*)::Cleanup::~Cleanup() () at /usr/src/debug/qt6-base/qtbase/src/corelib/thread/qthread_unix.cpp:386  
      #14 0x00007ffff6a4e391 in __run_exit_handlers (status=0, listp=0x7ffff6bf6680 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:118  
      #15 0x00007ffff6a4e46e in __GI_exit (status=<optimized out>) at exit.c:148  
      #16 0x000055555555518a in main (argc=1, argv=0x7fffffffe8d8) at main.cpp:6
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              liaqi Liang Qi
              4rneee Arne F
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes