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

QGIS segfaults when using Qgsvectorlayer.select() inside geometryChanged handler #15751

Closed
qgib opened this issue Oct 19, 2012 · 8 comments
Closed
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption High Priority Vectors Related to general vector layer handling (not specific data formats)

Comments

@qgib
Copy link
Contributor

qgib commented Oct 19, 2012

Author Name: Rafael Varela (@rpet)
Original Redmine Issue: 6547
Affected QGIS version: master
Redmine category:vectors


I'm developing a python plugin in QGIS 1.9.0-master that makes QGIS
segfault when I call @Qgsvectorlayer.select()@ inside a @geometryChanged@
signal handler.

My code looks like this:

...

layer_A.geometryChanged.connect(self.onLineGeometryChange)

...

@pyqtSlot(int, QgsGeometry)
def onLineGeometryChange(self, featureId, geom ):
  ...
  layer_B.select( someRectangle, False )
  ...

QGIS only segfaults when using the node tool of @mDigitizeToolBar@. It does not crash when I use the move feature tool.

Looking at the source code in the git repository I found out that most of the @Qgsvectorlayer::select()@ functionality resides in the @select()@ functions of the data provider, so I decided to write the layers to disk and switch the layer data provider from "memory" to "ogr".

Unfortunately, the problem still persists.


@qgib
Copy link
Contributor Author

qgib commented Dec 30, 2012

Author Name: Giovanni Manghi (@gioman)


  • priority_id was changed from Normal to High

@qgib
Copy link
Contributor Author

qgib commented Jul 14, 2013

Author Name: Daniel Vaz (Daniel Vaz)


I create a test plugin that do nothing, except for connect the same signal and try to select something in the active layer. The plugin works fine.

I am used a shape layer and node tool (from mDigitizeToolBar) and move tool, too.

Nothing crash.

Are you sure about the existence of layer_B when some feature of layer_A was changed?

I look forward to hear you soon.


  • 5999 was configured as FixSelect.tar.gz

@qgib
Copy link
Contributor Author

qgib commented Jul 14, 2013

Author Name: Daniel Vaz (Daniel Vaz)


Steps to use the plugin

1 - Open Qgis
2 - Insert a existent shape layer
3 - Select the layer
4 - Run the plugin
5 - Click in button "1" that connect signal (geometryChanged) to slot
6 - Go to edit mode
7 - Use node tool or move tool in selected layer

Works fine.

@qgib
Copy link
Contributor Author

qgib commented Jul 17, 2013

Author Name: Jürgen Fischer (@jef-n)


  • category_id was configured as Vectors

@qgib
Copy link
Contributor Author

qgib commented Jul 17, 2013

Author Name: Rafael Varela (@rpet)


Daniel Vaz wrote:

I create a test plugin that do nothing, except for connect the same signal and try to select something in the active layer. The plugin works fine.

I am used a shape layer and node tool (from mDigitizeToolBar) and move tool, too.

Nothing crash.

Are you sure about the existence of layer_B when some feature of layer_A was changed?

Well, I'm pretty sure that @layer_B@ existed when I did my tests, but I will check it again with the current "master". I still have to upgrade my installation to run your plugin.

Bear in mind that this report is 9 months old and things may have changed a lot from the code revision I used (probably, fb7c596 from OSGeo4W package 1.9.0-227)

Thank you for your interest in this issue.

@qgib
Copy link
Contributor Author

qgib commented Jul 18, 2013

Author Name: Daniel Vaz (Daniel Vaz)


You are right.

A long time has passed since you post it. Probably the SIP was broken when you report the bug.

Thanks

@qgib
Copy link
Contributor Author

qgib commented Jul 19, 2013

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Nov 21, 2013

Author Name: Matthias Kuhn (@m-kuhn)


Closed due to lack of feedback.
Please reopen if required and add any data/info that may have been requested.


  • status_id was changed from Feedback to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Vectors Related to general vector layer handling (not specific data formats) Crash/Data Corruption labels May 24, 2019
@qgib qgib closed this as completed May 24, 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 Vectors Related to general vector layer handling (not specific data formats)
Projects
None yet
Development

No branches or pull requests

1 participant