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

AddressSanitizer: new-delete-type-mismatch in tst_QSensor::testReadingBC()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.5.0, 6.6.0
    • 6.5
    • Sensors
    • Linux/X11
    • 5912c9f28 (dev), 3c127ef12 (6.5)

    Description

      Configure with -sanitize address, build and then run tst_qsensor. Here is the output:

      ********* Start testing of tst_QSensor *********
      Config: Using QtTest library 6.5.0, Qt 6.5.0 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 9.3.1 20200406 [revision 6db837a5288ee3ca5ec504fbd5a765817e556ac2]), opensuse-leap 15.3
      PASS   : tst_QSensor::initTestCase()
      PASS   : tst_QSensor::testRecursiveLoadPlugins()
      PASS   : tst_QSensor::testTypeRegistered()
      PASS   : tst_QSensor::testSensorRegistered()
      PASS   : tst_QSensor::testSensorDefault()
      PASS   : tst_QSensor::testBadDefaultFromConfig()
      PASS   : tst_QSensor::testGoodDefaultFromConfig()
      PASS   : tst_QSensor::testNoSensorsForType()
      PASS   : tst_QSensor::testNoDefaultForType()
      PASS   : tst_QSensor::testCreation()
      PASS   : tst_QSensor::testSetIdentifierFail()
      PASS   : tst_QSensor::testBadDefaultCreation()
      PASS   : tst_QSensor::testBadCreation()
      QWARN  : tst_QSensor::testTimestamp() Can't create backend "test sensor 2"
      PASS   : tst_QSensor::testTimestamp()
      QWARN  : tst_QSensor::testStart() Can't create backend "test sensor 2"
      PASS   : tst_QSensor::testStart()
      PASS   : tst_QSensor::testBadStart()
      QWARN  : tst_QSensor::testStop() Can't create backend "test sensor 2"
      PASS   : tst_QSensor::testStop()
      QWARN  : tst_QSensor::testMetaData() Can't create backend "test sensor 2"
      QWARN  : tst_QSensor::testMetaData() Can't create backend "test sensor 2"
      QWARN  : tst_QSensor::testMetaData() Can't create backend "test sensor 2"
      QWARN  : tst_QSensor::testMetaData() Can't create backend "test sensor 2"
      QWARN  : tst_QSensor::testMetaData() Can't create backend "test sensor 2"
      QWARN  : tst_QSensor::testMetaData() Can't create backend "test sensor 2"
      QWARN  : tst_QSensor::testMetaData() Can't create backend "test sensor 2"
      QWARN  : tst_QSensor::testMetaData() Can't create backend "test sensor 2"
      QWARN  : tst_QSensor::testMetaData() Can't create backend "test sensor 2"
      PASS   : tst_QSensor::testMetaData()
      QWARN  : tst_QSensor::testFilter() Can't create backend "test sensor 2"
      PASS   : tst_QSensor::testFilter()
      QWARN  : tst_QSensor::testFilter2() Can't create backend "test sensor 2"
      PASS   : tst_QSensor::testFilter2()
      QWARN  : tst_QSensor::testFilter3() Can't create backend "test sensor 2"
      PASS   : tst_QSensor::testFilter3()
      QWARN  : tst_QSensor::testStart2() Can't create backend "test sensor 2"
      PASS   : tst_QSensor::testStart2()
      QWARN  : tst_QSensor::testSetBadDataRate() Can't create backend "test sensor 2"
      PASS   : tst_QSensor::testSetBadDataRate()
      QWARN  : tst_QSensor::testSetBadDataRateWhenNotConnected() Can't create backend "test sensor 2"
      PASS   : tst_QSensor::testSetBadDataRateWhenNotConnected()
      QWARN  : tst_QSensor::testSetBadOutputRange() Can't create backend "test sensor 2"
      PASS   : tst_QSensor::testSetBadOutputRange()
      QWARN  : tst_QSensor::testSetBadOutputRangeWhenNotConnected() Can't create backend "test sensor 2"
      PASS   : tst_QSensor::testSetBadOutputRangeWhenNotConnected()
      PASS   : tst_QSensor::testEnumHandling()
      PASS   : tst_QSensor::testDynamicDefaultsAndGenericHandling()
      PASS   : tst_QSensor::testCreation2()
      PASS   : tst_QSensor::testSensorsChangedSignal()
      QWARN  : tst_QSensor::testSetActive() Can't create backend "test sensor 2"
      PASS   : tst_QSensor::testSetActive()
      PASS   : tst_QSensor::testAlwaysOn()
      PASS   : tst_QSensor::testIsRegistered()
      PASS   : tst_QSensor::testAllTheInterfaces()
      =================================================================
      ==7772==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x602000003730 in thread T0:
        object passed to delete has wrong type:
        size of the allocated type:   16 bytes;
        size of the deallocated type: 8 bytes.
          #0 0x7f92d7af1e45 in operator delete(void*, unsigned long) (/usr/lib64/libasan.so.5+0x10ce45)
          #1 0x7f92d73d9c40  (/home/qt/work/install/lib/libQt6Sensors.so.6+0x87c40)
          #2 0x7f92d73d933b  (/home/qt/work/install/lib/libQt6Sensors.so.6+0x8733b)
          #3 0x7f92d73d7fcc in QSensorReading::~QSensorReading() (/home/qt/work/install/lib/libQt6Sensors.so.6+0x85fcc)
          #4 0x42ba1c in TestSensor2Reading::~TestSensor2Reading() /home/qt/work/qt/qtsensors/tests/auto/qsensor/test_sensor2.cpp:29
          #5 0x42cb24 in testsensor2impl::~testsensor2impl() /home/qt/work/qt/qtsensors/tests/auto/qsensor/test_sensor2impl.h:10
          #6 0x42cb4b in testsensor2impl::~testsensor2impl() /home/qt/work/qt/qtsensors/tests/auto/qsensor/test_sensor2impl.h:10
          #7 0x7f92d73d613b in QSensor::~QSensor() (/home/qt/work/install/lib/libQt6Sensors.so.6+0x8413b)
          #8 0x42c17c in TestSensor2::~TestSensor2() /home/qt/work/qt/qtsensors/tests/auto/qsensor/test_sensor2.h:66
          #9 0x44ad1e in tst_QSensor::testReadingBC() /home/qt/work/qt/qtsensors/tests/auto/qsensor/tst_qsensor.cpp:877
          #10 0x431802 in tst_QSensor::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) tests/auto/qsensor/tst_qsensor_autogen/include/tst_qsensor.moc:394
          #11 0x7f92d627035e in QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (/home/qt/work/install/lib/libQt6Core.so.6+0x40d35e)
          #12 0x7f92d76e499c  (/home/qt/work/install/lib/libQt6Test.so.6+0xab99c)
          #13 0x7f92d76c7a60  (/home/qt/work/install/lib/libQt6Test.so.6+0x8ea60)
          #14 0x7f92d76ca47a  (/home/qt/work/install/lib/libQt6Test.so.6+0x9147a)
          #15 0x7f92d76cdc2e  (/home/qt/work/install/lib/libQt6Test.so.6+0x94c2e)
          #16 0x7f92d76d0d2a in QTest::qRun() (/home/qt/work/install/lib/libQt6Test.so.6+0x97d2a)
          #17 0x7f92d76cfaab in QTest::qExec(QObject*, int, char**) (/home/qt/work/install/lib/libQt6Test.so.6+0x96aab)
          #18 0x431481 in main /home/qt/work/qt/qtsensors/tests/auto/qsensor/tst_qsensor.cpp:977
          #19 0x7f92d4f2634c in __libc_start_main (/lib64/libc.so.6+0x2534c)
          #20 0x410909 in _start (/home/qt/work/qt/qtsensors_standalone_tests/tests/auto/qsensor/tst_qsensor+0x410909)
      
      0x602000003730 is located 0 bytes inside of 16-byte region [0x602000003730,0x602000003740)
      allocated by thread T0 here:
          #0 0x7f92d7af09bf in operator new(unsigned long) (/usr/lib64/libasan.so.5+0x10b9bf)
          #1 0x42b960 in TestSensor2Reading::TestSensor2Reading(QObject*) /home/qt/work/qt/qtsensors/tests/auto/qsensor/test_sensor2.cpp:29
          #2 0x42c5c8 in testsensor2impl::testsensor2impl(QSensor*) /home/qt/work/qt/qtsensors/tests/auto/qsensor/test_sensor2impl.cpp:11
          #3 0x42f803 in TestSensorPlugin::createBackend(QSensor*) /home/qt/work/qt/qtsensors/tests/auto/qsensor/test_sensorplugin.cpp:64
          #4 0x7f92d73ad961 in QSensorManager::createBackend(QSensor*) (/home/qt/work/install/lib/libQt6Sensors.so.6+0x5b961)
          #5 0x7f92d73d6635 in QSensor::connectToBackend() (/home/qt/work/install/lib/libQt6Sensors.so.6+0x84635)
          #6 0x7f92d73d6cad in QSensor::start() (/home/qt/work/install/lib/libQt6Sensors.so.6+0x84cad)
          #7 0x44a9d5 in tst_QSensor::testReadingBC() /home/qt/work/qt/qtsensors/tests/auto/qsensor/tst_qsensor.cpp:868
          #8 0x431802 in tst_QSensor::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) tests/auto/qsensor/tst_qsensor_autogen/include/tst_qsensor.moc:394
          #9 0x7f92d627035e in QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (/home/qt/work/install/lib/libQt6Core.so.6+0x40d35e)
          #10 0x7f92d76e499c  (/home/qt/work/install/lib/libQt6Test.so.6+0xab99c)
          #11 0x7f92d76c7a60  (/home/qt/work/install/lib/libQt6Test.so.6+0x8ea60)
          #12 0x7f92d76ca47a  (/home/qt/work/install/lib/libQt6Test.so.6+0x9147a)
          #13 0x7f92d76cdc2e  (/home/qt/work/install/lib/libQt6Test.so.6+0x94c2e)
          #14 0x7f92d76d0d2a in QTest::qRun() (/home/qt/work/install/lib/libQt6Test.so.6+0x97d2a)
          #15 0x7f92d76cfaab in QTest::qExec(QObject*, int, char**) (/home/qt/work/install/lib/libQt6Test.so.6+0x96aab)
          #16 0x431481 in main /home/qt/work/qt/qtsensors/tests/auto/qsensor/tst_qsensor.cpp:977
          #17 0x7f92d4f2634c in __libc_start_main (/lib64/libc.so.6+0x2534c)
      
      SUMMARY: AddressSanitizer: new-delete-type-mismatch (/usr/lib64/libasan.so.5+0x10ce45) in operator delete(void*, unsigned long)
      ==7772==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0
      ==7772==ABORTING
      

      Attachments

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

        Activity

          People

            vuokko Juha Vuolle
            jimis Dimitrios Apostolou
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes