Review Request 129993: Fix SFTP unmount
Yuxuan Shui
yshuiv7 at gmail.com
Tue Mar 7 11:08:18 UTC 2017
> On March 7, 2017, 6:19 a.m., Anthony Fieroni wrote:
> > plugins/sftp/mounter.cpp, lines 153-158
> > <https://git.reviewboard.kde.org/r/129993/diff/1/?file=492313#file492313line153>
> >
> > You can use connect(m_proc, &KProcess::readyReadStandardError, this, [this]
> > it will be safe (when kprocess or this die it will be disconnected)
Problem is we set m_proc to nullptr before it dies and things disconnect.
> On March 7, 2017, 6:19 a.m., Anthony Fieroni wrote:
> > plugins/sftp/mounter.cpp, lines 215-221
> > <https://git.reviewboard.kde.org/r/129993/diff/1/?file=492313#file492313line215>
> >
> > You can remove this code, kill will terminate process with SIGKILL, deleteLater can be used without branching.
If I didn't wait for QProcess::finished before calling deleteLater, I will get annoying messages saying QProcess is deleted while the process is still running.
- Yuxuan
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/129993/#review102739
-----------------------------------------------------------
On March 7, 2017, 3:36 a.m., Yuxuan Shui wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/129993/
> -----------------------------------------------------------
>
> (Updated March 7, 2017, 3:36 a.m.)
>
>
> Review request for kdeconnect and Albert Vaca Cintora.
>
>
> Bugs: 377040
> http://bugs.kde.org/show_bug.cgi?id=377040
>
>
> Repository: kdeconnect-kde
>
>
> Description
> -------
>
> The destructor of Mounter says it doesn't call unmount because it will crash.
>
> I tracked down the root cause of that. In unmount(), m_proc is set to nullptr before the process is killed. And Stderr/StdoutReadReady is triggered after that. So in the signal handler there's a nullptr dereference.
>
> In this patch I take some actions to make sure the process is shutdown properly.
>
>
> Diffs
> -----
>
> plugins/sftp/mounter.h a9edc26
> plugins/sftp/mounter.cpp f43a445
>
> Diff: https://git.reviewboard.kde.org/r/129993/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Yuxuan Shui
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20170307/ed59ce40/attachment.html>
More information about the KDEConnect
mailing list