[gdal-dev] stack smashing when using ogrinfo with DB2 driver

Nikolai Bezdna mofoyoda at gmail.com
Thu Nov 2 13:43:51 PDT 2017


I get a strange behaviour when using ogrinfo (or ogr2ogr) with DB2 driver.

ogrinfo "DB2ODBC:database=mydb;DSN=MYDB;Tables=MYSCHEMA.MYTABLEā€¯ MYSCHEMA.MYTABLE

Reports:

INFO: Open of `DB2ODBC:database=mydb;DSN=MYDB;Tables=MYSCHEMA.MYTABLE'
     using driver `DB2ODBC' successful.
*** stack smashing detected ***: ogrinfo terminated
======= Backtrace: =========
/lib64/libc.so.6(+0x6fb0c)[0x7fc821d9ab0c]
/lib64/libc.so.6(__fortify_fail+0x37)[0x7fc821e22a77]
/lib64/libc.so.6(__fortify_fail+0x0)[0x7fc821e22a40]
/usr/lib64/libgdal.so(+0xa874d9)[0x7fc822d504d9]
/usr/lib64/libgdal.so(_ZN16OGRDB2DataSource20CreateMetadataTablesEv+0x4f)[0x7fc822d5b91f]
/usr/lib64/libgdal.so(_ZN16OGRDB2DataSource17HasMetadataTablesEv+0xcd)[0x7fc822d5bc3d]
/usr/lib64/libgdal.so(_ZN16OGRDB2DataSource11GetMetadataEPKc+0xa3)[0x7fc822d5c783]
ogrinfo[0x4031e1]
ogrinfo[0x403309]
ogrinfo[0x401e1a]
/lib64/libc.so.6(__libc_start_main+0xf0)[0x7fc821d4b640]
ogrinfo[0x403039]

However I can get info on my table when wrapping into VRT and using ogrinfo on it.
I thought the same mechanism is used for querying wrapped sources.


Another question is - why does VRT driver switch a layer to read only mode when using FID tag to specify primary key column?


More information about the gdal-dev mailing list