Opened 10 years ago

Closed 9 years ago

#2476 closed defect (fixed)

vector digitizer crashing with _breakLineAtIntersection

Reported by: annakrat Owned by: grass-dev@…
Priority: normal Milestone: 7.0.3
Component: wxGUI Version: svn-trunk
Keywords: vdigit Cc:
CPU: Unspecified Platform: Linux

Description

I was able to reproduce this crash every time.

  1. draw a line (just 2 points)
  2. draw an area so that it intersects with the line
  3. right click to confirm, crash

Crashing happens in level_two.c in wxdigit.py in _addFeature. Without the line, the area closes without problem, so maybe _breakLineAtIntersection is where something goes wrong.

Change History (7)

in reply to:  description ; comment:1 by mmetz, 10 years ago

Replying to annakrat:

Crashing happens in level_two.c in wxdigit.py in _addFeature. Without the line, the area closes without problem, so maybe _breakLineAtIntersection is where something goes wrong.

The problem is in wxdigit.py in _addFeature: the line is broken, afterwards the digitizer tries to get the areas for this line. But this line no longer exists because it has been broken into new lines -> crash.

You would need to get areas on each side before breaking the line, but the vector lib might only be able to build areas after the new line was broken. I would suggest to break the line only after trying to attach centroids.

in reply to:  1 ; comment:2 by mmetz, 10 years ago

Replying to mmetz:

Replying to annakrat:

Crashing happens in level_two.c in wxdigit.py in _addFeature. Without the line, the area closes without problem, so maybe _breakLineAtIntersection is where something goes wrong.

The problem is in wxdigit.py in _addFeature: the line is broken, afterwards the digitizer tries to get the areas for this line. But this line no longer exists because it has been broken into new lines -> crash.

You would need to get areas on each side before breaking the line, but the vector lib might only be able to build areas after the new line was broken. I would suggest to break the line only after trying to attach centroids.

Fixed in r63077.

in reply to:  2 ; comment:3 by annakrat, 10 years ago

Replying to mmetz:

Replying to mmetz:

You would need to get areas on each side before breaking the line, but the vector lib might only be able to build areas after the new line was broken. I would suggest to break the line only after trying to attach centroids.

Fixed in r63077.

Thanks, it's not crashing any more. But when I draw a line over an area, so that it breaks, I get this error:

Traceback (most recent call last):
  File "/home/anna/dev/grass/trunk1/dist.x86_64-unknown-
linux-gnu/gui/wxpython/mapwin/buffered.py", line 1248, in
MouseActions

self.OnRightUp(event)
  File "/home/anna/dev/grass/trunk1/dist.x86_64-unknown-
linux-gnu/gui/wxpython/mapwin/buffered.py", line 1485, in
OnRightUp

self._onRightUp(event)
  File "/home/anna/dev/grass/trunk1/dist.x86_64-unknown-
linux-gnu/gui/wxpython/vdigit/mapwindow.py", line 935, in
_onRightUp

(UserSettings.Get(group = 'vdigit', key = "category", subkey
= 'value'), )
IndexError
:
list index out of range

It seems to be related to the fix, list 'fids' is empty, but I couldn't see what's wrong.

in reply to:  3 ; comment:4 by mmetz, 10 years ago

Replying to annakrat:

Replying to mmetz:

Replying to mmetz:

You would need to get areas on each side before breaking the line, but the vector lib might only be able to build areas after the new line was broken. I would suggest to break the line only after trying to attach centroids.

Fixed in r63077.

Thanks, it's not crashing any more. But when I draw a line over an area, so that it breaks, I get [another] error.

It seems to be related to the fix, list 'fids' is empty, but I couldn't see what's wrong.

I fixed it in r63178, list 'fids' is no longer empty but can contain invalid line ids.

I can not close g.gui.vdigit because GetProgress() is not implemented, but the vector is properly created.

in reply to:  4 comment:5 by annakrat, 10 years ago

Replying to mmetz:

I can not close g.gui.vdigit because GetProgress() is not implemented, but the vector is properly created.

This should be fixed in r63204.

comment:6 by martinl, 9 years ago

Milestone: 7.0.07.0.3

This issue seems to be fixed (tested with 7.0.3svn). Closing, feel free to re-open if needed.

comment:7 by martinl, 9 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.