"QThread: Destroyed while thread is still running" printed on shutdown

Bug #1508485 reported by Gerry Boland
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Low
kevin gunn
unity8 (Ubuntu)
Fix Released
Low
Albert Astals Cid

Bug Description

Sending SIGTERM to unity8 causes this slightly concerning error message to be printed:

QThread: Destroyed while thread is still running

Going a quick dig, I see it came from DashCommunicator:

(gdb) break src/corelib/thread/qthread.cpp:417
Breakpoint 1 at 0x7fafce6bd935: file thread/qthread.cpp, line 417.
(gdb) cont
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x00007fafcddb98dd in poll () at ../sysdeps/unix/syscall-template.S:81
81 in ../sysdeps/unix/syscall-template.S
(gdb) signal SIGTERM
Continuing with signal SIGTERM.

Breakpoint 1, QThread::~QThread (this=0x203d1f0, __in_chrg=<optimized out>) at thread/qthread.cpp:417
417 thread/qthread.cpp: No such file or directory.
(gdb) t
[Current thread is 1 (Thread 0x7fafcfcaf800 (LWP 19100))]
(gdb) info threads
  Id Target Id Frame
  23 Thread 0x7fafc178b700 (LWP 19101) "unity8" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
  22 Thread 0x7fafc0f8a700 (LWP 19102) "unity8" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
  21 Thread 0x7fafbbfff700 (LWP 19103) "MirServerThread" 0x00007fafcddb98dd in poll () at ../sysdeps/unix/syscall-template.S:81
  20 Thread 0x7fafbb7fe700 (LWP 19104) "RPC Thread" 0x00007fafcddb98dd in poll () at ../sysdeps/unix/syscall-template.S:81
  19 Thread 0x7fafb951d700 (LWP 19105) "MirServerThread" pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  18 Thread 0x7fafb8ac0700 (LWP 19106) "Input dispatch" 0x00007fafcddb98dd in poll () at ../sysdeps/unix/syscall-template.S:81
  17 Thread 0x7fafaa0db700 (LWP 19107) "Mir/Snapshot" pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  16 Thread 0x7fafa98da700 (LWP 19108) "Mir/IPC" 0x00007fafcddc54f3 in epoll_wait () at ../sysdeps/unix/syscall-template.S:81
  15 Thread 0x7fafa90d9700 (LWP 19109) "Mir/IPC" 0x00007fafcddc54f3 in epoll_wait () at ../sysdeps/unix/syscall-template.S:81
  14 Thread 0x7faf9db6d700 (LWP 19110) "QQmlThread" 0x00007fafcddb98dd in poll () at ../sysdeps/unix/syscall-template.S:81
  13 Thread 0x7faf8de65700 (LWP 19111) "gmain" 0x00007fafcddb98dd in poll () at ../sysdeps/unix/syscall-template.S:81
  12 Thread 0x7faf85664700 (LWP 19112) "gdbus" 0x00007fafcbceea91 in g_variant_type_info_check (
    info=info@entry=0x7fafcbd504b0 <g_variant_type_info_basic_table+368>, container_class=container_class@entry=0 '\000')
    at /build/glib2.0-ajuDY6/glib2.0-2.46.1/./glib/gvarianttypeinfo.c:158
  11 Thread 0x7faf8d3ff700 (LWP 19113) "dconf worker" 0x00007fafcddb98dd in poll () at ../sysdeps/unix/syscall-template.S:81
  10 Thread 0x7faf7eba6700 (LWP 19114) "dashCommunicato" 0x00007fafcddb98dd in poll () at ../sysdeps/unix/syscall-template.S:81
  9 Thread 0x7faf73fff700 (LWP 19115) "unity8" 0x00007fafcddc54f3 in epoll_wait () at ../sysdeps/unix/syscall-template.S:81
  8 Thread 0x7faf735f9700 (LWP 19118) "unity8" pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  7 Thread 0x7faf71dd9700 (LWP 19119) "Qt bearer threa" 0x00007fafcddb98dd in poll () at ../sysdeps/unix/syscall-template.S:81
  6 Thread 0x7faf63fff700 (LWP 19121) "QQuickPixmapRea" 0x00007fafcddb98dd in poll () at ../sysdeps/unix/syscall-template.S:81
  5 Thread 0x7faf615ad700 (LWP 19123) "Thread (pooled)" pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  4 Thread 0x7faf5ffa0700 (LWP 19124) "QThread" 0x00007fafcddb98dd in poll () at ../sysdeps/unix/syscall-template.S:81
  3 Thread 0x7faf5f79f700 (LWP 19125) "QProcessManager" 0x00007fafcddbb743 in select () at ../sysdeps/unix/syscall-template.S:81
  2 Thread 0x7faf5ef5e700 (LWP 19135) "QSGRenderThread" pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
* 1 Thread 0x7fafcfcaf800 (LWP 19100) "unity8" QThread::~QThread (this=0x203d1f0, __in_chrg=<optimized out>)
    at thread/qthread.cpp:417

(gdb) bt
#0 0x00007fafce6bd935 in QThread::~QThread() (this=0x203d1f0, __in_chrg=<optimized out>) at thread/qthread.cpp:417
#1 0x00007faf845e5ef2 in () at /usr/lib/x86_64-linux-gnu/unity8/qml/Unity/DashCommunicator/libDashCommunicator-qml.so
#2 0x00007fafce8d1d2b in QObjectPrivate::deleteChildren() (this=this@entry=0x2033f40) at kernel/qobject.cpp:1950
#3 0x00007fafce8db620 in QObject::~QObject() (this=<optimized out>, __in_chrg=<optimized out>) at kernel/qobject.cpp:1030
#4 0x00007fafcf5b52bd in QQuickItem::~QQuickItem() (this=0x2033f10, __in_chrg=<optimized out>) at items/qquickitem.cpp:2223
#5 0x00007fafcf5cf7c6 in QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement() (this=0x2033f10, __in_chrg=<optimized out>)
    at ../../include/QtQml/../../src/qml/qml/qqmlprivate.h:98
#6 0x00007fafcf5cf7c6 in QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement() (this=0x2033f10, __in_chrg=<optimized out>)
    at ../../include/QtQml/../../src/qml/qml/qqmlprivate.h:98
#7 0x00007fafce8d1d2b in QObjectPrivate::deleteChildren() (this=this@entry=0x2017c10) at kernel/qobject.cpp:1950
#8 0x00007fafce8db620 in QObject::~QObject() (this=<optimized out>, __in_chrg=<optimized out>) at kernel/qobject.cpp:1030
#9 0x00007fafcf5b52bd in QQuickItem::~QQuickItem() (this=0x2015e10, __in_chrg=<optimized out>) at items/qquickitem.cpp:2223
#10 0x00007fafcf5cf86e in QQmlPrivate::QQmlElement<QQuickRectangle>::~QQmlElement() (this=0x2015e10, __in_chrg=<optimized out>)
    at items/qquickrectangle_p.h:128
#11 0x00007fafcf5cf86e in QQmlPrivate::QQmlElement<QQuickRectangle>::~QQmlElement() (this=0x2015e10, __in_chrg=<optimized out>)
    at ../../include/QtQml/../../src/qml/qml/qqmlprivate.h:98
#12 0x00007fafcf5cf86e in QQmlPrivate::QQmlElement<QQuickRectangle>::~QQmlElement() (this=0x2015e10, __in_chrg=<optimized out>)
    at ../../include/QtQml/../../src/qml/qml/qqmlprivate.h:98
#13 0x00007fafcf66b1aa in QQuickView::~QQuickView() (this=0x1f8ff70, __in_chrg=<optimized out>) at items/qquickview.cpp:225
#14 0x000000000040fade in ()
#15 0x000000000040a123 in ()
#16 0x0000000000406374 in ()
#17 0x00007fafcdcdea40 in __libc_start_main (main=
    0x4062f0, argc=1, argv=0x7ffe2523b688, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe2523b678) at libc-start.c:289
#18 0x0000000000406419 in _start ()

Related branches

Revision history for this message
Gerry Boland (gerboland) wrote :

DashCommunicator inherits QThread. From the QThread docs:

"Note that deleting a QThread object will not stop the execution of the thread it manages. Deleting a running QThread (i.e. isFinished() returns false) will probably result in a program crash. Wait for the finished() signal before deleting the QThread."

So to fix this, need to refactor DashCommunicator a bit to only delete the QThread after the thread's finished() signal has fired.

Changed in unity8 (Ubuntu):
assignee: nobody → Albert Astals Cid (aacid)
status: New → In Progress
Changed in canonical-devices-system-image:
status: New → Fix Committed
importance: Undecided → Low
assignee: nobody → kevin gunn (kgunn72)
milestone: none → ww02-2016
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity8 - 8.11+16.04.20160111.1-0ubuntu1

---------------
unity8 (8.11+16.04.20160111.1-0ubuntu1) xenial; urgency=medium

  [ Albert Astals Cid ]
  * Clear fake item icon name as soon as it goes invisible (LP:
    #1531172)
  * Fix LVWPH test failing on Xenial (Qt 5.5)
  * Fix dragging so that test passes on Xenial
  * Fix focus on the dash page header text field with new SDK (LP:
    #1528178)
  * Make the card creator test pass again
  * Quit the dash communicator thread before destroying it (LP:
    #1508485)
  * Remove duplicated override_dh_auto_clean
  * SDK changed the name they give to the buttons, follow

  [ Andrea Cimitan ]
  * Fix a broken binding

  [ CI Train Bot ]
  * Resync trunk.
  * Update translation template

  [ Daniel d'Andrada ]
  * Have "make tryFoo" work with Qt 5.5
  * Make DragHandle tests run again.

  [ Lukáš Tinkl ]
  * Fix dismissing the launcher when clicking/tapping outside (LP:
    #1531339, #1530940)
  * Fix panel drop shadow and click-to-focus of maximized apps (LP:
    #1531854)
  * Fix wifi access point indicator items signal strength icon on
    desktop

  [ Michael Terry ]
  * Guard against a couple odd timing scenarios for the too-many-failed-
    login-attempts lockout screen.
  * Skip the wizard's password screens if there is already a password
    set by other means. (LP: #1531268)
  * Stop the emergency dialer from accidentally exposing the mtp
    service. (LP: #1525981)

  [ Michael Zanetti ]
  * Make sure the triangle of the quicklist is in bounds (LP: #1531340)

  [ Pawel Stolowski ]
  * Changes 'shareData' and 'contentType' attributes to 'share-data' and
    'content-type', to match existing naming schema.

 -- Michał Sawicz <email address hidden> Mon, 11 Jan 2016 17:38:49 +0000

Changed in unity8 (Ubuntu):
status: In Progress → Fix Released
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.