Bug 394627 - Unable to use with Mudlet
Summary: Unable to use with Mudlet
Status: RESOLVED WORKSFORME
Alias: None
Product: Heaptrack
Classification: Applications
Component: general (other bugs)
Version First Reported In: 1.1.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Milian Wolff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-23 17:43 UTC by Vadim Peretokin
Modified: 2022-12-26 05:20 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vadim Peretokin 2018-05-23 17:43:09 UTC
I tried heaptrack out in Mudlet (https://github.com/mudlet/mudlet) but it never loads past the splashscreen. It runs fine in Valgrind though.
Comment 1 Milian Wolff 2018-05-23 20:15:44 UTC
Can you try to debug this and see what happens? I.e. attach a debugger when it hangs and get me a full backtrace for all threads?

Otherwise, can you add information for me to reproduce this issue? Do I just run mudlet? Do I need some parameters or input files?
Comment 2 Vadim Peretokin 2018-05-24 03:40:27 UTC
Just running Mudlet is enough.

Heaptracks backtrace is not that interesting:

1  wait4             syscall-template.S 78  0x7fbfefa7d76a 
2  ??                                       0x560fe3ef58a0 
3  ??                                       0x560fe3ef709d 
4  ??                                       0x560fe3ef16d8 
5  ??                                       0x560fe3ef049e 
6  ??                                       0x560fe3ef049e 
7  ??                                       0x560fe3ef049e 
8  ??                                       0x560fe3ef766e 
9  ??                                       0x560fe3eee9de 
10 __libc_start_main libc-start.c       310 0x7fbfef9bab97 
11 ??                                       0x560fe3eeea4a
Comment 3 Vadim Peretokin 2018-05-24 03:41:49 UTC
Mudlets backtrace is the following:

1   __lll_lock_wait                                                       lowlevellock.S       135 0x7fdd7848d10d 
2   __GI___pthread_mutex_lock                                             pthread_mutex_lock.c 78  0x7fdd78486023 
3   heaptrack_free                                                                                 0x7fdd7bb02313 
4   free                                                                                           0x7fdd7bb00e06 
5   debug_free(void *, const char *, int)                                                          0x4e21b5       
6   operator delete(void *)                                                                        0x4e225f       
7   QObject::~QObject()                                                                            0x7fdd78be7858 
8   ??                                                                                             0x7fdd58267074 
9   QObjectPrivate::deleteChildren()                                                               0x7fdd78bde19b 
10  QObject::~QObject()                                                                            0x7fdd78be79cb 
11  ??                                                                                             0x7fdd58277e79 
12  ??                                                                                             0x7fdd5825714b 
13  QNetworkConfigurationManagerPrivate::updateConfigurations()                                    0x7fdd7933143a 
14  QNetworkConfigurationManagerPrivate::initialize()                                              0x7fdd79331dae 
15  qNetworkConfigurationManagerPrivate()                                                          0x7fdd7932bfdd 
16  QNetworkConfigurationManager::QNetworkConfigurationManager(QObject *)                          0x7fdd7932c077 
17  QNetworkAccessManager::QNetworkAccessManager(QObject *)                                        0x7fdd792ba096 
18  cTelnet::cTelnet(Host *)                                                                       0x582f6b       
19  Host::Host(int, QString const&, QString const&, QString const&, int)                           0x69c520       
20  HostManager::addHost(QString, QString, QString, QString)                                       0x6ad33e       
... <More>                                                                                                        


It looks like a deadlock.
Comment 4 Milian Wolff 2018-05-24 11:57:02 UTC
Yes, attach to mudlet and then get the output for the following GDB command:

thread apply all bt

Please paste that here then
Comment 5 Vadim Peretokin 2018-05-24 13:09:13 UTC
(gdb) attach 19809
Attaching to process 19809
[New LWP 19812]
[New LWP 19813]
[New LWP 19815]
[New LWP 19816]
[New LWP 19817]
[New LWP 19818]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
38	../sysdeps/unix/sysv/linux/x86_64/syscall.S: No such file or directory.
(gdb) thread apply all bt

Thread 7 (Thread 0x7ffa18b74700 (LWP 19818)):
#0  0x00007ffa322b8afd in __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1  0x00007ffa322b119d in __GI___pthread_mutex_lock (mutex=0x7ffa35f77440 <(anonymous namespace)::HeapTrack::s_lock>) at ../nptl/pthread_mutex_lock.c:80
#2  0x00007ffa35d6d313 in heaptrack_free () at /tmp/.mount_heaptrwI0A5y/opt/lib/heaptrack/libheaptrack_preload.so
#3  0x00007ffa35d6be06 in free () at /tmp/.mount_heaptrwI0A5y/opt/lib/heaptrack/libheaptrack_preload.so
#4  0x00000000004ee3ae in debug_free(void*, char const*, int) (p=0x2d3e540, file=0xa3fe67 "unknown", line=0)
    at ../3rdparty/edbee-lib/edbee-lib/edbee/util/mem/debug_new.cpp:67
#5  0x00000000004ee47e in operator delete(void*) (p=0x2d3e540) at ../3rdparty/edbee-lib/edbee-lib/edbee/util/mem/debug_new.cpp:90
#6  0x00007ffa329cd299 in  () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Core.so.5
#7  0x00007ffa329c8989 in QMetaType::destroy(int, void*) () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Core.so.5
#8  0x00007ffa329dbe39 in QMetaCallEvent::~QMetaCallEvent() () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Core.so.5
#9  0x00007ffa329dbeb9 in QMetaCallEvent::~QMetaCallEvent() () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Core.so.5
#10 0x00007ffa329b6687 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Core.so.5
#11 0x00007ffa32a07d13 in  () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Core.so.5
#12 0x00007ffa30a97fb7 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#13 0x00007ffa30a981f0 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#14 0x00007ffa30a9827c in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#15 0x00007ffa32a0736f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Core.so.5
#16 0x00007ffa329b205a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Core.so.5
#17 0x00007ffa327ddf9b in QThread::exec() () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Core.so.5
#18 0x00007ffa27d495e5 in  () at /home/vadi/Programs/Qt/5.9.3/gcc_64/plugins/platforms/../../lib/libQt5DBus.so.5
#19 0x00007ffa327e2c3a in  () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Core.so.5
#20 0x00007ffa322ae7fc in start_thread (arg=0x7ffa18b74700) at pthread_create.c:465
#21 0x00007ffa316e8b5f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 6 (Thread 0x7ffa1a647700 (LWP 19817)):
#0  0x00007ffa316dc951 in __GI___poll (fds=0x7ffa14039ad0, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffa30a98169 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffa30a98502 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffa25763b26 in  () at /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x00007ffa30abf645 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffa322ae7fc in start_thread (arg=0x7ffa1a647700) at pthread_create.c:465
---Type <return> to continue, or q <return> to quit---
#6  0x00007ffa316e8b5f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 5 (Thread 0x7ffa1ae48700 (LWP 19816)):
#0  0x00007ffa316dc951 in __GI___poll (fds=0x7ffa14009720, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffa30a98169 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffa30a9827c in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffa30a982c1 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffa30abf645 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffa322ae7fc in start_thread (arg=0x7ffa1ae48700) at pthread_create.c:465
#6  0x00007ffa316e8b5f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 4 (Thread 0x7ffa1b649700 (LWP 19815)):
#0  0x00007ffa316dc951 in __GI___poll (fds=0x21baba0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffa30a98169 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffa30a9827c in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffa1b65146d in  () at /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
#4  0x00007ffa30abf645 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffa322ae7fc in start_thread (arg=0x7ffa1b649700) at pthread_create.c:465
#6  0x00007ffa316e8b5f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 3 (Thread 0x7ffa278f0700 (LWP 19813)):
#0  0x00007ffa322b8afd in __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1  0x00007ffa322b119d in __GI___pthread_mutex_lock (mutex=0x7ffa35f77440 <(anonymous namespace)::HeapTrack::s_lock>) at ../nptl/pthread_mutex_lock.c:80
#2  0x00007ffa35d6eece in heaptrack_malloc () at /tmp/.mount_heaptrwI0A5y/opt/lib/heaptrack/libheaptrack_preload.so
#3  0x00007ffa35d6bd98 in malloc () at /tmp/.mount_heaptrwI0A5y/opt/lib/heaptrack/libheaptrack_preload.so
#4  0x00007ffa2cc3ce2c in  () at /usr/lib/x86_64-linux-gnu/libxcb.so.1
#5  0x00007ffa2cc3aa08 in  () at /usr/lib/x86_64-linux-gnu/libxcb.so.1
#6  0x00007ffa2cc3c53a in xcb_wait_for_event () at /usr/lib/x86_64-linux-gnu/libxcb.so.1
#7  0x00007ffa284ee709 in  () at /home/vadi/Programs/Qt/5.9.3/gcc_64/plugins/platforms/../../lib/libQt5XcbQpa.so.5
#8  0x00007ffa327e2c3a in  () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Core.so.5
#9  0x00007ffa322ae7fc in start_thread (arg=0x7ffa278f0700) at pthread_create.c:465
#10 0x00007ffa316e8b5f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

---Type <return> to continue, or q <return> to quit---
Thread 2 (Thread 0x7ffa294ea700 (LWP 19812)):
#0  0x00007ffa322b95f8 in __GI___nanosleep (requested_time=0x7ffa294e9cd0, remaining=0x0) at ../sysdeps/unix/sysv/linux/nanosleep.c:27
#1  0x00007ffa35d6ce88 in std::thread::_Impl<std::_Bind_simple<(anonymous namespace)::HeapTrack::LockedData::LockedData(int, void (*)())::{lambda()#1} ()> >::_M_run() ()
    at /tmp/.mount_heaptrwI0A5y/opt/lib/heaptrack/libheaptrack_preload.so
#2  0x00007ffa31fdd4a0 in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffa322ae7fc in start_thread (arg=0x7ffa294ea700) at pthread_create.c:465
#4  0x00007ffa316e8b5f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7ffa36146dc0 (LWP 19809)):
#0  0x00007ffa316e2a49 in syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffa327da065 in QBasicMutex::lockInternal() () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Core.so.5
#2  0x00007ffa327da10a in QMutex::lock() () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Core.so.5
#3  0x00000000004ee5fb in QMutexLocker::QMutexLocker(QBasicMutex*) (this=0x7fffcfa3d9c8, m=0x2091b30) at ../../../Qt/5.9.3/gcc_64/include/QtCore/qmutex.h:200
#4  0x00000000004ee2f1 in debug_free(void*, char const*, int) (p=0x2d706b0, file=0xa3fe67 "unknown", line=0)
    at ../3rdparty/edbee-lib/edbee-lib/edbee/util/mem/debug_new.cpp:57
#5  0x00000000004ee47e in operator delete(void*) (p=0x2d706b0) at ../3rdparty/edbee-lib/edbee-lib/edbee/util/mem/debug_new.cpp:90
#6  0x00007ffa35d7113d in void std::vector<TraceEdge, std::allocator<TraceEdge> >::_M_insert_aux<TraceEdge>(__gnu_cxx::__normal_iterator<TraceEdge*, std::vector<TraceEdge, std::allocator<TraceEdge> > >, TraceEdge&&) () at /tmp/.mount_heaptrwI0A5y/opt/lib/heaptrack/libheaptrack_preload.so
#7  0x00007ffa35d6f151 in heaptrack_malloc () at /tmp/.mount_heaptrwI0A5y/opt/lib/heaptrack/libheaptrack_preload.so
#8  0x00007ffa35d6bd98 in malloc () at /tmp/.mount_heaptrwI0A5y/opt/lib/heaptrack/libheaptrack_preload.so
#9  0x00007ffa327e3d9d in QArrayData::allocate(unsigned long, unsigned long, unsigned long, QFlags<QArrayData::AllocationOption>) ()
    at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Core.so.5
#10 0x00007ffa3285631d in QString::reallocData(unsigned int, bool) () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Core.so.5
#11 0x00007ffa3285729f in  () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Core.so.5
#12 0x00007ffa3285beea in QString::toLower_helper(QString const&) () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Core.so.5
#13 0x00007ffa3352eabc in  () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Gui.so.5
#14 0x00007ffa33530195 in QKeySequence::assign(QString const&, QKeySequence::SequenceFormat) () at /home/vadi/Programs/Qt/5.9.3/gcc_64/lib/libQt5Gui.so.5
#15 0x000000000080b28a in Ui_main_window::retranslateUi(QMainWindow*) (this=0x2cdfe10, main_window=0x2cdfde0) at ./ui_main_window.h:214
#16 0x000000000080518a in Ui_main_window::setupUi(QMainWindow*) (this=0x2cdfe10, main_window=0x2cdfde0) at ./ui_main_window.h:194
#17 0x00000000007de02b in mudlet::mudlet() (this=0x2cdfde0) at ../src/mudlet.cpp:172
#18 0x00000000007dd8aa in mudlet::start() () at ../src/mudlet.cpp:131
#19 0x00000000007dcfc4 in main(int, char**) (argc=1, argv=0x7fffcfa41da8) at ../src/main.cpp:590
(gdb)
Comment 6 Milian Wolff 2018-05-24 14:31:33 UTC
ugh, looks like it's an issue when using heaptrack with your custom debug_free/new - can you disable that while using heaptrack for now?

I'll have to figure out how to prevent the lock order violation... Probably needs a custom allocator, which I wanted to implement anyways for some time now...
Comment 7 Justin Zobel 2022-11-26 00:14:05 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 8 Bug Janitor Service 2022-12-11 05:07:07 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 9 Bug Janitor Service 2022-12-26 05:20:57 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!