[Kde-pim] Investigating a bug in KMail Search

Daniel Vrátil dvratil at kde.org
Mon Feb 1 08:48:42 GMT 2016


On Sunday, January 31, 2016 7:06:15 PM CET Tom Warnke wrote:
> Hi again,
> 
> I continued to look through the code of akonadi, kdepim and kdepimlibs.
> Currently I am trying to get akonadiconsole to work correctly, to ultimately
> investigate the issues with the search.
> 
> I noticed that the browser in akonadiconsole does not show the contents of
> my mail folders, so I started to look there. This issue can be "fixed" by
> doing statisticsProxyModel->setExtraColumnsEnabled(false); in
> browserwidget.cpp, which disables the proxyDataChanged() method in
> StatisticsProxyModel. Thus, I think this proxy model might be a good place
> to continue my search for bugs
> :-)

This is *very* interesting and indeed points to some nasty bug, possibly 
something we missed during Qt4->Qt5 porting - IIRC the Browser view is broken 
since the beginning of KF5 port :). Many thanks for looking into this!

> 
> Now, my question is a technical one. How to debug kdepimlibs? I am on
> OpenSuse and using Qt Creator. I have cloned the kdepimlibs git repo and
> can look into the source code. However, when I execute akonadiconsole, it
> uses the kdepimlibs that were installed by my package manager. How can I
> make akonadiconsole use my modified kdepimlibs? How can I use Qt Creator to
> step through the code of kdepimlibs while executing a binary from kdepim?

Assuming you installed your self-compiled kdepimlibs into some prefix, let's 
assume /opt/kde-pim, you need to export a few env variables before running the 
program:

export LD_LIBRARY_PATH=/opt/kde-pim/lib:$LD_LIBRARY_PATH
export PATH=/opt/kde-pim/bin:$PATH
export XDG_DATA_DIRS=/opt/kde-pim/share:$XDG_DATA_DIRS
export QT_PLUGIN_PATH=/opt/kde-pim/lib/plugins:$QT_PLUGIN_PATH

(make sure that the paths above are valid, they work for me on Fedora, but 
openSuSE might use different default locations (lib vs. lib64, lib/plugins vs. 
lib/qt5/plugins, etc.).

That will make sure that akonadiconsole picks the libraries from the prefix, 
and will fallback to /usr/lib/ if it can't find them there.

In Qt Creator you can use Debug -> Start Debugging -> Attach to running 
application to attach to...well, a running application :) That should give you 
what you need.

As a side note, you might want too consider building the entire KDE PIM from 
git - you can use kdesrc-build [0] so that you don't need to deal with 
dependencies between the repositories.I you can configure it to compile 
everything with -DCMAKE_BUILD_TYPE=Debug, which will give you the best 
debugging information (at some minor performance cost), and it will make sure 
that you are not running into bugs caused by some behavior changes and 
whatnot. It's also IMO easier to get around 

Oh, and regarding kdepimlibs please note that since ~2 weeks ago the main code 
of kdepimlibs (the Akonadi client libraries) has been moved to akonadi.git 
repository.


> It would be great if you could point me to some documentation on this. If
> there is none, I would try to write something as soon as I get this to work

If you run into any troubles with the set up or with debugging, just let me 
now (feel free to ping me on #akonadi).

Cheers,
Dan


[0] https://kdesrc-build.kde.org/

> 
> :-)
> 
> Thank you,
> Tom
> 
> On Monday, January 18, 2016 6:28:44 PM CET Daniel Vrátil wrote:
> > On pondělí 18. ledna 2016 9:03:14 CET Tom Warnke wrote:
> > > Hi all,
> > 
> > Hi Tom!
> > 
> > > I've be investigating a bug in the search of KMail that has been the
> > > subject of the following bug reports:
> > > https://bugs.kde.org/show_bug.cgi?id=352472
> > > https://bugs.kde.org/show_bug.cgi?id=353671
> > > https://bugs.kde.org/show_bug.cgi?id=353318
> > > https://bugs.kde.org/show_bug.cgi?id=354406
> > > https://bugs.kde.org/show_bug.cgi?id=353675
> > > 
> > > The symptoms are:
> > > 1) Sometimes, when search folders are deleted, the tree view in the left
> > > pane of KMail gets messed up. Empty lines, account order is wrong etc.
> > > This
> > > can be fixed by restarting KMail.
> > 
> > This is probably a bug in one of the many many proxy models. It's not
> > related to the Search Folder directly, it can be reproduced whenever a
> > top-level entry in the collection tree is removed.
> > 
> > > 2) Existing search folders cannot be modified. They will always show the
> > > results that they showed when they were created, no matter how the query
> > > is
> > > changed.
> > 
> > That sounds like a bug in the Akonadi server.
> > 
> > > 3) New searches and search folders return no results most of the time.
> > > If
> > > they return results, they are sometimes wrong.
> > :
> > :(
> > :
> > > einar77 (don't know if he's on this list) told me on IRC that issue 1)
> > > is
> > > related to the Entity Tree Model that is somehow disconnected from the
> > > view
> > > in KMail.
> > 
> > Could also be the reason. You can use a tool called GammaRay to introspect
> > the KMail models (and much more) and see on which level things go wrong.
> > 
> > > To look into the issues, I cloned the source of KMail 5.1.1, set up a
> > > build
> > > environment and stepped through searchwindow.cpp with QT Creator.
> > > However,
> > > I could not find something wrong. I would like to continue looking in
> > > Akonadi. My question is: What is the best way to debug Akonadi with all
> > > its subprojects and processes?
> > 
> > The window is really just a window, the actual search functionality is
> > implemented in Akonadi server and friends. Basically for the search, you
> > are> 
> > really only interested in three components:
> >   * Akonadi Indexing Agent (from akonadi-search.git repository), which
> >   takes
> > 
> > care of indexing all data in Akonadi and storing them in an index database
> > * Akonadi Search Plugin (also from akonadi-search.git), which is loaded by
> > the Akonadi Server and allows it to search in the index database * Akonadi
> > Server (from akonadi.git) - the Akonadi Server itself, which manages the
> > search collections and the results and keeps them up-to-date
> > 
> > > Sorry for the long mail. I've been a user of the KDE PIM suite for
> > > years,
> > > but have just started looking at the inside. I'm just trying to make
> > > sure
> > > I
> > > did not make an obvious mistake :-)
> > 
> > No worries, if you have any questions, feel free to ask here on or IRC.
> > 
> > Thanks for looking into these issues!
> > 
> > 
> > Dan
> > 
> > > Best,
> > > Tom
> > > _______________________________________________
> > > 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/
> 
> _______________________________________________
> 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/


-- 
Daniel Vrátil
www.dvratil.cz | dvratil at kde.org
IRC: dvratil on Freenode (#kde, #kontact, #akonadi, #fedora-kde)

GPG Key: 0x4D69557AECB13683
Fingerprint: 0ABD FA55 A4E6 BEA9 9A83 EA97 4D69 557A ECB1 3683
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20160201/80ee95f6/attachment.sig>
-------------- next part --------------
_______________________________________________
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