Bug 286991 - kgpg hangs when trying to decrypt a signature
Summary: kgpg hangs when trying to decrypt a signature
Alias: None
Product: kgpg
Classification: Applications
Component: general (show other bugs)
Version: 2.6.x
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Rolf Eike Beer
Depends on:
Reported: 2011-11-19 12:55 UTC by Richard Weinberger
Modified: 2015-01-08 21:56 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.7.4

the funky signature (198 bytes, text/plain)
2011-11-20 14:28 UTC, Richard Weinberger

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Weinberger 2011-11-19 12:55:14 UTC
Application: kgpg (2.6.2)
KDE Platform Version: 4.7.3 (4.7.3) "release 10"
Qt Version: 4.7.4
Operating System: Linux x86_64
Distribution: "openSUSE 11.4 (x86_64)"

-- Information about the crash:
kgpg was running for ~30minutes in the background.
Then it crashed without any interaction from my side...

The crash can be reproduced some of the time.

-- Backtrace:
Application: KGpg (kgpg), signal: Aborted
[KCrash Handler]
#6  0x00007f5242cb1ab5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x00007f5242cb2fb6 in abort () at abort.c:92
#8  0x00007f52430aaaed in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib64/libstdc++.so.6
#9  0x00007f52430a8d06 in ?? () from /usr/lib64/libstdc++.so.6
#10 0x00007f52430a8d33 in std::terminate() () from /usr/lib64/libstdc++.so.6
#11 0x00007f52430a8e86 in __cxa_rethrow () from /usr/lib64/libstdc++.so.6
#12 0x00007f5243457f03 in QEventLoop::exec (this=0x7fff5d562c60, flags=...) at kernel/qeventloop.cpp:214
#13 0x00007f524345c27b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1064
#14 0x0000000000475794 in main (argc=3, argv=0x7fff5d563128) at /usr/src/debug/kdeutils-4.7.3/kgpg/main.cpp:57

Possible duplicates by query: bug 286980, bug 286977, bug 286969, bug 286903, bug 286868.

Reported using DrKonqi
Comment 1 Rolf Eike Beer 2011-11-19 14:07:41 UTC
This looks very much like some assertion is hit. Please start KGpg from a terminal session and paste the output that happens shortly before the crash here.
Comment 2 Richard Weinberger 2011-11-19 14:11:13 UTC
Will do, but the crash happens only very rarely...
Comment 3 Richard Weinberger 2011-11-19 19:33:19 UTC
There you go!

Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there.

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
KCrash: Application 'kgpg' crashing.
Comment 4 Rolf Eike Beer 2011-11-20 10:39:04 UTC
Ok, there is some sort of memleak happening. Could you try running

valgrind --leak-check=full kgpg --nofork

This will likely be rather slow but hopefully gives me a clue what's going on.
Comment 5 Richard Weinberger 2011-11-20 14:28:56 UTC
Created attachment 65870 [details]
the funky signature
Comment 6 Richard Weinberger 2011-11-20 14:29:42 UTC
This is not going to work.
I had some time to look a bit closer at the problem.
Kgpg seems to get stuck in an infinite loop by opening the attached pgp-signature.
Within this loop it allocates from time to time some memory, after a few hours it crashes...

You can reproduce the issue as follows:
1. kgpg --nofork
on a second shell:
2. kgpg signature.asc

Now the first kgpg process consumes 100% cpu until it crashes due to std:bad_alloc.
Comment 7 Rolf Eike Beer 2011-11-20 14:52:32 UTC
Thanks for the info, now I know what is happening. KGpg tries to decrypt the signature and gots stuck in it's communication with the underlying gpg process.
Comment 8 Rolf Eike Beer 2011-11-20 15:37:46 UTC
Git commit de841cf6a13d5c2ff5bb3cdb9002acc3afae05c9 by Rolf Eike Beer.
Committed on 20/11/2011 at 16:36.
Pushed by dakon into branch 'KDE/4.7'.

prevent KGpg to endlessly loop while trying to decrypt a detached signature

This can't work, so there is no value in trying it.


M  +3    -0    kgpgtextinterface.cpp