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

QtSerialPort crashes with Qt 4 when loading udev dynamically

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: 5.2.1
    • Fix Version/s: 5.3.0
    • Component/s: Serial Port
    • Labels:
      None
    • Commits:
      c0e0bd80c3876ce1f9b7db80b5873e78b94fe039

      Description

      (gdb) thread apply all backtrace

      Thread 1 (Thread 0x7ffff7fb9740 (LWP 14300)):
      #0 0x00007ffff7ddc118 in udev_list_entry_get_name () from /usr/lib/libQtSerialPort.so.1
      #1 0x00007ffff392d4c0 in ?? () from /usr/lib/libudev.so.1
      #2 0x00007ffff392dc89 in ?? () from /usr/lib/libudev.so.1
      #3 0x00007ffff392e4f0 in udev_enumerate_scan_devices () from /usr/lib/libudev.so.1
      #4 0x00007ffff7bcf04c in availablePortsByUdev () at qserialportinfo_unix.cpp:218
      #5 0x00007ffff7bcf9a1 in QSerialPortInfo::availablePorts () at qserialportinfo_unix.cpp:301
      #6 0x0000000000402191 in main (argc=1, argv=0x7fffffffe798) at main.cpp:52
      (gdb)

      What is strange is that it does not crash at the first symbol resolution: https://qt.gitorious.org/qt/qtserialport/source/336fbee2e34c7eaf48550105d542cad1979c6684:src/serialport/qserialportinfo_unix.cpp#L218

      Since the code may be modified in the future, I include the offending line in here for the report to be self-contained:

      if (enumerate) {
          ::udev_enumerate_add_match_subsystem(enumerate, "tty");
          ::udev_enumerate_scan_devices(enumerate); // <--- CRASH HERE
          struct ::udev_list_entry *devices =
              ::udev_enumerate_get_list_entry(enumerate);
      

      Here can you find the udev symbol resolution code: https://qt.gitorious.org/qt/qtserialport/source/336fbee2e34c7eaf48550105d542cad1979c6684:src/serialport/qtudev_p.h

      The only difference between Qt 4 and 6 is the void* vs. void( * )() (QFunctionPointer)

        Attachments

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

          Activity

            People

            Assignee:
            lpapp Laszlo Papp
            Reporter:
            lpapp Laszlo Papp
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes