Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kalarm crash after closing in LXQT #1193

Closed
Sniperq2 opened this issue Nov 11, 2016 · 11 comments
Closed

kalarm crash after closing in LXQT #1193

Sniperq2 opened this issue Nov 11, 2016 · 11 comments
Projects

Comments

@Sniperq2
Copy link

Sniperq2 commented Nov 11, 2016

How to reproduce:

  1. Start Kalarm
  2. Close Kalarm.
  3. get Crash

Software used

  1. Fedora 25
  2. lxqt 0.11
  3. Qt 5.7
  4. kalarm-16.08.2-1.fc25

Expected behavior
Kalarm exit without crash

Actual behavior
kalarm crashes after exit

Backtrace is here: http://pastebin.com/3ay0FxxL
More info here https://bugs.kde.org/show_bug.cgi?id=372223

@agaida
Copy link
Member

agaida commented Nov 11, 2016

ok - not again - not without further informations

@Sniperq2
Copy link
Author

What information do you need?

@agaida
Copy link
Member

agaida commented Nov 11, 2016

#1192
And please - as we live in the 21. century - use a paste service or gist for the dumps

@Sniperq2
Copy link
Author

Tried with no luck to add new template to git repository. Without step by step explanation with examples it is very hard. Bug report must be SIMPLE and intuitive.

Anyway I'll update first post.

@jleclanche
Copy link
Member

Reopening, the downstream bug looks legitimate.

@stefonarch
Copy link
Member

Same here, up-to-date arch with lxqt-git packages: starting kalarm and exiting by right click on trayicon → exit I get an error notification from plasma, icon stays visible with crash icon.

Application: kalarm (kalarm), signal: Segmentation fault
[Current thread is 1 (LWP 26789)]

Thread 3 (LWP 26791):
#0  0x00007f6a414ef4ed in ?? ()
#1  0x0000000000000000 in ?? ()

Thread 2 (LWP 26790):
#1  0x0000000000000000 in ?? ()

Thread 1 (LWP 26789):
#1  0x0000000000000000 in ?? ()
Application: kalarm (kalarm), signal: Segmentation fault
[Current thread is 1 (LWP 26789)]

Thread 3 (LWP 26791):
#0  0x00007f6a414ef4ed in ?? ()
#1  0x0000000000000000 in ?? ()

Thread 2 (LWP 26790):
#1  0x0000000000000000 in ?? ()

Thread 1 (LWP 26789):
#1  0x0000000000000000 in ?? ()

@agaida
Copy link
Member

agaida commented Nov 12, 2016

@sniper2: thank you very much

@palinek
Copy link
Contributor

palinek commented Nov 14, 2016

I'm able to reproduce it here and from the stacktrace I'm guessing this is another example of the "close/unload libraries" and dangling resources problem:

(gdb) bt
#0  QIconPrivate::~QIconPrivate (this=0x555555a468b0, __in_chrg=<optimized out>) at image/qicon_p.h:70
#1  QIcon::~QIcon (this=<optimized out>, __in_chrg=<optimized out>) at image/qicon.cpp:687
#2  0x00007fffd715d4f8 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5XdgIconLoader.so.2
#3  0x00007fffd715803e in XdgIconLoaderEngine::~XdgIconLoaderEngine() () from /usr/lib/x86_64-linux-gnu/libQt5XdgIconLoader.so.2
#4  0x00007fffd71580d9 in XdgIconLoaderEngine::~XdgIconLoaderEngine() () from /usr/lib/x86_64-linux-gnu/libQt5XdgIconLoader.so.2
#5  0x00007ffff0f0ace2 in QIconPrivate::~QIconPrivate (this=0x555555a412d0, __in_chrg=<optimized out>) at image/qicon_p.h:70
#6  QIcon::~QIcon (this=<optimized out>, __in_chrg=<optimized out>) at image/qicon.cpp:687
#7  0x00007ffff0f0ad19 in QCache<QString, QIcon>::clear (this=0x7ffff12bec20 <(anonymous namespace)::Q_QGS_qtIconCache::innerFunction()::holder>)
    at ../../include/QtCore/../../src/corelib/tools/qcache.h:124
#8  QCache<QString, QIcon>::~QCache (this=0x7ffff12bec20 <(anonymous namespace)::Q_QGS_qtIconCache::innerFunction()::holder>, __in_chrg=<optimized out>)
    at ../../include/QtCore/../../src/corelib/tools/qcache.h:93
#9  (anonymous namespace)::IconCache::~IconCache (this=0x7ffff12bec20 <(anonymous namespace)::Q_QGS_qtIconCache::innerFunction()::holder>, __in_chrg=<optimized out>) at image/qicon.cpp:104
#10 (anonymous namespace)::Q_QGS_qtIconCache::Holder::~Holder (this=0x7ffff12bec20 <(anonymous namespace)::Q_QGS_qtIconCache::innerFunction()::holder>, __in_chrg=<optimized out>)
    at image/qicon.cpp:114
#11 0x00007fffefe3c920 in __run_exit_handlers (status=0, listp=0x7ffff019f5d8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:83
#12 0x00007fffefe3c97a in __GI_exit (status=<optimized out>) at exit.c:105
#13 0x00007fffefe272b8 in __libc_start_main (main=0x5555555ca300, argc=1, argv=0x7fffffffd958, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd948)
    at ../csu/libc-start.c:325
#14 0x00005555555cb02a in _start ()

So the cache is cleared in static finalization time, but the image engine plugin(s) is/are probably gone already. But confiusing is, why isn't the cache clear()-ed in the QCoreApplication destructor by the postroutine qt_cleanup_icon_cache set here

@palinek
Copy link
Contributor

palinek commented Nov 14, 2016

... and the ld.so debug and valgrind do confirm the unload before the cache clean-up:

log_kalarm: 0 : quitting
log_kalarm: 
     20367:
     20367:     calling fini: /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqdds.so [0]
     20367:
--20367-- Discarding syms at 0x2a38d280-0x2a393082 in /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqdds.so due to munmap()
     20367:
     20367:     file=/usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqdds.so [0];  destroying link map
     20367:
     20367:     calling fini: /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqgif.so [0]
     20367:
--20367-- Discarding syms at 0x2a399250-0x2a39c61a in /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqgif.so due to munmap()
     20367:
     20367:     file=/usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqgif.so [0];  destroying link map
     20367:
     20367:     calling fini: /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqicns.so [0]
     20367:
--20367-- Discarding syms at 0x2a3a2fe0-0x2a3a7188 in /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqicns.so due to munmap()
     20367:
     20367:     file=/usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqicns.so [0];  destroying link map
     20367:
     20367:     calling fini: /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqico.so [0]
     20367:
--20367-- Discarding syms at 0x2a3adaf0-0x2a3b043a in /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqico.so due to munmap()
     20367:
     20367:     file=/usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqico.so [0];  destroying link map
     20367:
     20367:     calling fini: /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqjpeg.so [0]
     20367:
--20367-- Discarding syms at 0x2ae165b0-0x2ae1d7da in /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqjpeg.so due to munmap()
     20367:
     20367:     file=/usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqjpeg.so [0];  destroying link map
     20367:
     20367:     calling fini: /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqmng.so [0]
     20367:
     20367:
     20367:     calling fini: /usr/lib/x86_64-linux-gnu/libmng.so.1 [0]
     20367:
     20367:
     20367:     calling fini: /usr/lib/x86_64-linux-gnu/liblcms2.so.2 [0]
     20367:
--20367-- Discarding syms at 0x2ae23e60-0x2ae25422 in /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqmng.so due to munmap()
     20367:
     20367:     file=/usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqmng.so [0];  destroying link map
--20367-- Discarding syms at 0x2ae6c4a0-0x2aed385f in /usr/lib/x86_64-linux-gnu/libmng.so.1.1.0.10 due to munmap()
     20367:
     20367:     file=/usr/lib/x86_64-linux-gnu/libmng.so.1 [0];  destroying link map
--20367-- Discarding syms at 0x2b0f5670-0x2b128c09 in /usr/lib/x86_64-linux-gnu/liblcms2.so.2.0.7 due to munmap()
     20367:
     20367:     file=/usr/lib/x86_64-linux-gnu/liblcms2.so.2 [0];  destroying link map
     20367:
     20367:     calling fini: /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqsvg.so [0]
     20367:
--20367-- Discarding syms at 0x2ae2bbe0-0x2ae2d0ae in /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqsvg.so due to munmap()
     20367:
     20367:     file=/usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqsvg.so [0];  destroying link map
     20367:
     20367:     calling fini: /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqtga.so [0]
     20367:
--20367-- Discarding syms at 0x2ae324b0-0x2ae33852 in /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqtga.so due to munmap()
     20367:
     20367:     file=/usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqtga.so [0];  destroying link map
     20367:
     20367:     calling fini: /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqtiff.so [0]
     20367:
     20367:
     20367:     calling fini: /usr/lib/x86_64-linux-gnu/libtiff.so.5 [0]
     20367:
     20367:
     20367:     calling fini: /usr/lib/x86_64-linux-gnu/libjbig.so.0 [0]
     20367:
--20367-- Discarding syms at 0x2ae39da0-0x2ae3d168 in /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqtiff.so due to munmap()
     20367:
     20367:     file=/usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqtiff.so [0];  destroying link map
--20367-- Discarding syms at 0x2b375e60-0x2b3b2852 in /usr/lib/x86_64-linux-gnu/libtiff.so.5.2.4 due to munmap()
     20367:
     20367:     file=/usr/lib/x86_64-linux-gnu/libtiff.so.5 [0];  destroying link map
--20367-- Discarding syms at 0x2b5e4350-0x2b5ecc15 in /usr/lib/x86_64-linux-gnu/libjbig.so.0 due to munmap()
     20367:
     20367:     file=/usr/lib/x86_64-linux-gnu/libjbig.so.0 [0];  destroying link map
     20367:
     20367:     calling fini: /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqwbmp.so [0]
     20367:
--20367-- Discarding syms at 0x2ae43660-0x2ae448d2 in /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqwbmp.so due to munmap()
     20367:
     20367:     file=/usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqwbmp.so [0];  destroying link map
     20367:
     20367:     calling fini: /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqwebp.so [0]
     20367:
     20367:
     20367:     calling fini: /usr/lib/x86_64-linux-gnu/libwebpdemux.so.2 [0]
     20367:
--20367-- Discarding syms at 0x2ae4aa30-0x2ae4bfbd in /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqwebp.so due to munmap()
     20367:
     20367:     file=/usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqwebp.so [0];  destroying link map
--20367-- Discarding syms at 0x2b7f2e70-0x2b7f4cc2 in /usr/lib/x86_64-linux-gnu/libwebpdemux.so.2.0.0 due to munmap()
     20367:
     20367:     file=/usr/lib/x86_64-linux-gnu/libwebpdemux.so.2 [0];  destroying link map
     20367:
     20367:     calling fini: /usr/lib/x86_64-linux-gnu/qt5/plugins/iconengines/libqsvgicon.so [0]
     20367:
--20367-- Discarding syms at 0x273fe3a0-0x27402633 in /usr/lib/x86_64-linux-gnu/qt5/plugins/iconengines/libqsvgicon.so due to munmap()
     20367:
     20367:     file=/usr/lib/x86_64-linux-gnu/qt5/plugins/iconengines/libqsvgicon.so [0];  destroying link map
==20367== Invalid read of size 8
==20367==    at 0xBACCC93: ~QIconPrivate (qicon_p.h:70)
==20367==    by 0xBACCC93: QIcon::~QIcon() (qicon.cpp:687)
==20367==    by 0x25CB14F7: ??? (in /usr/lib/x86_64-linux-gnu/libQt5XdgIconLoader.so.2.0.0)
==20367==    by 0x25CAC03D: XdgIconLoaderEngine::~XdgIconLoaderEngine() (in /usr/lib/x86_64-linux-gnu/libQt5XdgIconLoader.so.2.0.0)
==20367==    by 0x25CAC0D8: XdgIconLoaderEngine::~XdgIconLoaderEngine() (in /usr/lib/x86_64-linux-gnu/libQt5XdgIconLoader.so.2.0.0)
==20367==    by 0xBACCCE1: ~QIconPrivate (qicon_p.h:70)
==20367==    by 0xBACCCE1: QIcon::~QIcon() (qicon.cpp:687)
==20367==    by 0xBACCD18: (anonymous namespace)::Q_QGS_qtIconCache::innerFunction()::Holder::~Holder() (qcache.h:124)
==20367==    by 0xCAA191F: __run_exit_handlers (exit.c:83)
==20367==    by 0xCAA1979: exit (exit.c:105)
==20367==    by 0xCA8C2B7: (below main) (libc-start.c:325)
==20367==  Address 0x27404ce0 is not stack'd, malloc'd or (recently) free'd
==20367== 
==20367== 
==20367== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==20367==  Access not within mapped region at address 0x27404CE0
==20367==    at 0xBACCC93: ~QIconPrivate (qicon_p.h:70)
==20367==    by 0xBACCC93: QIcon::~QIcon() (qicon.cpp:687)
==20367==    by 0x25CB14F7: ??? (in /usr/lib/x86_64-linux-gnu/libQt5XdgIconLoader.so.2.0.0)
==20367==    by 0x25CAC03D: XdgIconLoaderEngine::~XdgIconLoaderEngine() (in /usr/lib/x86_64-linux-gnu/libQt5XdgIconLoader.so.2.0.0)
==20367==    by 0x25CAC0D8: XdgIconLoaderEngine::~XdgIconLoaderEngine() (in /usr/lib/x86_64-linux-gnu/libQt5XdgIconLoader.so.2.0.0)
==20367==    by 0xBACCCE1: ~QIconPrivate (qicon_p.h:70)
==20367==    by 0xBACCCE1: QIcon::~QIcon() (qicon.cpp:687)
==20367==    by 0xBACCD18: (anonymous namespace)::Q_QGS_qtIconCache::innerFunction()::Holder::~Holder() (qcache.h:124)
==20367==    by 0xCAA191F: __run_exit_handlers (exit.c:83)
==20367==    by 0xCAA1979: exit (exit.c:105)
==20367==    by 0xCA8C2B7: (below main) (libc-start.c:325)

@tsujan
Copy link
Member

tsujan commented Nov 14, 2016

Can this issue be reproduced by a simple test program or is it specific to kalarm?

@palinek
Copy link
Contributor

palinek commented Nov 14, 2016

But confiusing is, why isn't the cache clear()-ed in the QCoreApplication destructor by the postroutine qt_cleanup_icon_cache set here

OMG... it's not called because the application object is created on heap(https://github.com/KDE/kdepim/blob/master/kalarm/src/main.cpp#L43, https://github.com/KDE/kdepim/blob/master/kalarm/src/kalarmapp.cpp#L194), but never deleted ...

I believe, this should fix it:

diff --git a/kalarm/src/main.cpp b/kalarm/src/main.cpp
index 3eab588..b7d127d 100644
--- a/kalarm/src/main.cpp
+++ b/kalarm/src/main.cpp
@@ -40,7 +40,7 @@ int main(int argc, char* argv[])
     KAlarmMigrateApplication migrate;
     migrate.migrate();

-    KAlarmApp* app = KAlarmApp::create(argc, argv);
+    QScopedPointer<KAlarmApp> app = KAlarmApp::create(argc, argv);
     QStringList args = app->arguments();
     app->setAttribute(Qt::AA_UseHighDpiPixmaps, true);
     app->setAttribute(Qt::AA_EnableHighDpiScaling);

(but I have no time to build the kalarm from sources)

@palinek palinek closed this as completed Nov 16, 2016
kdesysadmin pushed a commit to KDE/kalarm that referenced this issue Nov 16, 2016
The QCoreApplication instance wasn't deleted before libraries
were unloaded, which resulted in a crash during clean-up. See
lxqt/lxqt#1193 (comment).
kdesysadmin pushed a commit to KDE/kalarm that referenced this issue Nov 16, 2016
The QCoreApplication instance wasn't deleted before libraries
were unloaded, which resulted in a crash during clean-up. See
lxqt/lxqt#1193 (comment).
@agaida agaida added this to test in Issues Aug 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Issues
  
Translations and L10N
Development

No branches or pull requests

6 participants