Review Request 127038: Fix crash when starting a new job if a job for given configuration is already running

Maciej Cencora m.cencora at gmail.com
Fri Feb 12 09:08:01 UTC 2016



> On Feb. 12, 2016, 12: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.

Would you care to explain what is this feature all about?


- Maciej


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127038/#review92281
-----------------------------------------------------------


On Feb. 11, 2016, 8: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, 8: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/cdd52eb9/attachment.html>


More information about the KDevelop-devel mailing list