Bug report #18563
QGis3 crashes when saving to an existing BNA file
|Affected QGIS version:||3.0.0||Regression?:||No|
|Operating System:||Ubuntu 16.04||Easy fix?:||Yes|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||26451|
If I select a vector layer and from the right click menu, Save As a BNA file, the file is created as expected. However if I then edit the vector layer in QGis and save again to the same BNA file, QGis crashes. If I delete the BNA file outside of QGis before resaving all works fine. If I use a different name for the Save As all works fine.
When saving I turn off the option to load the saved layer back to QGis and just in case it has any bearing on the result, I change the output Coordinate Precision to 0 as the values are UTM co-ords and only good to 50m anyway.
QgsVectorFileWriter: workaround a bug in GDAL where appending to an existing BNA crashes it (fixes #18563)
Upstream fixes done in GDAL as well to fix the crash itself:
GDAL master: https://github.com/OSGeo/gdal/commit/a36939afd5248338d928ac2107e2136b32ffb9df
GDAL 2.3 branch: https://github.com/OSGeo/gdal/commit/f9af14bc04e6f4fea8175f0e212455c2b6520378