Bug#856472: gdal-bin: SrcDataSource ODBC Segmentation fault
Hi Bas, On Thursday, 2 March 2017 16:25:16 GMT Bas Couwenberg wrote: > On 2017-03-02 12:38, Andy G Wood wrote: > >> Can you also provide a minimal test case to reproduce the issue on a > >> system which doesn't have your ODBC data source configured? > > > > The system which exhibits the problem is using an Oracle 11g ODBC > > driver > > (testing this outside of gdal shows no problems). The following builds > > a test > > case with sqlite, but unfortunately this works fine! > > The sqlite test case also works fine for me, and based on your > stacktrace it looks like an issue in the Oracle libsqora library, not > GDAL. Yes, I would agree ... and too many packages have flowed into Testing to attempt to work out why. Please feel free to close this bug. > Maybe you can update the Oracle library? Added to my TODO list ;-) Andy.
Bug#856472: gdal-bin: SrcDataSource ODBC Segmentation fault
On 2017-03-02 12:38, Andy G Wood wrote: Can you also provide a minimal test case to reproduce the issue on a system which doesn't have your ODBC data source configured? The system which exhibits the problem is using an Oracle 11g ODBC driver (testing this outside of gdal shows no problems). The following builds a test case with sqlite, but unfortunately this works fine! The sqlite test case also works fine for me, and based on your stacktrace it looks like an issue in the Oracle libsqora library, not GDAL. Maybe you can update the Oracle library? Kind Regards, Bas
Bug#856472: gdal-bin: SrcDataSource ODBC Segmentation fault
Hi Bas, > >> Can you install the gdal-bin-dbgsym & libgdal20-dbgsym packages an run > >> the ogrinfo command via gdb to get a backtrace? > > > > There does not appear to be an amd64 architecture version of these > > packages, so I am a bit stuck with this? > > The automatic debug packages are available in separate repositories > which you need to add to your /etc/apt/sources.list, see: > https://wiki.debian.org/DebugPackage > > For stretch the sources.list entry would be: > deb http://debug.mirrors.debian.org/debian-debug/ stretch-debug main > contrib non-free Thanks for the pointers ... this is new to me, but always willing to learn. Here we go with the gdb output (with confidential parts removed), which may be pointing to problems with the Oracle client software. C'est la vie. Cheers. Andy. $ gdb ogrinfo GNU gdb (Debian 7.12-6) 7.12.0.20161007-git This GDB was configured as "x86_64-linux-gnu". (gdb) set pagination 0 (gdb) run -ro -al test.xml Starting program: /usr/bin/ogrinfo -ro -al test.xml [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". INFO: Open of `test.xml' using driver `OGR_VRT' successful. Program received signal SIGSEGV, Segmentation fault. 0x7fffdfe5ae81 in bcoSQLSetStmtOption () from .../instantclient/ libsqora.so.11.1 (gdb) bt #0 0x7fffdfe5ae81 in bcoSQLSetStmtOption () from .../instantclient/libsqora.so.11.1 #1 0x7fffdfe73f6f in bccSQLSetStmtOption () from .../instantclient/libsqora.so.11.1 #2 0x7fffdfe71fc3 in SQLSetConnectAttrW () from .../instantclient/libsqora.so.11.1 #3 0x74673b05 in ?? () from /usr/lib/x86_64-linux-gnu/libodbc.so.2 #4 0x74675dc7 in SQLConnect () from /usr/lib/x86_64-linux-gnu/libodbc.so.2 #5 0x777d988c in CPLODBCSession::EstablishSession (this=this@entry=0x6c98a8, pszDSN=pszDSN@entry=0x6d2a20 "OracleODBC-11g", pszUserid=pszUserid@entry=0x6d0cb0 "UID", pszPassword=pszPassword@entry=0x6d2a40 "PWD") at cpl_odbc.cpp:407 #6 0x77694fb6 in OGRODBCDataSource::Open (this=this@entry=0x6c9790, pszNewName=pszNewName@entry=0x6d2b10 "ODBC:UID/PWD@OracleODBC-11g,", bUpdate=bUpdate@entry=0, bTestOpen=bTestOpen@entry=1) at ogrodbcdatasource.cpp:386 #7 0x77695bca in OGRODBCDriver::Open (this=, pszFilename=0x6d2b10 "ODBC:UID/PWD@OracleODBC-11g,", bUpdate=0) at ogrodbcdriver.cpp:73 #8 0x77706749 in OGRSFDriverRegistrar::OpenWithDriverArg (poDriver=, poOpenInfo=) at ogrsfdriverregistrar.cpp:219 #9 0x774346fb in GDALOpenEx (pszFilename=pszFilename@entry=0x6babe0 "ODBC:UID/PWD@OracleODBC-11g,", nOpenFlags=36, papszAllowedDrivers=papszAllowedDrivers@entry=0x0, papszOpenOptions=papszOpenOptions@entry=0x0, papszSiblingFiles=papszSiblingFiles@entry=0x0) at gdaldataset.cpp:2778 #10 0x77760d82 in OGRVRTLayer::FullInitialize (this=this@entry=0x6902e0) at ogrvrtlayer.cpp:625 #11 0x77762703 in OGRVRTLayer::GetLayerDefn (this=0x6902e0) at ogrvrtlayer.cpp:2226 #12 0x00402d04 in ReportOnLayer (poLayer=poLayer@entry=0x6902e0, pszWHERE=pszWHERE@entry=0x0, pszGeomField=pszGeomField@entry=0x0, poSpatialFilter=poSpatialFilter@entry=0x0, bListMDD=bListMDD@entry=0, bShowMetadata=bShowMetadata@entry=1, papszExtraMDDomains=0x0, bFeatureCount=1, bExtent=1) at ogrinfo.cpp:536 #13 0x0040208f in main (nArgc=, papszArgv=) at ogrinfo.cpp:442 (gdb) quit
Bug#856472: gdal-bin: SrcDataSource ODBC Segmentation fault
Hi Bas, > Can you install the gdal-bin-dbgsym & libgdal20-dbgsym packages an run > the ogrinfo command via gdb to get a backtrace? There does not appear to be an amd64 architecture version of these packages, so I am a bit stuck with this? > Can you also provide a minimal test case to reproduce the issue on a > system which doesn't have your ODBC data source configured? The system which exhibits the problem is using an Oracle 11g ODBC driver (testing this outside of gdal shows no problems). The following builds a test case with sqlite, but unfortunately this works fine! 1. install package libsqliteodbc 2. create test sqlite database: sqlite3 -batch database.sqlite < create_db.sql The contents of create_db.sql are: CREATE TABLE table1(lat,lon); INSERT INTO table1(lat,lon) VALUES(-54.00827,-38.06391),(-54.01001,-38.06845); 3. add this to ~/.odbc.ini : [mysqlitedb] Description=My SQLite test database Driver=SQLite3 Database=//database.sqlite 4. check with ogrinfo: ogrinfo -ro -al gdaltest.xml The contents of gdaltest.xml are: ODBC:mysqlitedb select lon, lat from table1 wkbPoint WGS84 The final bit of information I have for now is that the last time this worked fine from packages in Testing is Mar 2 2016. I have not run my system between then and yesterday (Mar 1 2017). Andy.
Bug#856472: gdal-bin: SrcDataSource ODBC Segmentation fault
Hi Andy, On 2017-03-02 12:38, Andy G Wood wrote: Can you install the gdal-bin-dbgsym & libgdal20-dbgsym packages an run the ogrinfo command via gdb to get a backtrace? There does not appear to be an amd64 architecture version of these packages, so I am a bit stuck with this? The automatic debug packages are available in separate repositories which you need to add to your /etc/apt/sources.list, see: https://wiki.debian.org/DebugPackage For stretch the sources.list entry would be: deb http://debug.mirrors.debian.org/debian-debug/ stretch-debug main contrib non-free Can you also provide a minimal test case to reproduce the issue on a system which doesn't have your ODBC data source configured? The system which exhibits the problem is using an Oracle 11g ODBC driver (testing this outside of gdal shows no problems). The following builds a test case with sqlite, but unfortunately this works fine! Thanks for the repro, I'll give it a go after I get back from $DAYJOB later today. Kind Regards, Bas
Bug#856472: gdal-bin: SrcDataSource ODBC Segmentation fault
Control: tags -1 unreproducible moreinfo Hi Andy, On 03/01/2017 01:17 PM, Andy Wood wrote: > ogrinfo -ro -al test.xml > INFO: Open of `test.xml' > using driver `OGR_VRT' successful. > Segmentation fault I cannot reproduce the issue, I just get an error because I don't have the ODBC data source configured. Can you install the gdal-bin-dbgsym & libgdal20-dbgsym packages an run the ogrinfo command via gdb to get a backtrace? Can you also provide a minimal test case to reproduce the issue on a system which doesn't have your ODBC data source configured? Kind Regards, Bas -- GPG Key ID: 4096R/6750F10AE88D4AF1 Fingerprint: 8182 DE41 7056 408D 6146 50D1 6750 F10A E88D 4AF1
Bug#856472: gdal-bin: SrcDataSource ODBC Segmentation fault
Package: gdal-bin Version: 2.1.2+dfsg-3 Severity: important Dear Maintainer, ogrinfo -ro -al test.xml INFO: Open of `test.xml' using driver `OGR_VRT' successful. Segmentation fault The contents of test.xml are: ODBC:UID/PWD@DSN, select s.ring, to_char((lat_deg+(lat_min/60.0))*decode(n_s,'N',1.0,'S',-1.0,0.0),'999.999') lat, to_char((lon_deg+(lon_min/60.0))*decode(e_w,'E',1.0,'W',-1.0,0.0),'999.999') lon from ringing_dictionary r1, sites si, catch_details d, catch_details cd, schedule s where d.site_code = si.site_code and s.ring_size = d.ring_size and s.ring = d.ring and d.obs_date > s.ring_date and s.ring_size = cd.ring_size and s.ring = cd.ring and cd.obs_date = s.ring_date and nvl(d.activity,'XXX') = r1.code and r1.segment in ('ACT','NULL') and s.ring = '1435252' wkbPoint WGS84 The above SrcSQL works fine when tested using isql and the same DSN UID and PWD. This used to work in the recent past in Testing, but I have not run it for a few months. The same fault appears in other cases with different SQL, in other words I cannot now get an ODBC data source to work with ogrinfo/ogr2ogr. Andy. -- System Information: Debian Release: 9.0 APT prefers testing APT policy: (900, 'testing'), (300, 'unstable') Architecture: amd64 (x86_64) Kernel: Linux 4.9.0-1-amd64 (SMP w/4 CPU cores) Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages gdal-bin depends on: ii libc6 2.24-9 ii libgcc1 1:6.3.0-6 ii libgdal20 [gdal-abi-2-1-2] 2.1.2+dfsg-3 ii libstdc++6 6.3.0-6 gdal-bin recommends no packages. Versions of packages gdal-bin suggests: pn libgdal-grass ii python-gdal2.1.2+dfsg-3 -- no debconf information