Opened 8 years ago
Closed 8 years ago
#6297 closed defect (worksforme)
CopyDataSource causes segmentation fault in python
Reported by: | sourish | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | default | Version: | 2.0.1 |
Severity: | normal | Keywords: | |
Cc: |
Description (last modified by )
Hello,
I'm trying to copy a shapefile data source into memory to add a field. However, it segfaults at the CopyDataSource step. Here's the code I'm using:
from osgeo import ogr, gdal shapefile = 'TM_WORLD_BORDERS-0.3.shp' orig_data_source = ogr.Open(shapefile) driver = ogr.GetDriverByName("Memory") source_ds = driver.CopyDataSource(orig_data_source, "temp_name")
The shapefile I'm using is from http://thematicmapping.org/downloads/TM_WORLD_BORDERS-0.3.zip and I've used it before for many other purposes. I've tried doing this with gdal 2.0.1 as well as gdal 1.11.2. I'm using python 2.7.6. What am I missing?
Thanks, Sourish
Change History (4)
comment:1 by , 8 years ago
Description: | modified (diff) |
---|
comment:2 by , 8 years ago
comment:3 by , 8 years ago
It was Ubuntu 14.04, self-compiled GDAL. The issue was that I used the intel compilers to compile GDAL (icc, icpc). I recompiled GDAL with (gcc, g++), and there are no more segfaults. I'm not sure why intel compilers would be a bad choice, but they were.
comment:4 by , 8 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I've tried the above with latest GDAL 1.11 branch (post 1.11.3), 2.0 branch (post 2.0.1) and trunk, and this works fine for all. Valgrind happy as well.
Which OS ? Self-compiled GDAL or a pre-built binary ? Any stacktrace ?