Opened 5 years ago

Closed 5 years ago

#3814 closed defect (fixed)

v.buffer: segfault in LL

Reported by: neteler Owned by: grass-dev@…
Priority: normal Milestone: 7.8.0
Component: LibVector Version: svn-trunk
Keywords: v.buffer Cc:
CPU: Unspecified Platform: Unspecified

Description

Inspired by an article [1] I tried v.buffer in a EPSG 4326 location:

GRASS 7.7.svn (latlong_wgs84):~ >
g.region n=90 s=-90 w=-180 e=180 res=1

v.random output=random100 n=100

v.buffer input=random100 output=random100_buff distance=0:00:01
Note: In latitude-longitude coordinate system specify distances in degree
unit
Buffering features...
Segmentation fault (core dumped)

Minimal debugging:

gdb v.buffer
GNU gdb (GDB) Fedora 8.2-6.fc29
(gdb) r input=random100 output=random100_buff distance=0:00:01 --o
...
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7f71bc4 in Vect_point_buffer2 () from /home/mneteler/software/grass77/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.7.so

Version:

g.version -g
version=7.7.svn
date=2019
revision=r74334M
build_date=2019-04-02
build_platform=x86_64-pc-linux-gnu
build_off_t_size=8

In G76 it also crashes.

[1] https://spatialthoughts.com/2019/04/05/geodesic-buffers-in-qgis/

Change History (5)

comment:1 by neteler, 5 years ago

Summary: v.buffer: sefault in LLv.buffer: segfault in LL

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

Replying to neteler:

Inspired by an article [1] I tried v.buffer in a EPSG 4326 location:

GRASS 7.7.svn (latlong_wgs84):~ >
g.region n=90 s=-90 w=-180 e=180 res=1

v.random output=random100 n=100

v.buffer input=random100 output=random100_buff distance=0:00:01
Note: In latitude-longitude coordinate system specify distances in degree
unit
Buffering features...
Segmentation fault (core dumped)

distance=0:00:01 becomes distance=0 because distance must be of type double, in this case 1/3600 = 0.0002777778

comment:3 by mmetz, 5 years ago

In 74387:

v.buffer: +test for zero distance, see #3814

comment:4 by mmetz, 5 years ago

In 74388:

v.buffer: +test for zero distance, see #3814 (backport trunk r74387)

comment:5 by neteler, 5 years ago

Resolution: fixed
Status: newclosed

Thanks, fixed!

Yes, the zero distance results from me having specified the distance in sexagesimal notation. g.region uses G_scan_northing() etc for that. But that's probably for a separate enhancement ticket.

Note: See TracTickets for help on using tickets.