[Kde-pim] Review Request: Using gdb to debug akonadi_agent_launcher is not always possible

Milian Wolff mail at milianw.de
Tue Nov 8 11:35:46 GMT 2011



> On Nov. 7, 2011, 5:42 p.m., Milian Wolff wrote:
> > libs/xdgbasedirs.cpp, line 329
> > <http://git.reviewboard.kde.org/r/103064/diff/1/?file=40539#file40539line329>
> >
> >     this will leak the process
> 
> Guy Maurel wrote:
>     Sorry, I don't anderstand your comment.
>     Do you agree with me, we have a problem with the situation I described?
>     Do you have a better fix for that?
>     What do I have to do now?

Yes I've encountered my fair share of such QProcess errors, but just leaking the process is not the right solution.

you'd have to do something like this:

QProcess *proc = new QProcess();
QObject::connect(proc, SIGNAL(int), proc, SLOT(deleteLater()));

that way the process will be deleted after it finished.

Alternatively, have you tried

QProcess proc;
if (proc.execute(...) == 0) {

}

Unrelated to that I don't know/understand how gdb changes the process behavior here such that the process gets deleted before it has finished. this should not happen. 


- Milian


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103064/#review7996
-----------------------------------------------------------


On Nov. 7, 2011, 5:33 p.m., Guy Maurel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103064/
> -----------------------------------------------------------
> 
> (Updated Nov. 7, 2011, 5:33 p.m.)
> 
> 
> Review request for Akonadi.
> 
> 
> Description
> -------
> 
> Using gdb to debug
>   akonadi_agent_launcher akonadi_maildir_resource akonadi_maildir_resource_0
> I use the dgb command
>   set detach-on-fork off
> 
> This is not possible because the process will been killed
>   QProcess: Destroyed while process is still running.
>   Program terminated with signal SIGKILL, Killed.
>   The program no longer exists.
> 
> Looking at
>   http://sector.ynet.sk/qt4-tutorial/how-to-read-qt-documentation-basic-concepts.html
> 
> we can found the explanation under
>   Memory allocation on stack vs. heap
>   ...
>   Solution to this is to create variable on heap.
> 
> I propose the same here to be able to debug the akonadi_agent_launcher, changing
>   QProcess proc;
> to
>   QProcess *proc = new QProcess();
> 
> 
> Diffs
> -----
> 
>   libs/xdgbasedirs.cpp 6307b70 
> 
> Diff: http://git.reviewboard.kde.org/r/103064/diff/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Guy Maurel
> 
>

_______________________________________________
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