gmt icon indicating copy to clipboard operation
gmt copied to clipboard

GMT crashes when ogr2ogr fails to do the conversion

Open seisman opened this issue 3 years ago • 0 comments

To convert a shapefile to OGR/GMT format, ogr2ogr needs the data file (.shp) and some metadata files (e.g., .shx). If the .shx file is not found, org2ogr fails to do the conversion, then GMT crashes. GMT should catch the failure and report an error, instead of crashing.

$ gmt plot @RidgeTest.shp -pdf map 
ERROR 4: Unable to open /home/seisman/.gmt/cache/RidgeTest.shx or /home/seisman/.gmt/cache/RidgeTest.SHX. Set SHAPE_RESTORE_SHX config option to YES to restore or create it.
FAILURE:
Unable to open datasource `/home/seisman/.gmt/cache/RidgeTest.shp' with the following drivers.
  -> `FITS'
  -> `PCIDSK'
  -> `netCDF'
  -> `PDS4'
  -> `VICAR'
  -> `JP2OpenJPEG'
  -> `PDF'
  -> `MBTiles'
  -> `BAG'
  -> `EEDA'
  -> `OGCAPI'
  -> `ESRI Shapefile'
  -> `MapInfo File'
  -> `UK .NTF'
  -> `LVBAG'
  -> `OGR_SDTS'
  -> `S57'
  -> `DGN'
  -> `OGR_VRT'
  -> `REC'
  -> `Memory'
  -> `CSV'
  -> `NAS'
  -> `GML'
  -> `GPX'
  -> `LIBKML'
  -> `KML'
  -> `GeoJSON'
  -> `GeoJSONSeq'
  -> `ESRIJSON'
  -> `TopoJSON'
  -> `Interlis 1'
  -> `Interlis 2'
  -> `OGR_GMT'
  -> `GPKG'
  -> `SQLite'
  -> `OGR_DODS'
  -> `WAsP'
  -> `PostgreSQL'
  -> `OpenFileGDB'
  -> `DXF'
  -> `CAD'
  -> `FlatGeobuf'
  -> `Geoconcept'
  -> `GeoRSS'
  -> `GPSTrackMaker'
  -> `VFK'
  -> `PGDUMP'
  -> `OSM'
  -> `GPSBabel'
  -> `OGR_PDS'
  -> `WFS'
  -> `OAPIF'
  -> `EDIGEO'
  -> `SVG'
  -> `CouchDB'
  -> `Cloudant'
  -> `Idrisi'
  -> `ARCGEN'
  -> `XLS'
  -> `ODS'
  -> `XLSX'
  -> `Elasticsearch'
  -> `Carto'
  -> `AmigoCloud'
  -> `SXF'
  -> `Selafin'
  -> `JML'
  -> `PLSCENES'
  -> `CSW'
  -> `VDV'
  -> `GMLAS'
  -> `MVT'
  -> `NGW'
  -> `MapML'
  -> `TIGER'
  -> `AVCBin'
  -> `AVCE00'
  -> `HTTP'
gmtinfo [ERROR]: System call [ogr2ogr -mapFieldType Integer64=Integer -skipfailures -f "OGR_GMT" "/tmp/gmt_ogr_99593.gmt" "/home/seisman/.gmt/cache/RidgeTest.shp"] FAILED with error 256.
gmtinfo [ERROR]: Unable to open file /home/seisman/.gmt/cache/RidgeTest.shp for Input
ERROR: Caught signal number 11 (Segmentation fault) at
/lib64/libc.so.6(+0x195677)[0x7f54e4acb677]
[0xffffffe0]
Stack backtrace:
/home/seisman/opt/GMT-master/lib64/libgmt.so.6(sig_handler_unix+0xbe)[0x7f54e919455e]
/lib64/libc.so.6(+0x42750)[0x7f54e4978750]
/lib64/libc.so.6(+0x195677)[0x7f54e4acb677]
/lib64/libc.so.6(+0x701e2)[0x7f54e49a61e2]
/lib64/libc.so.6(+0x70a8d)[0x7f54e49a6a8d]
/lib64/libc.so.6(+0x82cda)[0x7f54e49b8cda]
/home/seisman/opt/GMT-master/lib64/libgmt.so.6(GMT_Report+0x17a)[0x7f54e909a0ba]
/home/seisman/opt/GMT-master/lib64/libgmt.so.6(+0x15fbc8)[0x7f54e91abbc8]
/home/seisman/opt/GMT-master/lib64/libgmt.so.6(+0x15fdc3)[0x7f54e91abdc3]
/home/seisman/opt/GMT-master/lib64/libgmt.so.6(gmt_init_module+0x34b5)[0x7f54e91ce225]
/home/seisman/opt/GMT-master/lib64/libgmt.so.6(GMT_psxy+0x16a)[0x7f54e93f837a]
/home/seisman/opt/GMT-master/lib64/libgmt.so.6(GMT_Call_Module+0x386)[0x7f54e90a24a6]
gmt(main+0x492)[0x401682]
/lib64/libc.so.6(+0x2d560)[0x7f54e4963560]
/lib64/libc.so.6(__libc_start_main+0x7c)[0x7f54e496360c]
gmt(_start+0x25)[0x402365]

System information

  • Operating system: Linux
  • GMT version (gmt --version): 6.4.0_abdbe3f_2022.02.17

seisman avatar Mar 01 '22 01:03 seisman