Review Request 127038: Fix crash when starting a new job if a job for given configuration is already running
Aleix Pol Gonzalez
aleixpol at kde.org
Fri Feb 12 11:11:45 UTC 2016
> On Feb. 12, 2016, 1:05 a.m., Aleix Pol Gonzalez wrote:
> > Just a warning to stderr might be a bit hard to guess?
> >
> > In fact it might be useful to add a property to the NativeAppJob that we can simply set when configuring the CTest job to skip this check instead.
>
> Maciej Cencora wrote:
> Would you care to explain what is this feature all about?
KDevelop just used to spawn a process, which made testing hard sometimes because you had to remember to shut down applications. This was especially bad when debugging a dbus service. The solution for that was to add this message box, but that's entirely for user-triggered executables but for tests it shouldn't happen.
Maybe the messagebox is just on the wrong layer.
- Aleix
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127038/#review92281
-----------------------------------------------------------
On Feb. 11, 2016, 9:46 a.m., Maciej Cencora wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/127038/
> -----------------------------------------------------------
>
> (Updated Feb. 11, 2016, 9:46 a.m.)
>
>
> Review request for KDevelop.
>
>
> Repository: kdevplatform
>
>
> Description
> -------
>
> If we happen to enter the if branch, QMessageBox is shown and local processing loop gets invoked.
> If a job that was on currentJobs() list finishes before user closes the message box, the job will be deleted and on next iteration of the foreach loop, findNativeJob will crash trying to perform qobject_cast on deleted object.
>
> currentJobList(job#1, job#2)
> enter loop:
> - first loop iteration (process job#1)
> - duplication detected
> - show QMessageBox
> - enter local event loop
> - job#2 finishes
> - user closes the QMessageBox
> - QMessageBox returns
> - next loop iteration (process job#2)
> - findNativeJob(job#2)
> - qobject_cast on deleted object -> CRASH
>
>
> While attached patch fixes the crash, it does not fix a problem of running multiple test suites in parallel (when starting one after another manually by user).
> I don't know why we allow only one job per configuration. Is this loop needed at all?
> I need your help on where to go from this.
>
>
> Diffs
> -----
>
> plugins/execute/nativeappjob.cpp fcc0a38
>
> Diff: https://git.reviewboard.kde.org/r/127038/diff/
>
>
> Testing
> -------
>
> To reproduce this issue:
>
> 1) create empty cmake project with two tests:
> cmake_minimum_required(VERSION 2.6)
> project(unit_test_crash)
>
> enable_testing()
>
> find_program(SLEEP sleep)
> find_program(ECHO echo)
>
> add_test(unit_test_crash ${SLEEP} 5)
> add_test(unit_test_crash2 ${ECHO} "Test 2 finished")
>
> 2) show the Unit Tests view
> 3) start the test "unit_test_crash" (by single left mouse click on it)
> 4) while the first test is running, start the second test
>
>
> Thanks,
>
> Maciej Cencora
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20160212/4d97dd4f/attachment.html>
More information about the KDevelop-devel
mailing list