[Fdo-trac] [fdo-trac] #927: SQL Server FDO provider crashes when querying a table with an 'image' column

FDO trac_fdo at osgeo.org
Sat Nov 25 06:49:39 PST 2017


#927: SQL Server FDO provider crashes when querying a table with an 'image'
column
-------------------------------+-------------------------
 Reporter:  jng                |        Owner:  danstoica
     Type:  defect             |       Status:  new
 Priority:  major              |    Milestone:  4.1.0
Component:  SQLServer Spatial  |      Version:
 Severity:  3                  |   Resolution:
 Keywords:                     |  External ID:
-------------------------------+-------------------------

Comment (by jng):

 The SQL Server image column resolves to type `RDBI_BLOB`, which causes
 causes `GdbiQueryResult` to crash in the destructor due to inconsistent
 ordering of new/delete operations, which happened to slip under the radar
 with other RDBI column types, but the inconsistency was exposed with
 `RDBI_BLOB` where the destructor will try to `delete[]` `colInfo->value`
 under the current logic

 Attached is a patch that will ensure consistent new/delete.

 However this still does not make queries that involve SQL Server image
 columns work as the size reported by SQL Server for `RDBI_BLOB` is `2^31`,
 which will generally fail allocation with `std::bad_alloc` under the
 current allocation code paths in `define_exec`

 So this patch will also skip over `RDBI_BLOB` in `define_exec` and
 `~GdbiQueryResult` and no-ops `GdbiQueryResult::GetBinaryValue` if the
 column type is `RDBI_BLOB`. Not desirable, but still a net gain over what
 currently happens.

--
Ticket URL: <https://trac.osgeo.org/fdo/ticket/927#comment:1>
FDO <http://fdo.osgeo.org/>
Feature Data Objects


More information about the fdo-trac mailing list