Bug 189605 - remove, keys, software, crash
Summary: remove, keys, software, crash
Status: RESOLVED FIXED
Alias: None
Product: kgpg
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Mandriva RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: Rolf Eike Beer
URL:
Keywords:
: 188120 192149 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-14 13:00 UTC by François
Modified: 2009-07-02 13:01 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Adds some debug messages (1.94 KB, patch)
2009-04-19 20:30 UTC, Rolf Eike Beer
Details
Add more debug messages (3.45 KB, patch)
2009-04-23 10:32 UTC, Rolf Eike Beer
Details
Add more debug messages, second try (3.40 KB, patch)
2009-04-24 14:06 UTC, Rolf Eike Beer
Details
Proposed fix (1.75 KB, patch)
2009-04-24 16:15 UTC, Rolf Eike Beer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description François 2009-04-14 13:00:50 UTC
Version:            (using KDE 4.2.2)
OS:                Linux
Installed from:    Mandriva RPMs

Description of problem:
there are a crash when you remove a key in kgpg.

Version-Release number of selected component (if applicable):
kgpg-4.2.2-3mdv2009.1


How reproducible:
every time

Steps to Reproduce:
1. urpmi kgpg
2. add a key (public or private...)
3. remove this key.
4. confirm
5. crash

here the bt:


Application : KGpg (kgpg), signal SIGSEGV
[Current thread is 1 (Thread 0xb5ba66d0 (LWP 17416))]

Thread 2 (Thread 0xb4145b90 (LWP 17417)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb69084c1 in select () from /lib/i686/libc.so.6
#2  0xb6b993fc in QProcessManager::run (this=0x9a96e38) at
io/qprocess_unix.cpp:305
#3  0xb6ac14df in QThreadPrivate::start (arg=0x9a96e38) at
thread/qthread_unix.cpp:189
#4  0xb6822315 in start_thread () from /lib/i686/libpthread.so.0
#5  0xb691025e in clone () from /lib/i686/libc.so.6

Thread 1 (Thread 0xb5ba66d0 (LWP 17416)):
[KCrash Handler]
#6  0x08075fd7 in _start ()

bug also reported there https://qa.mandriva.com/show_bug.cgi?id=49782
Comment 1 David Palacio 2009-04-19 18:38:24 UTC
Backtrace with debug symbols:

Aplicación: KGpg (kgpg), señal SIGSEGV
0x00007fe25f0b88d1 in nanosleep () from /lib/libc.so.6
Current language:  auto; currently c
[Current thread is 0 (LWP 2371)]

Thread 2 (Thread 0x7fe253f9c950 (LWP 2372)):
#0  0x00007fe25f0e1b22 in select () from /lib/libc.so.6
#1  0x00007fe25f7ac576 in QProcessManager::run (this=0x24a5a70) at io/qprocess_unix.cpp:305
#2  0x00007fe25f6e5802 in QThreadPrivate::start (arg=0x24a5a70) at thread/qthread_unix.cpp:189
#3  0x00007fe25b433faa in start_thread (arg=<value optimized out>) at pthread_create.c:297
#4  0x00007fe25f0e82cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#5  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fe261e3e770 (LWP 2371)):
[KCrash Handler]
#5  0x00000000004363c4 in KGpgItemModel::rowForNode (this=<value optimized out>, node=0x334292a) at ../../kgpg/model/kgpgitemmodel.cpp:179
#6  0x000000000043641a in KGpgItemModel::parent (this=0x259c1f0, child=@0x7fff69f87990) at ../../kgpg/model/kgpgitemmodel.cpp:61
#7  0x00007fe26092032f in QSortFilterProxyModelPrivate::update_persistent_indexes (this=0x25a4a90, source_indexes=@0x25a4b78) at ../../include/QtCore/../../src/corelib/kernel/qabstractitemmodel.h:369
#8  0x00007fe260920f90 in QSortFilterProxyModelPrivate::_q_sourceLayoutChanged (this=0x25a4a90) at itemviews/qsortfilterproxymodel.cpp:1129
#9  0x00007fe2609229fa in QSortFilterProxyModel::qt_metacall (this=0x259a6e0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff69f87b10)
    at .moc/release-shared/moc_qsortfilterproxymodel.cpp:124
#10 0x00007fe25f7e3622 in QMetaObject::activate (sender=0x259c1f0, from_signal_index=<value optimized out>, to_signal_index=6, argv=0x3340110) at kernel/qobject.cpp:3069
#11 0x0000000000464b7a in KeysManager::secretKeyDeleted (this=0x25221d0, retcode=<value optimized out>) at ../../kgpg/keysmanager.cpp:2303
#12 0x000000000046d2a1 in KeysManager::qt_metacall (this=0x25221d0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff69f87e40) at ./keysmanager.moc:303
#13 0x00007fe25f7e3622 in QMetaObject::activate (sender=0x2946fa0, from_signal_index=<value optimized out>, to_signal_index=4, argv=0x3340110) at kernel/qobject.cpp:3069
#14 0x000000000043f68c in KGpgTransaction::done (this=0x69006500730020, _t1=0) at ./kgpgtransaction.moc:84
#15 0x0000000000440481 in KGpgTransaction::qt_metacall (this=0x2946fa0, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7fff69f87f70) at ./kgpgtransaction.moc:73
#16 0x00007fe25f7e3622 in QMetaObject::activate (sender=0x333b290, from_signal_index=<value optimized out>, to_signal_index=30, argv=0x3340110) at kernel/qobject.cpp:3069
#17 0x0000000000493520 in GPGProc::processExited (this=0x69006500730020, _t1=0x333b290) at ./gpgproc.moc:93
#18 0x0000000000493618 in GPGProc::qt_metacall (this=0x333b290, _c=QMetaObject::InvokeMetaMethod, _id=53750032, _a=0x7fff69f880a0) at ./gpgproc.moc:74
#19 0x00007fe25f7e3622 in QMetaObject::activate (sender=0x333b290, from_signal_index=<value optimized out>, to_signal_index=10, argv=0x3340110) at kernel/qobject.cpp:3069
#20 0x00007fe25f76e38f in QProcess::finished (this=0x69006500730020, _t1=0, _t2=QProcess::NormalExit) at .moc/release-shared/moc_qprocess.cpp:136
#21 0x00007fe25f77426e in QProcessPrivate::_q_processDied (this=0x334c900) at io/qprocess.cpp:718
#22 0x00007fe25f774321 in QProcess::qt_metacall (this=0x333b290, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff69f88290) at .moc/release-shared/moc_qprocess.cpp:109
#23 0x00007fe25fe1f2ad in KProcess::qt_metacall (this=0x69006500730020, _c=53750058, _id=1777891728, _a=0x3340110) at ./kprocess.moc:62
#24 0x000000000049439d in KLineBufferedProcess::qt_metacall (this=0x69006500730020, _c=53750058, _id=1777891728, _a=0x3340110) at ./klinebufferedprocess.moc:67
#25 0x00000000004935b6 in GPGProc::qt_metacall (this=0x69006500730020, _c=53750058, _id=1777891728, _a=0x3340110) at ./gpgproc.moc:67
#26 0x00007fe25f7e3622 in QMetaObject::activate (sender=0x27fc620, from_signal_index=<value optimized out>, to_signal_index=4, argv=0x3340110) at kernel/qobject.cpp:3069
#27 0x00007fe25f81a83e in QSocketNotifier::activated (this=0x69006500730020, _t1=19) at .moc/release-shared/moc_qsocketnotifier.cpp:83
#28 0x00007fe25f7e8283 in QSocketNotifier::event (this=0x27fc620, e=0x7fff69f88860) at kernel/qsocketnotifier.cpp:316
#29 0x00007fe26038167d in QApplicationPrivate::notify_helper (this=0x24a6ca0, receiver=0x27fc620, e=0x7fff69f88860) at kernel/qapplication.cpp:4084
#30 0x00007fe26038986a in QApplication::notify (this=0x24a24c0, receiver=0x27fc620, e=0x7fff69f88860) at kernel/qapplication.cpp:4049
#31 0x00007fe26100755b in KApplication::notify (this=0x24a24c0, receiver=0x27fc620, event=0x7fff69f88860) at ../../kdeui/kernel/kapplication.cpp:307
#32 0x00007fe25f7cdc4c in QCoreApplication::notifyInternal (this=0x24a24c0, receiver=0x27fc620, event=0x7fff69f88860) at kernel/qcoreapplication.cpp:602
#33 0x00007fe25f7f941a in QEventDispatcherUNIX::activateSocketNotifiers (this=<value optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:213
#34 0x00007fe25f7f9b96 in QEventDispatcherUNIXPrivate::doSelect (this=0x24a6df0, flags={i = 1777895920}, timeout=0x7fff69f889e0) at kernel/qeventdispatcher_unix.cpp:250
#35 0x00007fe25f7fb05d in QEventDispatcherUNIX::processEvents (this=0x2486620, flags={i = 1777896880}) at kernel/qeventdispatcher_unix.cpp:904
#36 0x00007fe26041a732 in QEventDispatcherX11::processEvents (this=0x2486620, flags={i = 1777896960}) at kernel/qeventdispatcher_x11.cpp:152
#37 0x00007fe25f7cc4f2 in QEventLoop::processEvents (this=<value optimized out>, flags={i = 1777897008}) at kernel/qeventloop.cpp:149
#38 0x00007fe25f7cc8bd in QEventLoop::exec (this=0x7fff69f88e70, flags={i = 1777897088}) at kernel/qeventloop.cpp:200
#39 0x00007fe25f7ceb84 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:880
#40 0x0000000000478879 in main (argc=1, argv=0x7fff69f89308) at ../../kgpg/main.cpp:59
Comment 2 Rolf Eike Beer 2009-04-19 20:30:13 UTC
Created attachment 32936 [details]
Adds some debug messages

I can't reproduce it locally. Please apply this patch and send the log so I can see what happens.
Comment 3 David Palacio 2009-04-22 01:15:17 UTC
kgpg(4388) KGpgItemModel::fixPersistentIndexes: rowForNode() 0 idx.row() 0
kgpg(4388) KGpgItemModel::delNode: deleting node  3 6
kgpg(4388) KGpgItemModel::fixPersistentIndexes: rowForNode() -1 idx.row() 3
kgpg(4388) KGpgItemModel::fixPersistentIndexes: rowForNode() -1 idx.row() 3
Comment 4 Rolf Eike Beer 2009-04-23 10:32:56 UTC
Created attachment 33029 [details]
Add more debug messages

Please try again, this should give more info. Looks like the crash happens earlier in parent().
Comment 5 Rolf Eike Beer 2009-04-24 14:06:41 UTC
Created attachment 33057 [details]
Add more debug messages, second try

Updated patch, the patch version 2 lead to a crash itself by calling a pure virtual method.
Comment 6 David Palacio 2009-04-24 16:10:10 UTC
It does not crash with the latest patch, heh.

Output (I tried twice, no crash):
kgpg(21278) KGpgItemModel::fixPersistentIndexes: rowForNode() 0 idx.row() 0
kgpg(21278) KGpgItemModel::delNode: deleting node  3 6
kgpg(21278) KGpgItemModel::invalidateIndexes: KGpgNode(0x1ed6e80)
kgpg(21278) KGpgItemModel::invalidateIndexes: row 3 column 3 node KGpgNode(0x1ed6e80) removed
kgpg(21278) KGpgItemModel::invalidateIndexes: row 3 column 4 node KGpgNode(0x1ed6e80) removed
kgpg(21278) KGpgItemModel::invalidateIndexes: row 3 column 5 node KGpgNode(0x1ed6e80) removed
kgpg(21278) KGpgItemModel::invalidateIndexes: row 3 column 6 node KGpgNode(0x1ed6e80) removed
kgpg(21278) KGpgItemModel::invalidateIndexes: row 3 column 0 node KGpgNode(0x1ed6e80) removed
kgpg(21278) KGpgItemModel::invalidateIndexes: row 3 column 1 node KGpgNode(0x1ed6e80) removed
kgpg(21278) KGpgItemModel::invalidateIndexes: row 3 column 2 node KGpgNode(0x1ed6e80) removed
kgpg(21278) KGpgItemModel::fixPersistentIndexes: rowForNode() 2 idx.row() 2
kgpg(21278) KGpgItemModel::parent: row 2 column 0
kgpg(21278) KGpgItemModel::parent: childnode KGpgKeyNode(0x20aba10)
kgpg(21278) KGpgItemModel::parent: childnode type 6
kgpg(21278) KGpgItemModel::parent: parentNode KGpgRootNode(0x1e2a040) root KGpgRootNode(0x1e2a040)
kgpg(21278) KGpgItemModel::parent: parentNode type 0
kgpg(21278) KGpgItemModel::parent: row 2 column 0
kgpg(21278) KGpgItemModel::parent: childnode KGpgKeyNode(0x20aba10)
kgpg(21278) KGpgItemModel::parent: childnode type 6
kgpg(21278) KGpgItemModel::parent: parentNode KGpgRootNode(0x1e2a040) root KGpgRootNode(0x1e2a040)
kgpg(21278) KGpgItemModel::parent: parentNode type 0
kgpg(21278) KGpgItemModel::parent: row 3 column 0
kgpg(21278) KGpgItemModel::parent: childnode KGpgKeyNode(0x2c61620)
kgpg(21278) KGpgItemModel::parent: childnode type 6
kgpg(21278) KGpgItemModel::parent: parentNode KGpgRootNode(0x1e2a040) root KGpgRootNode(0x1e2a040)
kgpg(21278) KGpgItemModel::parent: parentNode type 0
kgpg(21278) KGpgItemModel::delNode: deleting node  3 6
kgpg(21278) KGpgItemModel::invalidateIndexes: KGpgNode(0x2c61620)
kgpg(21278) KGpgItemModel::invalidateIndexes: row 3 column 4 node KGpgNode(0x2c61620) removed
kgpg(21278) KGpgItemModel::invalidateIndexes: row 3 column 5 node KGpgNode(0x2c61620) removed
kgpg(21278) KGpgItemModel::invalidateIndexes: row 3 column 6 node KGpgNode(0x2c61620) removed
kgpg(21278) KGpgItemModel::invalidateIndexes: row 3 column 0 node KGpgNode(0x2c61620) removed
kgpg(21278) KGpgItemModel::invalidateIndexes: row 3 column 1 node KGpgNode(0x2c61620) removed
kgpg(21278) KGpgItemModel::invalidateIndexes: row 3 column 2 node KGpgNode(0x2c61620) removed
kgpg(21278) KGpgItemModel::invalidateIndexes: row 3 column 3 node KGpgNode(0x2c61620) removed
Comment 7 David Palacio 2009-04-24 16:13:56 UTC
Output: (Single run)
kgpg(21687) KGpgItemModel::fixPersistentIndexes: rowForNode() 0 idx.row() 0
kgpg(21687) KGpgItemModel::delNode: deleting node  3 6
kgpg(21687) KGpgItemModel::invalidateIndexes: KGpgNode(0x2aebae0)
kgpg(21687) KGpgItemModel::invalidateIndexes: row 3 column 0 node KGpgNode(0x2aebae0) removed
kgpg(21687) KGpgItemModel::invalidateIndexes: row 3 column 1 node KGpgNode(0x2aebae0) removed
kgpg(21687) KGpgItemModel::invalidateIndexes: row 3 column 2 node KGpgNode(0x2aebae0) removed
kgpg(21687) KGpgItemModel::invalidateIndexes: row 3 column 3 node KGpgNode(0x2aebae0) removed
kgpg(21687) KGpgItemModel::invalidateIndexes: row 3 column 4 node KGpgNode(0x2aebae0) removed
kgpg(21687) KGpgItemModel::invalidateIndexes: row 3 column 5 node KGpgNode(0x2aebae0) removed
kgpg(21687) KGpgItemModel::invalidateIndexes: row 3 column 6 node KGpgNode(0x2aebae0) removed
Comment 8 Rolf Eike Beer 2009-04-24 16:15:46 UTC
Created attachment 33063 [details]
Proposed fix

Ok, this should behave the same like the last test patch. Please try again if this still works ok.
Comment 9 Rolf Eike Beer 2009-04-24 19:49:10 UTC
SVN commit 958797 by dakon:

Clean up iterating over list of persistent model indexes

CCBUG:189605


 M  +2 -11     kgpgitemmodel.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=958797
Comment 10 David Palacio 2009-04-24 22:49:39 UTC
Patch works fine.
Comment 11 Rolf Eike Beer 2009-04-24 22:59:19 UTC
SVN commit 958856 by dakon:

Clean up dealing with persistent model indexes

BUG:189605

Thanks to David Palacio for testing this.


 M  +5 -13     kgpgitemmodel.cpp  
 M  +1 -1      kgpgitemmodel.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=958856
Comment 12 Rolf Eike Beer 2009-05-10 13:15:33 UTC
*** Bug 192149 has been marked as a duplicate of this bug. ***
Comment 13 Rolf Eike Beer 2009-05-12 08:44:32 UTC
*** Bug 188120 has been marked as a duplicate of this bug. ***
Comment 14 Andrew Schulman 2009-07-02 12:15:12 UTC
I'm seeing many crashes in kgpg 4.2.4, that seem as though they may have the same cause as this one.  Can you please tell me, has this fix already gone into 4.2.4, or is it waiting for 4.3?  Thanks, Andrew.
Comment 15 Rolf Eike Beer 2009-07-02 13:01:43 UTC
Am Donnerstag 02 Juli 2009 schrieb andrex@alumni.utexas.net:
> https://bugs.kde.org/show_bug.cgi?id=189605

> I'm seeing many crashes in kgpg 4.2.4, that seem as though they may have
> the same cause as this one.  Can you please tell me, has this fix already
> gone into 4.2.4, or is it waiting for 4.3?  Thanks, Andrew.

This one has been fixed in 4.2.3. If you see more crashes please create a new 
bug with the backtrace.

Greetings,

Eike