Opened 12 years ago

Closed 12 years ago

#1933 closed defect (fixed)

v.overlay ends with sigsegv in cut lines by polygon

Reported by: mapycz Owned by: grass-dev@…
Priority: blocker Milestone: 7.0.0
Component: Vector Version: svn-trunk
Keywords: v.overlay Cc:
CPU: x86-64 Platform: Linux

Description

we tried cut contours by polygon but v.overaly crashed

our training dta consist of contour lines and polygon these data is in tar.bz2 archive in this location: http://work.talasek.sk:2222/download/grass_error.tar.bz2

here is some debug

GRASS 7.0.svn (test1):~/grassgis/grass-svn > gdb v.overlay GNU gdb (GDB) 7.4.1-debian Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /usr/local/grass-7.0.svn/bin/v.overlay...done. (gdb) run ainput=cnt_sm atype=line binput=cut_poly operator=and output=cnt_cut1 --overwrite Starting program: /usr/local/grass-7.0.svn/bin/v.overlay ainput=cnt_sm atype=line binput=cut_poly operator=and output=cnt_cut1 --overwrite [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". WARNING: Vector map <cnt_cut1> already exists and will be overwritten WARNING: Table <cnt_cut1> linked to vector map <cnt_cut1> does not exist Copying vector features from <cnt_sm@miro>...

100%

Copying vector features from <cut_poly@miro>...

100%

Breaking lines...

0%

Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7b7e55b in break_lines (Map=0x7fffffffc040, List_break=0x0, List_ref=0x61f8d0, type=6, Err=0x0, check=0) at break_lines.c:360

360 !touch1_w && nodex == BBox->E)

(gdb) info local APoints = 0x1276530 BPoints = 0x1276560 Points = 0x1276590 AXLines = 0x7ffff753328c BXLines = 0x7fffffffa9b0 ACats = 0x12765c0 BCats = 0x12765e0 Cats = 0x1276600 i = 0 j = -1 k = 32767 l = -20688 ret = -138628762 atype = 4 btype = 4 aline = 17849 bline = 17849 found = 0 iline = 0 nlines = 13 nlines_org = 17861 naxlines = 32767 nbxlines = -7760 nx = 32767 xx = 0x0 yx = 0x0 zx = 0x0 ABox = {N = 5557464.4957634434, S = 5506178.6524737561, E = 790483.12121040502, W = 725733.38919512555, T = 0, B = 0} BBox = 0x7fffe7415fe0 List = 0x1276620 nbreaks = 0 touch1_n = 1 touch1_s = 1 touch1_e = 1 touch1_w = 0 touch2_n = 1 touch2_s = 1 touch2_e = 1 touch2_w = 1 is3d = 0 node = 17862 anode1 = 17862 anode2 = 17863 bnode1 = 17862 bnode2 = 17863 nodex = 725733.38919512555 nodey = 5556926.5740271173 a_is_ref = 1 b_is_ref = 1 break_a = 1 break_b = 0 (gdb)

Attachments (3)

before_cut.jpg (253.3 KB ) - added by mapycz 12 years ago.
after_cut.jpg (164.0 KB ) - added by mapycz 12 years ago.
correct_cut.jpg (170.8 KB ) - added by mmetz 12 years ago.
correct cut with r55858

Download all attachments as: .zip

Change History (19)

comment:1 by mapycz, 12 years ago

Resolution: invalid
Status: newclosed

comment:2 by mapycz, 12 years ago

Resolution: invalid
Status: closedreopened

hmm big fixed but .... can u see for result ? some lines disappear and result is nod good, computataion is abnormally fast

i feel it is something similar #55854

comment:3 by mapycz, 12 years ago

sry similar ticket is #1875

comment:4 by mapycz, 12 years ago

Platform: UnspecifiedLinux
Version: unspecifiedsvn-trunk

in reply to:  2 comment:5 by mmetz, 12 years ago

Replying to mapycz:

hmm big fixed but .... can u see for result ? some lines disappear and result is nod good

I checked with r55797, no disappearing lines, result seems good. Can you provide a screenshot and coordinates where lines disappear?

comment:6 by mapycz, 12 years ago

u can try my dataset http://work.talasek.sk:2222/download/grass_error.tar.bz2 in my machine result of cut is totally unusable i attach two screenshots before cut and after cut (i want cut contours by blue polygon)

v.overlay ainput=cnt_sm atype=line binput=cut_poly operator=and output=cnt_cut1 --overwrite

by mapycz, 12 years ago

Attachment: before_cut.jpg added

by mapycz, 12 years ago

Attachment: after_cut.jpg added

by mmetz, 12 years ago

Attachment: correct_cut.jpg added

correct cut with r55858

in reply to:  6 comment:7 by mmetz, 12 years ago

Replying to mapycz:

u can try my dataset http://work.talasek.sk:2222/download/grass_error.tar.bz2 in my machine result of cut is totally unusable i attach two screenshots before cut and after cut (i want cut contours by blue polygon)

I can not reproduce, see attachment for the correct cut with GRASS 7 r55858. Please make sure that you have updated vector libs and v.overlay.

v.overlay ainput=cnt_sm atype=line binput=cut_poly operator=and output=cnt_cut1 --overwrite

comment:8 by mapycz, 12 years ago

machine

Linux eva 3.2.0-2-amd64 #1 SMP Tue Mar 20 18:36:37 UTC 2012 x86_64 GNU/Linux

GCC: gcc version 4.6.3 (Debian 4.6.3-1)
CPU: 12x Intel(R) Xeon(R) CPU E5645  @ 2.40GHz
RAM: 64GB

we have latest source {{{ grassgis/grass-svn$ svn info Path: . URL: https://svn.osgeo.org/grass/grass/trunk Repository Root: https://svn.osgeo.org/grass Repository UUID: 15284696-431f-4ddb-bdfa-cd5b030d7da7 Revision: 55884 Node Kind: directory Schedule: normal Last Changed Author: wenzeslaus Last Changed Rev: 55884 Last Changed Date: 2013-04-18 11:45:54 +0200 (Thu, 18 Apr 2013) }}}

comment:9 by mapycz, 12 years ago

sorry

svn info
Path: .
URL: https://svn.osgeo.org/grass/grass/trunk
Repository Root: https://svn.osgeo.org/grass
Repository UUID: 15284696-431f-4ddb-bdfa-cd5b030d7da7
Revision: 55884
Node Kind: directory
Schedule: normal
Last Changed Author: wenzeslaus
Last Changed Rev: 55884
Last Changed Date: 2013-04-18 11:45:54 +0200 (Thu, 18 Apr 2013)

comment:10 by mapycz, 12 years ago

and question is how long time consumpting your computation our is abnormally fast , if we use grass 6.4 then result was good and computation time was more tmes more than 7.0

in reply to:  10 comment:11 by mmetz, 12 years ago

Replying to mapycz:

and question is how long time consumpting your computation our is abnormally fast , if we use grass 6.4 then result was good and computation time was more tmes more than 7.0

50 sec on 6.4, 4 sec on 7.0. The results are identical. The machine is a laptop with linux and Intel(R) Core(TM) i5 CPU M 450 @ 2.40GHz.

Do you have local changes in v.overlay? No local changes on my side. Does recompiling (make distclean, configure, make) help?

comment:12 by mapycz, 12 years ago

we discover that problem appear only if we generate contours from dem , than smooth it and than v.overlay . Everything work if smoothed contour was saved to shapefile and then read from it and then clipping

now we build our start dataset and our action sequence to reproduce this bug

in reply to:  12 comment:13 by mmetz, 12 years ago

Replying to mapycz:

we discover that problem appear only if we generate contours from dem , than smooth it and than v.overlay .

OK. The contours are 3D, the polygon is 2D, that causes problems for the clipping.

Everything work if smoothed contour was saved to shapefile and then read from it and then clipping

You can also transform contour z values to zero with v.transform zscale=0, then v.overlay.

You could create a new ticket for the 3D lines clipping problem.

comment:14 by mapycz, 12 years ago

can u try reproduce error ? if yes i will create ticket our input dataset http://work.talasek.sk:2222/download/grass_error1.tar.bz2

our commands

v.in.ogr ./polygon.shp   output=cut_poly --overwrite
r.in.gdal ./terrain.tif output=dem --overwrite

g.region rast=dem.1

r.contour dem.1 output=cnt cut=200 step=10 --overwrite
v.generalize cnt output=cnt_sm method=sliding_averaging  look_ahead=7 slide=1 threshold=1 --overwrite
v.overlay ainput=cnt_sm atype=line binput=cut_poly operator=and output=cnt_cut1 --overwrite

in reply to:  14 comment:15 by mmetz, 12 years ago

Replying to mapycz:

can u try reproduce error ?

Yes, fixed with r55907. It's only a small change to v.overlay.

Note that the output of v.overlay is always 2D (has always been so). The contour levels in the "level" column are preserved if you add the option olayer=0,1,0 to v.overlay.

comment:16 by mapycz, 12 years ago

Resolution: fixed
Status: reopenedclosed

yes thanks , it works well now

Note: See TracTickets for help on using tickets.