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

QProcess breaks on ASAN

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.15.2
    • Core: I/O
    • None
    • Linux/Wayland

    Description

      QProcess behaves differently under valgrind and ASAN. After trying to figure out why some unit tests in KDE were not passing I nailed down to this.

      fuuuuuu f7 3 7fffffff 0 5 0
      ==135562== Syscall param waitid(infop) points to unaddressable byte(s)
      ==135562==    at 0x8535A9D: syscall (in /usr/lib/libc-2.33.so)
      ==135562==    by 0x53A122A: sys_waitid (forkfd_linux.c:66)
      ==135562==    by 0x53A122A: detect_clone_pidfd_support (forkfd_linux.c:126)
      ==135562==    by 0x53A122A: system_forkfd (forkfd_linux.c:142)
      ==135562==    by 0x53A122A: forkfd (forkfd.c:651)
      ==135562==    by 0x53859E9: QProcessPrivate::startProcess() (qprocess_unix.cpp:465)
      ==135562==    by 0x13B8AA: KWin::DontCrashGlxgearsTest::testGlxgears() (devel/frameworks/kwin/autotests/integration/dont_crash_glxgears.cpp:54)
      ==135562==    by 0x541B9D2: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (qmetaobject.cpp:2303)
      ==135562==    by 0x4865F52: invoke (qmetaobject.h:122)
      ==135562==    by 0x4865F52: QTest::TestMethods::invokeTestOnData(int) const (qtestcase.cpp:938)
      ==135562==    by 0x48667EB: QTest::TestMethods::invokeTest(int, char const*, QTest::WatchDog*) const (qtestcase.cpp:1166)
      ==135562==    by 0x4866D63: QTest::TestMethods::invokeTests(QObject*) const (qtestcase.cpp:1507)
      ==135562==    by 0x486720D: QTest::qRun() (qtestcase.cpp:1934)
      ==135562==    by 0x486759B: QTest::qExec(QObject*, int, char**) (qtestcase.cpp:1842)
      ==135562==    by 0x13C07D: main (devel/frameworks/kwin/autotests/integration/dont_crash_glxgears.cpp:94)
      ==135562==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
      ==135562== 
      ==135639== Warning: invalid file descriptor 4354 in syscall clone()
      
      valgrind: m_syswrap/syswrap-main.c:1957 (vgPlain_client_syscall): Assertion '0 == (sci->flags & ~(SfMayBlock | SfPostOnFail | SfPollAfter))' failed.
      
      host stacktrace:
      ==135639==    at 0x58041B2A: show_sched_status_wrk (m_libcassert.c:406)
      ==135639==    by 0x58041C47: report_and_quit (m_libcassert.c:477)
      ==135639==    by 0x58041DD7: vgPlain_assert_fail (m_libcassert.c:543)
      ==135639==    by 0x5809AB4F: vgPlain_client_syscall (syswrap-main.c:1980)
      ==135639==    by 0x5809617A: handle_syscall (scheduler.c:1208)
      ==135639==    by 0x58098177: vgPlain_scheduler (scheduler.c:1526)
      ==135639==    by 0x580E38D0: thread_wrapper (syswrap-linux.c:101)
      ==135639==    by 0x580E38D0: run_a_thread_NORETURN (syswrap-linux.c:154)
      
      sched status:
        running_tid=1
      
      Thread 1: status = VgTs_Runnable syscall 56 (lwpid 135639)
      ==135639==    at 0x8535A9D: syscall (in /usr/lib/libc-2.33.so)
      ==135639==    by 0x53A1188: sys_clone (forkfd_linux.c:89)
      ==135639==    by 0x53A1188: system_forkfd (forkfd_linux.c:152)
      ==135639==    by 0x53A1188: forkfd (forkfd.c:651)
      ==135639==    by 0x53859E9: QProcessPrivate::startProcess() (qprocess_unix.cpp:465)
      ==135639==    by 0x13B8AA: KWin::DontCrashGlxgearsTest::testGlxgears() (devel/frameworks/kwin/autotests/integration/dont_crash_glxgears.cpp:54)
      ==135639==    by 0x541B9D2: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (qmetaobject.cpp:2303)
      ==135639==    by 0x4865F52: invoke (qmetaobject.h:122)
      ==135639==    by 0x4865F52: QTest::TestMethods::invokeTestOnData(int) const (qtestcase.cpp:938)
      ==135639==    by 0x48667EB: QTest::TestMethods::invokeTest(int, char const*, QTest::WatchDog*) const (qtestcase.cpp:1166)
      ==135639==    by 0x4866D63: QTest::TestMethods::invokeTests(QObject*) const (qtestcase.cpp:1507)
      ==135639==    by 0x486720D: QTest::qRun() (qtestcase.cpp:1934)
      ==135639==    by 0x486759B: QTest::qExec(QObject*, int, char**) (qtestcase.cpp:1842)
      ==135639==    by 0x13C07D: main (devel/frameworks/kwin/autotests/integration/dont_crash_glxgears.cpp:94)
      client stack range: [0x1FFEFE6000 0x1FFF000FFF] client SP: 0x1FFEFFF1B8
      valgrind stack range: [0x1002EBA000 0x1002FB9FFF] top usage: 19024 of 1048576
      

      I attached a test that reproduces this same issue when run with valgrind. Hope it helps.

      Attachments

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              apol Aleix Pol
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes