Skip to content
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

python script crashes QGIS #28082

Closed
qgib opened this issue Oct 29, 2018 · 2 comments
Closed

python script crashes QGIS #28082

qgib opened this issue Oct 29, 2018 · 2 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption High Priority PyQGIS Related to the PyQGIS API

Comments

@qgib
Copy link
Contributor

qgib commented Oct 29, 2018

Author Name: Theresa Lichtenberger (Theresa Lichtenberger)
Original Redmine Issue: 20261
Affected QGIS version: 2.18.17
Redmine category:pyqgis_console


I have written a python script which has two input vector layers (one point-layer and one line-layer). The outpout is another line-layer. But when I try too set the geometry for the new edge, the python script stopps and I get the error "minidump written to C".

Here is my python script code:

https://gis.stackexchange.com/questions/300562/qgis-python-script-crashed-with-minidump-written-to-c

With the help of printf-Debugging, I have figured out that the crash is caused by this line:

-> newEdge.setGeometry(QgsGeometry.fromPolyline([geomFrom.asPoint(),geomTo.asPoint()]))

I have already deleted the .qgis2-folder and started qgis 2.18 anew. But without success.

Any suggestions?


@qgib
Copy link
Contributor Author

qgib commented Oct 29, 2018

Author Name: Giovanni Manghi (@gioman)


  • subject was changed from QGIS python script crashed with minidump written to C to python script crashes QGIS

@qgib
Copy link
Contributor Author

qgib commented Oct 30, 2018

Author Name: Nyall Dawson (@nyalldawson)


This is fixed in QGIS 3.0

In 2.x it's necessary to make an explicit copy of all geometries you capture from features, e.g.

geomFrom = QgsGeometry(feat2.geometry())

  • resolution was changed from to fixed/implemented
  • status_id was changed from Open to Closed

@qgib qgib closed this as completed Oct 30, 2018
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority PyQGIS Related to the PyQGIS API Crash/Data Corruption labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption High Priority PyQGIS Related to the PyQGIS API
Projects
None yet
Development

No branches or pull requests

1 participant