Bug 328969 - Clicking Open Log Viewer... on a contact crashes ktp-log-viewer every time
Summary: Clicking Open Log Viewer... on a contact crashes ktp-log-viewer every time
Status: RESOLVED FIXED
Alias: None
Product: telepathy
Classification: Frameworks and Libraries
Component: log-viewer (show other bugs)
Version: 0.8.0
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: Future
Assignee: Telepathy Bugs
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2013-12-18 15:52 UTC by Matěj Laitl
Modified: 2014-04-10 18:00 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.8.1


Attachments
New crash information added by DrKonqi (4.03 KB, text/plain)
2014-03-20 10:44 UTC, Matěj Laitl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matěj Laitl 2013-12-18 15:52:17 UTC
Application: ktp-log-viewer (0.7.0)
KDE Platform Version: 4.11.4
Qt Version: 4.8.5
Operating System: Linux 3.10.24-gentoo x86_64
Distribution (Platform): Gentoo Packages

-- Information about the crash:
- What I was doing when the application crashed:
Right clicked on a contact (I've already chatted with) in KTP contacts list -> Open Log Viewer...
The viewer immediatelly crashes without showing. The log viewer also crashes when I open it from a chat window.

Telepathy components:
telepathy-logger (0.8.0@10/04/2013)
telepathy-mission-control (5.14.1@12/15/2013)
telepathy-idle (0.1.16@09/05/2013)
telepathy-farstream (0.4.0@04/14/2013)
telepathy-glib (0.20.4@12/09/2013)
telepathy-logger-qt (0.8.0@10/04/2013)
telepathy-qt (0.9.3@04/15/2013)
telepathy-gabble (0.16.7@12/10/2013)
telepathy-haze (0.8.0@12/10/2013)
telepathy-salut (0.8.1@03/26/2013)

KTp suite is at version 0.7.0. I am able to test patches and/or try out git versions.

The crash can be reproduced every time.

-- Backtrace:
Application: KDE IM Log Viewer (ktp-log-viewer), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f238260b780 (LWP 7177))]

Thread 3 (Thread 0x7f236c6f9700 (LWP 7178)):
#0  pthread_cond_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:164
#1  0x00007f237e5fb262 in WTF::TCMalloc_PageHeap::scavengerThread (this=0x7f237ef951e0 <WTF::pageheap_memory>) at wtf/FastMalloc.cpp:2495
#2  0x00007f237e5fb299 in WTF::TCMalloc_PageHeap::runScavengerThread (context=<optimized out>) at wtf/FastMalloc.cpp:1618
#3  0x00007f237cbabea7 in start_thread (arg=0x7f236c6f9700) at pthread_create.c:308
#4  0x00007f237ceaaeed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:114

Thread 2 (Thread 0x7f236bdf8700 (LWP 7179)):
#0  0x00007f2379327ec0 in pthread_mutex_lock@plt () from /usr/lib64/libglib-2.0.so.0
#1  0x00007f2379392f71 in g_mutex_lock (mutex=<optimized out>) at /var/tmp/portage/dev-libs/glib-2.36.4-r1/work/glib-2.36.4/glib/gthread-posix.c:210
#2  0x00007f23793555b6 in g_main_context_dispatch (context=0x7f23640009a0) at /var/tmp/portage/dev-libs/glib-2.36.4-r1/work/glib-2.36.4/glib/gmain.c:3626
#3  0x00007f2379355a18 in g_main_context_iterate (dispatch=1, block=<optimized out>, context=0x7f23640009a0, self=<optimized out>) at /var/tmp/portage/dev-libs/glib-2.36.4-r1/work/glib-2.36.4/glib/gmain.c:3701
#4  g_main_context_iterate (context=0x7f23640009a0, block=<optimized out>, dispatch=1, self=<optimized out>) at /var/tmp/portage/dev-libs/glib-2.36.4-r1/work/glib-2.36.4/glib/gmain.c:3638
#5  0x00007f2379355ad4 in g_main_context_iteration (context=0x7f23640009a0, may_block=1) at /var/tmp/portage/dev-libs/glib-2.36.4-r1/work/glib-2.36.4/glib/gmain.c:3762
#6  0x00007f23801aa866 in QEventDispatcherGlib::processEvents (this=0x7f23640008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:427
#7  0x00007f23801764b2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#8  0x00007f23801766f7 in QEventLoop::exec (this=0x7f236bdf7de0, flags=...) at kernel/qeventloop.cpp:204
#9  0x00007f23800680f8 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:536
#10 0x00007f238006afe2 in QThreadPrivate::start (arg=0x231ddb0) at thread/qthread_unix.cpp:338
#11 0x00007f237cbabea7 in start_thread (arg=0x7f236bdf8700) at pthread_create.c:308
#12 0x00007f237ceaaeed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:114

Thread 1 (Thread 0x7f238260b780 (LWP 7177)):
[KCrash Handler]
#6  0x000000000041e665 in DatesModel::parent (this=0x24cec10, child=...) at /var/tmp/portage/net-im/ktp-text-ui-0.7.0/work/ktp-text-ui-0.7.0/logviewer/dates-model.cpp:399
#7  0x00007f237f726986 in parent (this=0x7fff4e284520) at ../../include/QtCore/../../src/corelib/kernel/qabstractitemmodel.h:393
#8  QAbstractItemView::setModel (this=0x227ed90, model=<optimized out>) at itemviews/qabstractitemview.cpp:668
#9  0x00007f237f741270 in QHeaderView::setModel (this=0x227ed90, model=0x24cec10) at itemviews/qheaderview.cpp:410
#10 0x00007f237f77bd99 in QTreeView::setModel (this=0x22773d0, model=0x24cec10) at itemviews/qtreeview.cpp:236
#11 0x00000000004183ad in LogViewer::LogViewer (this=0x2338270, accountFactory=..., connectionFactory=..., channelFactory=..., contactFactory=..., parent=<optimized out>, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /var/tmp/portage/net-im/ktp-text-ui-0.7.0/work/ktp-text-ui-0.7.0/logviewer/log-viewer.cpp:103
#12 0x0000000000416195 in main (argc=3, argv=0x7fff4e284ba8) at /var/tmp/portage/net-im/ktp-text-ui-0.7.0/work/ktp-text-ui-0.7.0/logviewer/main.cpp:76

Reported using DrKonqi
Comment 1 Darin McBride 2014-01-31 03:36:15 UTC
I'm also replicating this on Gentoo with 0.7.1
Comment 2 David Edmundson 2014-02-27 15:00:49 UTC
I can't reproduce this on git latest. Can you try with 0.7.80 or higher? 
There have been some changes in this area.
Comment 3 Matěj Laitl 2014-03-20 10:44:20 UTC
Created attachment 85643 [details]
New crash information added by DrKonqi

ktp-log-viewer (0.8.0) on KDE Platform 4.12.3 using Qt 4.8.5

Hi, I can reproduce this with ktp-text-ui 0.8.0.1.

I should also note that I use Qt buld with debugging assertions enabled. (however this does not look like it, normally it is clear from the backtrace that the assert has been hit)

I'm attaching updated backtrace.

-- Backtrace (Reduced):
#6  0x000000000041e5d5 in DatesModel::parent (this=0x90e4a0, child=...) at /var/tmp/portage/net-im/ktp-text-ui-0.8.0.1/work/ktp-text-ui-0.8.0.1/logviewer/dates-model.cpp:399
#7  0x00007f830f4eed76 in parent (this=0x7fffa7f95750) at ../../include/QtCore/../../src/corelib/kernel/qabstractitemmodel.h:393
#8  QAbstractItemView::setModel (this=0xa4c270, model=<optimized out>) at itemviews/qabstractitemview.cpp:668
#9  0x00007f830f509660 in QHeaderView::setModel (this=0xa4c270, model=0x90e4a0) at itemviews/qheaderview.cpp:410
#10 0x00007f830f544189 in QTreeView::setModel (this=0xae7b60, model=0x90e4a0) at itemviews/qtreeview.cpp:236
Comment 4 Matěj Laitl 2014-03-20 10:45:41 UTC
Reopening based on provided info. Thanks for the great software, by the way, KTp otherwise rocks for me.
Comment 5 Daniel Vrátil 2014-04-10 18:00:49 UTC
Fixed in 0.8.1

There's an assert in QAbstractItemView that asks the model for data that the model does not have and that lead to a crash in our model (or in Matej's case it lead to QModelIndex having an invalid internal pointer).


commit 9953f40919c88c13cfbd4d04e3c1fec37983f8e8
Author: Dan Vrátil <dvratil@redhat.com>
Date:   Thu Apr 10 18:19:17 2014 +0200

    Fix crash in DatesModel when View asks for a non-existent item
    
    Approved-By: Alex Fiestas