Bug 450824 - crash when closing kleopatra
Summary: crash when closing kleopatra
Status: ASSIGNED
Alias: None
Product: kleopatra
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Andre Heinecke
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2022-02-25 08:21 UTC by Martin Koller
Modified: 2023-08-29 07:13 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (10.11 KB, text/plain)
2022-06-07 19:03 UTC, Szőts Ákos
Details
New crash information added by DrKonqi (7.12 KB, text/plain)
2022-08-22 08:37 UTC, Yaroslav Sidlovsky
Details
New crash information added by DrKonqi (6.14 KB, text/plain)
2022-12-27 19:17 UTC, osfer9111
Details
New crash information added by DrKonqi (18.66 KB, text/plain)
2023-05-06 05:59 UTC, yescallop
Details
New crash information added by DrKonqi (12.59 KB, text/plain)
2023-08-28 13:50 UTC, Yaroslav Sidlovsky
Details
More detailed stacktrace from gdb (3.85 KB, text/x-log)
2023-08-28 14:03 UTC, Yaroslav Sidlovsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Koller 2022-02-25 08:21:39 UTC
Application: kleopatra (3.1.19.211202 (21.12.2))

Qt Version: 5.15.2
Frameworks Version: 5.90.0
Operating System: Linux 5.16.10-1-default x86_64
Windowing System: X11
Distribution: "openSUSE Tumbleweed"
DrKonqi: 5.24.1 [KCrashBackend]

-- Information about the crash:
- What I was doing when the application crashed:
Started kleopatra (have a smartcard inserted), Quit kleopatra -> crash

The crash can be reproduced every time.

-- Backtrace:
Application: Kleopatra (kleopatra), signal: Aborted

[KCrash Handler]
#4  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#5  0x00007fa66c4601e3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#6  0x00007fa66c410306 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#7  0x00007fa66c3f9813 in __GI_abort () at abort.c:79
#8  0x00007fa66c3f972b in __assert_fail_base (fmt=<optimized out>, assertion=<optimized out>, file=<optimized out>, line=<optimized out>, function=<optimized out>) at assert.c:92
#9  0x00007fa66c4088f6 in __GI___assert_fail (assertion=0x7fa66e2b909f "li", file=0x7fa66e2b907d "wait-global.c", line=125, function=0x7fa66e2ba480 "ctx_done") at assert.c:101
#10 0x00007fa66e286106 in ?? () from /lib64/libgpgme.so.11
#11 0x00007fa66e2b67a3 in ?? () from /lib64/libgpgme.so.11
#12 0x00007fa66e2b6960 in gpgme_cancel () from /lib64/libgpgme.so.11
#13 0x00007fa66e2f2821 in GpgME::Context::cancelPendingOperationImmediately() () from /lib64/libgpgmepp.so.6
#14 0x0000563eb061ad39 in ?? ()
#15 0x0000563eb061ada9 in ?? ()
#16 0x00007fa66cb2324f in QObject::event (this=0x563eb18c5000, e=0x7fa64c0051f0) at kernel/qobject.cpp:1301
#17 0x00007fa66d6a7a7f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#18 0x00007fa66caf6e3a in QCoreApplication::notifyInternal2 (receiver=0x563eb18c5000, event=0x7fa64c0051f0) at kernel/qcoreapplication.cpp:1064
#19 0x00007fa66caf9e77 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=52, data=0x563eb1893d80) at kernel/qcoreapplication.cpp:1821
#20 0x00007fa66c9115d5 in QThreadPrivate::finish (arg=0x563eb18840a8) at thread/qthread_unix.cpp:371
#21 0x00007fa66c911ef7 in __pthread_cleanup_class::~__pthread_cleanup_class (this=<synthetic pointer>, __in_chrg=<optimized out>) at /usr/include/pthread.h:578
#22 QThreadPrivate::start (arg=0x563eb18840a8) at thread/qthread_unix.cpp:350
#23 0x00007fa66c45e2ba in start_thread (arg=<optimized out>) at pthread_create.c:442
#24 0x00007fa66c4e8440 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 3 (Thread 0x7fa6669a8640 (LWP 27282) "QDBusConnection"):
#1  0x00007fa66b01714e in ?? () from /lib64/libglib-2.0.so.0
#2  0x00007fa66b01726f in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#3  0x00007fa66cb4e3f6 in QEventDispatcherGlib::processEvents (this=0x7fa658000b70, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#4  0x00007fa66caf583b in QEventLoop::exec (this=this@entry=0x7fa6669a7b50, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#5  0x00007fa66c910d7e in QThread::exec (this=<optimized out>) at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#6  0x00007fa66df32287 in ?? () from /lib64/libQt5DBus.so.5
#7  0x00007fa66c911eef in QThreadPrivate::start (arg=0x7fa66dfab440) at thread/qthread_unix.cpp:331
#8  0x00007fa66c45e2ba in start_thread (arg=<optimized out>) at pthread_create.c:442
#9  0x00007fa66c4e8440 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 2 (Thread 0x7fa6681c1640 (LWP 27281) "QXcbEventQueue"):
#1  0x00007fa66be3a892 in ?? () from /lib64/libxcb.so.1
#2  0x00007fa66be3c2ac in xcb_wait_for_event () from /lib64/libxcb.so.1
#3  0x00007fa668300dc0 in ?? () from /lib64/libQt5XcbQpa.so.5
#4  0x00007fa66c911eef in QThreadPrivate::start (arg=0x563eb1744e60) at thread/qthread_unix.cpp:331
#5  0x00007fa66c45e2ba in start_thread (arg=<optimized out>) at pthread_create.c:442
#6  0x00007fa66c4e8440 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 1 (Thread 0x7fa66a07e980 (LWP 27280) "kleopatra"):
#1  __futex_abstimed_wait_common (futex_word=futex_word@entry=0x563eb18975f0, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at futex-internal.c:87
#2  0x00007fa66c45a97f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x563eb18975f0, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at futex-internal.c:139
#3  0x00007fa66c45d5b0 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x563eb18975a0, cond=0x563eb18975c8) at pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=0x563eb18975c8, mutex=0x563eb18975a0) at pthread_cond_wait.c:618
#5  0x00007fa66c917d6b in QWaitConditionPrivate::wait (deadline=..., deadline=..., this=0x563eb18975a0) at thread/qwaitcondition_unix.cpp:146
#6  QWaitCondition::wait (this=this@entry=0x563eb1886c68, mutex=mutex@entry=0x563eb1886c48, deadline=...) at thread/qwaitcondition_unix.cpp:225
#7  0x00007fa66c911bf9 in QThread::wait (this=<optimized out>, deadline=...) at ../../include/QtCore/../../src/corelib/thread/qmutex.h:275
#8  0x0000563eb061f1c5 in ?? ()
#9  0x0000563eb0617636 in ?? ()
#10 0x0000563eb0617816 in ?? ()
#11 0x0000563eb04cad2a in ?? ()
#12 0x0000563eb061faaa in ?? ()
#13 0x0000563eb04c0abc in ?? ()
#14 0x00007fa66c3fa630 in __libc_start_call_main (main=main@entry=0x563eb04c0220, argc=argc@entry=1, argv=argv@entry=0x7ffca7e59a68) at ../sysdeps/nptl/libc_start_call_main.h:58
#15 0x00007fa66c3fa6f0 in __libc_start_main_impl (main=0x563eb04c0220, argc=1, argv=0x7ffca7e59a68, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffca7e59a58) at ../csu/libc-start.c:392
#16 0x0000563eb04c36c5 in ?? ()
[Inferior 1 (process 27280) detached]

Possible duplicates by query: bug 419428, bug 389689, bug 347564, bug 316582, bug 190639.

Reported using DrKonqi
Comment 1 Szőts Ákos 2022-06-07 19:03:23 UTC
Created attachment 149538 [details]
New crash information added by DrKonqi

kleopatra (3.1.21.220401 (22.04.1)) using Qt 5.15.2

- What I was doing when the application crashed:

Choose File > Quit (exit from program).

The backtrace is similar to OP's but complete.

-- Backtrace (Reduced):
#6  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#7  0x00007fdb744a9733 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#8  0x00007fdb744566f6 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#9  0x00007fdb7443f814 in __GI_abort () at abort.c:79
#10 0x00007fdb7443f72b in __assert_fail_base (fmt=<optimized out>, assertion=<optimized out>, file=<optimized out>, line=<optimized out>, function=<optimized out>) at assert.c:92
Comment 2 Yaroslav Sidlovsky 2022-08-22 08:37:40 UTC
Created attachment 151494 [details]
New crash information added by DrKonqi

kleopatra (3.1.22.220800 (22.08.0)) using Qt 5.15.5

Kleopatra crashes every time on exit.

-- Backtrace (Reduced):
#9  0x00007f6829aaeb3e in ctx_done (op_err=<optimized out>, status=<optimized out>, ctx=0x7f67f8004df0) at /usr/src/debug/gpgme-1.15.1-6.fc36.x86_64/src/wait-global.c:125
#10 _gpgme_wait_global_event_cb (data=0x7f67f8004df0, type=<optimized out>, type_data=<optimized out>) at /usr/src/debug/gpgme-1.15.1-6.fc36.x86_64/src/wait-global.c:220
#11 0x00007f6829adf9e3 in _gpgme_engine_io_event (type_data=0x7f6807ffe920, type=GPGME_EVENT_DONE, engine=<optimized out>) at /usr/src/debug/gpgme-1.15.1-6.fc36.x86_64/src/engine.c:1064
#12 _gpgme_cancel_with_err (ctx=ctx@entry=0x7f67f8004df0, ctx_err=ctx_err@entry=117440611, op_err=op_err@entry=0) at /usr/src/debug/gpgme-1.15.1-6.fc36.x86_64/src/gpgme.c:193
#13 0x00007f6829adfba4 in gpgme_cancel (ctx=0x7f67f8004df0) at /usr/src/debug/gpgme-1.15.1-6.fc36.x86_64/src/gpgme.c:210
Comment 3 osfer9111 2022-12-27 19:17:55 UTC
Created attachment 154852 [details]
New crash information added by DrKonqi

kleopatra (3.1.22.220801 (22.08.1)) using Qt 5.15.6

Crashes when closing.

The only error output from launching via terminal: kleopatra: ../../src/wait-global.c:125: ctx_done: Assertion `li' failed.

-- Backtrace (Reduced):
#4  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
#5  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#6  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#7  0x00007f095923bc46 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#8  0x00007f09592227fc in __GI_abort () at ./stdlib/abort.c:79
Comment 4 yescallop 2023-05-06 05:59:01 UTC
Created attachment 158733 [details]
New crash information added by DrKonqi

kleopatra (3.1.26.230400 (23.04.0)) using Qt 5.15.9

I'm running Kleopatra 3.1.26.230400 with GnuPG 2.4.1, GPGME 1.20.0, and Libgcrypt 1.10.2.

Kleopatra crashes every time when it's shut down via the system tray menu.

I can only reproduce the crash when the `disable-scdaemon` option is enabled in the `gpg-agent.conf`.

I cannot reproduce the crash with GnuPG 2.2.41 (LTS) installed instead.

-- Backtrace (Reduced):
#6  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#7  0x00007fd98da9f2d3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#8  0x00007fd98da4fa08 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#9  0x00007fd98da38538 in __GI_abort () at abort.c:79
#10 0x00007fd98da3845c in __assert_fail_base (fmt=0x7fd98dbb4b08 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7fd98fe9108b "li", file=file@entry=0x7fd98fe9107d "wait-global.c", line=line@entry=125, function=function@entry=0x7fd98fe924e0 <__PRETTY_FUNCTION__.1.lto_priv.1> "ctx_done") at assert.c:92
Comment 5 Yaroslav Sidlovsky 2023-08-28 13:50:07 UTC
Created attachment 161240 [details]
New crash information added by DrKonqi

kleopatra (3.1.28.230800 (23.08.0)) using Qt 5.15.10

Crashing on exit....

-- Backtrace (Reduced):
#9  0x00007f68ab180cc5 in _gpgme_wait_global_event_cb () from /lib64/libgpgme.so.11
#10 0x00007f68ab1b3fb4 in _gpgme_cancel_with_err () from /lib64/libgpgme.so.11
#11 0x00007f68ab1b4166 in gpgme_cancel () from /lib64/libgpgme.so.11
#12 0x00007f68ab1eff8c in GpgME::Context::cancelPendingOperationImmediately() () from /lib64/libgpgmepp.so.6
#13 0x0000557b4c973041 in Kleo::DeviceInfoWatcher::Worker::~Worker (this=<optimized out>, this=<optimized out>) at /usr/src/debug/kleopatra-23.08.0-1.fc38.x86_64/src/smartcard/deviceinfowatcher.cpp:37
Comment 6 Yaroslav Sidlovsky 2023-08-28 14:03:29 UTC
Created attachment 161241 [details]
More detailed stacktrace from gdb

More detailed stacktrace.

Output from console:
---
org.kde.pim.kleopatra: Running SCD SERIALNO --all failed: Service is not running (code: 318, source: SCD)
org.kde.pim.kleopatra: SmartCardWidget::Private::cardAddedOrChanged: App  is not supported
kleopatra: wait-global.c:125: ctx_done: Assertion `li' failed.
KCrash: Application 'kleopatra' crashing...
The Wayland connection experienced a fatal error: Bad file descriptor
---

I think that this line is interesting: `kleopatra: wait-global.c:125: ctx_done: Assertion `li' failed.`
Comment 7 Yaroslav Sidlovsky 2023-08-28 14:06:02 UTC
Gpgme line where assert is triggered:
https://github.com/gpg/gpgme/blob/3f297387bf401475385c458e4d1d95b3eefaf3d8/src/wait-global.c#L125C3-L125C15
Comment 8 Andre Heinecke 2023-08-29 07:13:15 UTC
Thanks for the detailed update. Looking into it. I added a tracking task in our GnuPG dev tracker. https://dev.gnupg.org/T6688 since this is mostly a GPGME issue. I hope to remember to close this as  "Resoived upstream" once we have a fix.