[gdal-dev] OGR_L_SetFeature() randomly crashes with EXC_BAD_ACCESS in sqlite3

Nik Sands nik at nixanz.com
Fri Mar 24 02:33:31 PDT 2017


Hello dev list,

I’m using GDAL 2.1.2 in an iOS app (statically linked).  When executing OGR_L_SetFeature() it usually works fine, but randomly crashes with EXC_BAD_ACCESS.

The crash is in sqlite3 and appears to be due to dereferencing a NULL pointer, as far as I can tell from the back trace.

In my app, the crash occurs when I call, "OGR_L_SetFeature(layer, feature)”, at which point both “layer” and “feature” are non-NULL, and the layer is in a GeoPackage data source.

The top of the back trace is:

MyApp`sqlite3_clear_bindings(pStmt=0x0000000000000000) + 24 at sqlite3.c:75797, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x000000010012684c MyApp`sqlite3_clear_bindings(pStmt=0x0000000000000000) + 24 at sqlite3.c:75797 [opt]
    frame #1: 0x00000001005c0770 MyApp`OGRGeoPackageTableLayer::ISetFeature(this=0x000000010134af10, poFeature=0x0000000174097750) + 440 at ogrgeopackagetablelayer.cpp:1441 [opt]
  * frame #2: 0x00000001000b0074 MyApp`-[VectorFeature syncToDisk](self=0x000000017422cd00, _cmd="syncToDisk") + 92 at VectorFeature.m:56

I don’t know enough about the SQLite or GeoPackage code to make any sensible progress on this.  Can somebody please point me in the right direction to figure out what I’m doing wrong?

Cheers,
Nik.


More information about the gdal-dev mailing list