[gdal-dev] PGeo driver errors

Ryk DeYoe rdeyoe at clarksville.com
Fri Jan 18 12:18:35 EST 2008


Ryk DeYoe wrote:
> I'm using the PGeo driver to try to read some ESRI geodatabases to feed
> Mapserver.  I'm running Ubuntu Edgy.  The standard Ubuntu gdal didn't have
> PGeo compiled in so I've compiled gdal 1.3.1 (to match the Ubuntu libs)
with
> PGeo.  I've created the necessary ODBC connections to the mdb files.  I
also
> have the standard mdb-tools package installed.  I'm getting a "stack
> smashing detected" error when trying to read the layers from the mdb file.
> I think I've narrowed it down to reading the SRTEXT field from the
> GDB_SpatialRefs table.  If i put dummy values in the field, it will read
the
> tables and give me layers but of course, the SRS is completely wrong.
I've
> compiled gdal with stack protection turned off and then it just
segfaults...

...

> I have an sql.log file tracing the odbc calls.  Looks ok until it starts
> selecting the srtext values.  I'm not sure but the buffer length seems to
be
> set to 511 where my srtext string is 542 in length.  Could this be the
> problem?  And where can I increase this value?....in the ODBC source?...or
> in gdal? (I've downloaded the odbc source just in case i have to rebuild)
...
> Everything else with gdal seems to run great.  Shape files aren't a
problem
> but our GIS department doesn't update the shape files anymore....they work
> in the geodatabases exclusively now.  Our geotiff aerial photos look very
> nice and the gdaltindex stitched them together pretty simply.  I've been
> trying to find the place to set the buffer size but not being a programmer
> has me at a disadvantage.

Ryk,

This sounds like an old but with the CPL ODBC code.  I suspect you need this
patch:

   http://trac.osgeo.org/gdal/changeset/12531

Presumably there is more info available in the associated bug ticket:

   http://trac.osgeo.org/gdal/ticket/1902

Best regards,
--
---------------------------------------+------------------------------------
--
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



>  Thanks Frank, but there's no happiness there.  I'm still getting the same
>  error.  Just for fun, I grabbed the 1.5.0 source and saw that patch in
>  cpl_odbc.cpp also.  Compiled the 1.5.0 source and ran ogrinfo from the
>  gdal/apps directory and it's doing the same thing.  The sql.log file
stops
>  at the same place, selecting srtext on the first record (there are 12
>  layers):


Just a little more progress.  I found the location for increasing the buffer
( szWrkData[1024] in cpl_odbc.cpp ).  Now it seems to read in the whole
string without smashing the stack....then something weird happens somewhere
else. Strings in the SRTEXT file up to 32 chars are ok, but go to 33 chars
and the string gets truncated to 12 chars.  Of course, 12 chars is not
enough to define the SRS (from a 542 char SRTEXT) so the importFromWKT
function fails.

Can anyone point me to where this truncation is occurring?



More information about the gdal-dev mailing list