-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QgsTask and task manager cause crash when used in function scope #28531
Comments
Author Name: Giovanni Manghi (@gioman) Please add the description also here, thanks.
|
Author Name: Graham Duls (Graham Duls) QGIS version 3.4.2 If you define a task and add it to the task manager within a function scope, it will cause the task to either not execute properly or, at worst, crash QGIS. Consider the following code:
If you put this in the script editor in QGIS and execute it, it will run just fine. The user can cancel. The exceptions are raised, occasionally. All is well. Now if you replace the last block of the code to be within a function scope, like so:
Now when you run the script you will find that either task1 will appear to run, but the completed() function will never be reached (task2 will NOT run) or QGIS will crash. If you run it twice, QGIS will most surely crash. This will also happen when using the class method. |
Author Name: Giovanni Manghi (@gioman)
|
It seems this is still an open issue - I am running into the same problems when using QgsTask in python methods. |
This still appears to be an issue in 3.22.7 |
This still appears to be an issue in 3.22.16. I call QgsTask in the function of self defined python class, it crashes randomly... |
Author Name: Graham Duls (Graham Duls)
Original Redmine Issue: 20711
Affected QGIS version: 3.4.2
Redmine category:python_bindings_/_sipify
I have a detailed description of the issue in an answer on the stack:
https://gis.stackexchange.com/a/304801/89589
Crash ID: 5aa220a1a8bf05838b9ee7e715ec57d7c74f0b05
Stack Trace
CPLStringList::empty :
PyInit__core :
QgsTask::start :
QThreadPoolPrivate::reset :
QThread::start :
BaseThreadInitThunk :
RtlUserThreadStart :
QGIS Info
QGIS Version: 3.4.2-Madeira
QGIS code revision: 22034aa
Compiled against Qt: 5.11.2
Running against Qt: 5.11.2
Compiled against GDAL: 2.3.2
Running against GDAL: 2.3.2
System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.17134
The text was updated successfully, but these errors were encountered: