Opened 8 years ago

Closed 8 years ago

#2868 closed defect (fixed)

v.in.ogr Segmentation fault

Reported by: DmitryKolesov Owned by: grass-dev@…
Priority: normal Milestone: 7.0.5
Component: Vector Version: svn-releasebranch70
Keywords: v.in.ogr Cc:
CPU: Unspecified Platform: Unspecified

Description (last modified by neteler)

I got segmentation fault in v.in.ogr module with -t flag. To reproduce it, type the next lines (in Lat-Lon location):

> g.version -r
GRASS 7.0.3svn (2016)
libgis Revision: 67364 
libgis Date: 2015-12-24 18:07:44 +0300

> echo '{"type": "MultiPolygon", "coordinates": [[[[41.16783751473027, 49.18823659816202], [41.17928406367621, 49.19697811717231], [41.18910195623221, 49.18532946770238], [41.204306122079, 49.16872544901082], [41.19158201698379, 49.1659820458448], [41.18895894443899, 49.16549865975956], [41.18763568560129, 49.16499058729008], [41.16783751473027, 49.18823659816202]]]]}' > test.geojson


> v.in.ogr -t input=test.geojson layer=OGRGeoJSON out=tmp --o
 Check if OGR layer <OGRGeoJSON> contains polygons...
 100%
 Importing 1 features (OGR layer <OGRGeoJSON>)...
 100%
 -----------------------------------------------------
 Registering primitives...
 ...
 Number of nodes: 1
 Number of primitives: 2
 Number of points: 0
 Number of lines: 0
 Number of boundaries: 1
 Number of centroids: 1
 Number of areas: 1
 Number of isles: 1

 Segmentation fault (core dumped)

But the map is created:

> v.out.ascii tmp format=wkt
POLYGON((41.16783751 49.18823660, 41.17928406 49.19697812, 41.18910196 49.18532947, 41.20430612 49.16872545, 41.19158202 49.16598205, 41.18895894 49.16549866, 41.18763569 49.16499059, 41.16783751 49.18823660))

PS If I don't use -t flag the error doesn't appear.

Attachments (1)

v_in_ogr_notab.diff (1.6 KB ) - added by mlennert 8 years ago.
simpler and more complete replacement of original patch

Download all attachments as: .zip

Change History (9)

comment:1 by neteler, 8 years ago

Component: DefaultVector
Description: modified (diff)
Keywords: v.in.ogr added
Version: unspecifiedsvn-releasebranch70

comment:2 by neteler, 8 years ago

I can confirm this issue on Fedora23, 64bit:

gdb v.in.ogr
(gdb) r -t input=test.geojson layer=OGRGeoJSON out=tmp  --o
...
Number of nodes: 1
Number of primitives: 2
Number of points: 0
Number of lines: 0
Number of boundaries: 1
Number of centroids: 1
Number of areas: 1
Number of isles: 1

Program received signal SIGSEGV, Segmentation fault.
0x00000000004076e1 in main ()
(gdb) bt
#0  0x00000000004076e1 in main ()
(gdb) bt full
#0  0x00000000004076e1 in main ()
No symbol table info available.

The backtrace is useless, though. Strange.

comment:3 by mlennert, 8 years ago

Try the attached patch: v.in.ogr tried to manipulate a database driver even though this is only opened if the -t flag is not set.

by mlennert, 8 years ago

Attachment: v_in_ogr_notab.diff added

simpler and more complete replacement of original patch

comment:4 by martinl, 8 years ago

Patch tested and applied in trunk as r67591 for better testing.

Last edited 8 years ago by martinl (previous) (diff)

comment:5 by neteler, 8 years ago

Milestone: 7.0.3

Ticket retargeted after milestone closed

comment:6 by neteler, 8 years ago

Milestone: 7.0.4

Ticket retargeted after 7.0.3 milestone closed

comment:7 by martinl, 8 years ago

Milestone: 7.0.47.0.5

comment:8 by martinl, 8 years ago

Resolution: fixed
Status: newclosed

In 69226:

v.in.ogr Segmentation fault (fix #2868) - patch by mlennert

Note: See TracTickets for help on using tickets.