Bug 372223 - Crash in QIconPrivate::~QIconPrivate after KAlarm exits
Summary: Crash in QIconPrivate::~QIconPrivate after KAlarm exits
Status: CLOSED FIXED
Alias: None
Product: kalarm
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: David Jarvie
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-08 18:09 UTC by RJ
Modified: 2020-08-17 23:51 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 16.12.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description RJ 2016-11-08 18:09:53 UTC
Application: kalarm (kalarm), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
84	T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
[Current thread is 1 (Thread 0x7fb509806940 (LWP 2395))]

Thread 3 (Thread 0x7fb4f6ffa700 (LWP 2397)):
#0  0x00007fb52299500d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fb514fe5156 in g_main_context_poll (priority=<optimized out>, n_fds=1, fds=0x7fb4f0003020, timeout=<optimized out>, context=0x7fb4f0000990) at gmain.c:4228
#2  g_main_context_iterate (context=context@entry=0x7fb4f0000990, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3924
#3  0x00007fb514fe526c in g_main_context_iteration (context=0x7fb4f0000990, may_block=may_block@entry=1) at gmain.c:3990
#4  0x00007fb52379ad8b in QEventDispatcherGlib::processEvents (this=0x7fb4f00008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#5  0x00007fb52374c0ba in QEventLoop::exec (this=this@entry=0x7fb4f6ff9c40, flags=..., flags@entry=...) at kernel/qeventloop.cpp:210
#6  0x00007fb5235a9643 in QThread::exec (this=this@entry=0x7fb52c4e4060 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread.cpp:507
#7  0x00007fb52c46e7a9 in QDBusConnectionManager::run (this=0x7fb52c4e4060 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at qdbusconnection.cpp:196
#8  0x00007fb5235ada1a in QThreadPrivate::start (arg=0x7fb52c4e4060 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread_unix.cpp:344
#9  0x00007fb51ae9d6ca in start_thread (arg=0x7fb4f6ffa700) at pthread_create.c:333
#10 0x00007fb5229a0f6f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105

Thread 2 (Thread 0x7fb4fef50700 (LWP 2396)):
#0  0x00007fb52299500d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fb518dadd10 in poll (__timeout=-1, __nfds=1, __fds=0x7fb4fef4fb80) at /usr/include/bits/poll2.h:46
#2  _xcb_conn_wait (c=c@entry=0x5594804c75c0, cond=cond@entry=0x5594804c7600, vector=vector@entry=0x0, count=count@entry=0x0) at xcb_conn.c:479
#3  0x00007fb518dafaa9 in xcb_wait_for_event (c=0x5594804c75c0) at xcb_in.c:693
#4  0x00007fb502b79a19 in QXcbEventReader::run (this=0x5594804d1d30) at qxcbconnection.cpp:1337
#5  0x00007fb5235ada1a in QThreadPrivate::start (arg=0x5594804d1d30) at thread/qthread_unix.cpp:344
#6  0x00007fb51ae9d6ca in start_thread (arg=0x7fb4fef50700) at pthread_create.c:333
#7  0x00007fb5229a0f6f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105

Thread 1 (Thread 0x7fb509806940 (LWP 2395)):
[KCrash Handler]
#6  0x00007fb523c66583 in QIconPrivate::~QIconPrivate (this=0x559480ac0b70, __in_chrg=<optimized out>) at image/qicon_p.h:70
#7  QIcon::~QIcon (this=<optimized out>, __in_chrg=<optimized out>) at image/qicon.cpp:685
#8  0x00007fb4fdea3db8 in ScalableEntry::~ScalableEntry (this=0x559480ac5b20, __in_chrg=<optimized out>) at /usr/src/debug/libqtxdg-2.0.0/xdgiconloader/xdgiconloader_p.h:96
#9  ScalableEntry::~ScalableEntry (this=0x559480ac5b20, __in_chrg=<optimized out>) at /usr/src/debug/libqtxdg-2.0.0/xdgiconloader/xdgiconloader_p.h:96
#10 0x00007fb4fde9e70e in qDeleteAll<QList<XdgIconLoaderEngineEntry*>::const_iterator> (end=..., begin=...) at /usr/include/qt5/QtCore/qalgorithms.h:323
#11 qDeleteAll<QList<XdgIconLoaderEngineEntry*> > (c=...) at /usr/include/qt5/QtCore/qalgorithms.h:331
#12 XdgIconLoaderEngine::~XdgIconLoaderEngine (this=0x559480a8e180, __in_chrg=<optimized out>) at /usr/src/debug/libqtxdg-2.0.0/xdgiconloader/xdgiconloader.cpp:592
#13 0x00007fb4fde9e7a9 in XdgIconLoaderEngine::~XdgIconLoaderEngine (this=0x559480a8e180, __in_chrg=<optimized out>) at /usr/src/debug/libqtxdg-2.0.0/xdgiconloader/xdgiconloader.cpp:593
#14 0x00007fb523c66586 in QIconPrivate::~QIconPrivate (this=0x559480b03b80, __in_chrg=<optimized out>) at image/qicon_p.h:70
#15 QIcon::~QIcon (this=<optimized out>, __in_chrg=<optimized out>) at image/qicon.cpp:685
#16 0x00007fb523c665d9 in QCache<QString, QIcon>::clear (this=0x7fb523fa1de0 <(anonymous namespace)::Q_QGS_qtIconCache::innerFunction()::holder>) at ../../src/corelib/tools/qcache.h:124
#17 QCache<QString, QIcon>::~QCache (this=0x7fb523fa1de0 <(anonymous namespace)::Q_QGS_qtIconCache::innerFunction()::holder>, __in_chrg=<optimized out>) at ../../src/corelib/tools/qcache.h:93
#18 (anonymous namespace)::IconCache::~IconCache (this=0x7fb523fa1de0 <(anonymous namespace)::Q_QGS_qtIconCache::innerFunction()::holder>, __in_chrg=<optimized out>) at image/qicon.cpp:102
#19 (anonymous namespace)::Q_QGS_qtIconCache::Holder::~Holder (this=0x7fb523fa1de0 <(anonymous namespace)::Q_QGS_qtIconCache::innerFunction()::holder>, __in_chrg=<optimized out>) at image/qicon.cpp:112
#20 0x00007fb5228d3420 in __run_exit_handlers (status=0, listp=0x7fb522c595b8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:83
#21 0x00007fb5228d347a in __GI_exit (status=<optimized out>) at exit.c:105
#22 0x00007fb5228b9408 in __libc_start_main (main=0x55947f5a61b0 <main(int, char**)>, argc=2, argv=0x7ffc7afdbb58, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffc7afdbb48) at ../csu/libc-start.c:323
#23 0x000055947f5a6eda in _start () at /usr/src/debug/kdepim-16.08.2/kalarm/src/main.cpp:55
Comment 1 Christoph Feck 2016-11-08 23:55:11 UTC
This issue could be caused by "libqtxdg". I have no idea what component is responsible for loading this library, neither Qt nor KDE sources reference it.
Comment 2 RJ 2016-11-09 17:31:09 UTC
(In reply to Christoph Feck from comment #1)
> This issue could be caused by "libqtxdg". I have no idea what component is
> responsible for loading this library, neither Qt nor KDE sources reference
> it.

libqtxdg is library from lxqt desktop.

Anyway, if you start lxqt desktop and then start Kalarmm on it then close it from tray icon you will get crash. That it. Is this a bug in lxqt or kalarm itself, please let me know.
Comment 3 Christoph Feck 2016-11-11 18:12:59 UTC
Yes, but the question is how XdgIconLoaderEngine comes into KAlarm.

I guess LXQt has its own Qt platform integration plugin which then uses libqtxdg, so I suggest to report the problem to LXQt developers.
Comment 4 RJ 2016-11-11 21:25:09 UTC
(In reply to Christoph Feck from comment #3)
> Yes, but the question is how XdgIconLoaderEngine comes into KAlarm.
> 
> I guess LXQt has its own Qt platform integration plugin which then uses
> libqtxdg, so I suggest to report the problem to LXQt developers.

Let them know https://github.com/lxde/lxqt/issues/1193
Comment 5 Palo Kisa 2016-11-14 13:46:48 UTC
I believe the reason here is a dangling QApplication object, see the comments in LXQt bug tracker -> https://github.com/lxde/lxqt/issues/1193#issuecomment-260337417
Comment 6 Christoph Feck 2016-11-15 13:04:04 UTC
Thanks for the analysis. I will suggest a patch to kalarm developers (either using a scoped pointer as suggested, or simply by creating the application object on the stack, as suggested by Qt examples).
Comment 7 Christoph Feck 2016-11-15 22:01:55 UTC
palinek, I decided to use the version you suggested.

If you want proper attribution for the patch, please state your full name.
Comment 8 David Jarvie 2016-11-15 23:46:38 UTC
Thank you for coming up with a fix. What you suggested in the LXQt bug tracker is fine apart from needing some adjustments to make it compile. I'd prefer to make the commit myself since I like to use certain conventions for bugfix commits, but equally I'd be happy to attribute you as the author of the patch - as Christoph suggests, you might want to state your full name for that.
Comment 9 Palo Kisa 2016-11-16 07:16:46 UTC
> I'd prefer to make the commit myself since I like to use certain conventions
> for bugfix commits, but equally I'd be happy to attribute you as the author of
> the patch - as Christoph suggests, you might want to state your full name for
> that.

I've changed the nick used here to the real name. Feel free to use it to preserve authorship or do your own commit (I do not insist in preserving the authorship as I don't know how many other changes you need to do).
Comment 10 David Jarvie 2016-11-16 09:24:20 UTC
The fix is now committed with you as the author, and will be in version 2.11.11 (KDE Applications 16.12) - git commit 2a5b20e0d6713889a59b7cf55d9d293d97a8a4c2 (16.08 branch).

This could potentially fix other crashes which have been reported on application exit, so thank you for making the effort to find the cause of this bug.