[Kde-pim] KMail-mobile crash investigated

David Faure faure at kde.org
Wed Dec 1 22:23:41 GMT 2010


Hello,

I've been investigating why sabine's kmail-mobile would crash as soon as she opened the composer.

It turns out that the following is happening, in ComposerView:

1) KDeclarativeFullScreenView::delayedInit() is called, which does this:

 // call setSource() only once our derived classes have set up everything
  QMetaObject::invokeMethod( this, "setQmlFile", Qt::QueuedConnection, Q_ARG(QString, qmlPath ) );

2) ComposerView::delayedInit() then continues, and creates an identitymanager, a transport manager, etc.
TransportManagerPrivate::readConfig() is called, which calls migrateToWallet().

3) This displays a messagebox saying
"The following mail transports store their passwords in an unencrypted configuration file.
For security reasons, please consider migrating these passwords to KWallet, the KDE Wallet management tool,
which stores sensitive data for you in a strongly encrypted file.
Do you want to migrate your passwords to KWallet?"
[indeed ~/.kde/share/config/mailtransports had a password for the transport that sabine re-created
last week, there seems to be an unrelated problem there]

[I had to install kdelibs5-dbg to actually be able to extract this text from the messagebox call, since it
crashes right afterwards... fun]

4) Just after this messagebox is shown, the delayed call to setQmlFile is handled,
so qml loads kmail-mobile.qml, even though the actions were not created yet!
This leads to http://www.davidfaure.fr/2010/kmail-mobile-crash.txt

Suggestion:

A) how about not using invokeMethod+QueuedConnection and just asking derived classes to call
a method once they're ready? This seems to be a much smaller risk (and it would be immediately
noticed if someone forgot) compared to stuff that runs unexpectedly early when a messagebox
happens to be shown in some circumstances.

and

B) how about initializing transports from some code that will not get broken by nested
event loops, rather than doing it on demand somewhere random? ;)

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. Konqueror (http://www.konqueror.org).
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list