qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.38k stars 2.98k forks source link

QGIS crashed after adding a ESRI file geodatabase layer #45760

Closed lucasmill13 closed 2 years ago

lucasmill13 commented 2 years ago

What is the bug or the crash?

After adding an ESRI file geodatabase layer QGIS crashed unexpectedly.

Steps to reproduce the issue

Crash report below:

User Feedback

After adding an ESRI file geodatabase layer QGIS crashed unexpectedly.

Report Details

Crash ID: ce44d7e1fc9ed87c7d390ddb5b3f1681beea000b

Stack Trace

FileGDBAPI::SpatialReferences::FindSpatialReferenceByName :
FileGDBAPI::SpatialReferences::FindSpatialReferenceByName :
FileGDBAPI::EnumRows::Next :
GDALRawResult::size :
OGRMutexedLayer::GetNextFeature :
QgsSQLiteExpressionCompiler::operator= :
QgsAbstractFeatureIterator::nextFeature :
QgsVectorLayerFeatureIterator::fetchFeature :
QgsAbstractFeatureIterator::nextFeature :
QgsVectorLayerJoinInfo::setEditable :
QgsVectorLayerJoinInfo::setEditable :
QgsVectorLayerJoinInfo::setEditable :
QgsMapRendererParallelJob::renderLayerStatic :
QgsMapRendererParallelJob::renderingFinished :
QgsMapRendererParallelJob::renderingFinished :
QgsMapRendererParallelJob::takeLabelingResults :
QtConcurrent::ThreadEngineBase::run :
QThreadPoolPrivate::reset :
QThread::start :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info QGIS Version: 3.22.0-Bia?owie?a QGIS code revision: d9022691f1 Compiled against Qt: 5.15.2 Running against Qt: 5.15.2 Compiled against GDAL: 3.3.2 Running against GDAL: 3.3.2

System Info CPU Type: x86_64 Kernel Type: winnt Kernel Version: 10.0.19043

Versions

QGIS version 3.22.0-Białowieża QGIS code revision d9022691f1 Qt version 5.15.2 Python version 3.9.5 GDAL/OGR version 3.3.2 PROJ version 8.1.1 EPSG Registry database version v10.028 (2021-07-07) GEOS version 3.10.0-CAPI-1.16.0 SQLite version 3.35.2 PDAL version 2.3.0 PostgreSQL client version 13.0 SpatiaLite version 5.0.1 QWT version 6.1.3 QScintilla2 version 2.11.5 OS version Windows 10 Version 2009

Active Python plugins db_manager 0.1.20 grassprovider 2.12.99 MetaSearch 0.3.5 processing 2.12.99 sagaprovider 2.12.99

Supported QGIS version

New profile

Additional context

No response

gioman commented 2 years ago

Browse to the appropriate ESRI filegdb layer and add

@lucasmill13 does it crash with any filegdb or just with a specific one?

gioman commented 2 years ago

@lucasmill13 can't confirm here with some random filegdb downloaded from the internet. Tested both the open and the closed driver.

lucasmill13 commented 2 years ago

@gioman it may be the filegdb I am trying to add layers from. I couldn't see the layers in the filegdb until I added the GDAL filegdb driver. After installing the GDAL filegdb driver I could add the layers, but they crashed straight away. I am brand new to QGIS and not sure what to do?

gioman commented 2 years ago

I am brand new to QGIS and not sure what to do?

@lucasmill13 attach/link here the offending filegdb.

lucasmill13 commented 2 years ago

@gioman attached is one of the offending fildgdbs. This is a small filegdb with only a couple of layers. There are other larger fildgdbs with many more layers that create the same error. COASTS.gdb.zip

gioman commented 2 years ago

Yes, crash confirmed on both 3.16.12 and 3.22.0 with both the open and closed drivers.

esnyder-rve commented 2 years ago

Something is funky with that geodatabase. Neither layer has a spatial index, and neither will accept one (tried to create/remove spatial indexes in ArcPro and ArcMap with no success).

esnyder-rve commented 2 years ago

I can also confirm the crash with the provided file geodatabase. I did some testing. When I moved the features over to a new file geodatabase in ArcPro, the resulting geodatabase contained layers with spatial indexes which can be brought into QGIS without crash. However, they do not appear in the map canvas. When I export those into geopackage layers in QGIS, everything comes out fine. I suspect this is an upstream (ESRI) issue since it was their FileGDB API that crashed.

nyalldawson commented 2 years ago

This is a compressed Geodatabase -- those aren't supported by GDAL

esnyder-rve commented 2 years ago

It appears that ESRI added Compressed FGDB in their API version 1.4 (1.5.2 is available). 1.4 Change Log.

@gioman Should this be marked as a GDAL upstream issue?

gioman commented 2 years ago

@gioman Should this be marked as a GDAL upstream issue?

@esnyder-rve just did it, but I think that this ticket should stay open because QGIS should not crash anyway.

lucasmill13 commented 2 years ago

Thanks @gioman and @esnyder-rve for your help. I imagined there might be an issue with the dataset. I will work with the data provider to see if the data layers I am trying to access can be provided in a different way.

nyalldawson commented 2 years ago

@gioman

Yes, crash confirmed on both 3.16.12 and 3.22.0 with both the open and closed drivers.

How do you reproduce this crash? I've tested 3.16.12 on Windows and linux and can't get a crash.

gioman commented 2 years ago

How do you reproduce this crash? I've tested 3.16.12 on Windows and linux and can't get a crash.

@nyalldawson

add vector > directory > add > the pop up with the layers list shows > select all > add > freeze and a few seconds later crash

esnyder-rve commented 2 years ago

@nyalldawson I'm using OSGeo4W but don't know what SDK version the gdal-filegdb uses. It might be related to that since the GDAL docs state that an SDK version >1.4 is required to read CDF (but not Smart Data Compression). GDAL FGDB Driver - Known Issues

rkalasek commented 2 years ago

concerning compressed vs uncompresed issue: have created a new (file)gdb in arcgis pro, populated that gdb with various FCs of different overall-size => no problem to open. tried to open an existing QGIS project (v. 3.14 with corresponding libs) which references existing gdbs => no problem. finally I took those two gdbs which caused crashes (when using my just recently installed version 3.22 and 3.16 ltr) and did an uncompresion within arcis pro (datamanagement / file geodatabase / uncompress file geodatabase data) = still crashes. but my "crash experience" seems to be a bit different: i am using the browser panel. as soon as i double-klick the gdb-object in browser QGIS starts working (for quite a while) and then crashes some seconds later.

github-actions[bot] commented 2 years ago

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue. In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue. If there is no further activity on this issue, it will be closed in a week.

lucasmill13 commented 2 years ago

Thanks to everyone for your help with this issue. Sounds like there is a problem adding some layers from compressed geodatabases into QGIS. To overcome this I have used ArcGIS to export some layers in different ways and will work with the data provider to see if data updates for problem layers can be provided in different formats.

rkalasek commented 2 years ago

as mentioned in my post some days ago I did some tests with a file-gdb which was explicitly uncompressed by using ArcGIS' uncompress command. ... and had the same problems with qgis crashes as before. so I decided to do some further testing ... find attached two file-gdbs: one crashes qgis as soon as I double-click the gdb icon in browser, the other one doesn't. what makes the difference between both is a single FC. so far I was not able to identify a specific issue with that FC with ArcGIS Pro Tools. the only thing that worked was to export that FC to shp and reimport it into the f-gd tmp_gdb_crash_gdb.zip b.

gioman commented 2 years ago

one crashes qgis as soon as I double-click the gdb icon in browser

@rkalasek does not crash here.

rkalasek commented 2 years ago

did another test ... tmp_gdb_crash.gdb crashes 3.16.4 as well as 3.22 on two different windows machines. but doesn't crash 3.16.4 on mac os

gioman commented 2 years ago

@rkalasek do you have installed the driver based on ESRI SDK, or are you using the open diver that comes by default with QGIS?

rkalasek commented 2 years ago

i am using the qgis-default driver 3.4.03 (according to OSGeo4W installer info) on windows system. just finished a clean re-install on both win-machines: both with qgis default. again crashes with this specific file-gdb. on mac os: there is no option to choose from (but it works).

gioman commented 2 years ago

i am using the qgis-default driver 3.4.03

@rkalasek do you mean the "gdal-filegdb" package? if you have it installed try remove it, then try again (QGIS will use the open source driver).

rkalasek commented 2 years ago

thx for support - see attachted a screenshot of the one, I've installe

Bildschirmfoto 2021-12-07 um 13 45 30

d.

gioman commented 2 years ago

thx for support - see attachted a screenshot of the one, I've installe

@rkalasek exactly, uninstall that package. Then start QGIS and try open the fgdb again.

rkalasek commented 2 years ago

@gioman. ok - that works, as far as it concerns reading file-gdbs. but it seems that the one which is on duty now (by the way: wich one is it?) doesn't write esri fgdb files.

gioman commented 2 years ago

@gioman. ok - that works, as far as it concerns reading file-gdbs. but it seems that the one which is on duty now (by the way: wich one is it?) doesn't write esri fgdb files.

@rkalasek the open source driver is read only. And now we have established that the crash happens only when the closed source driver is installed.

rouault commented 2 years ago

This is a bug in the FileGDB SDK itself. I've finally managed to find a workaround in the OGR FileGDB driver: https://github.com/OSGeo/gdal/pull/5220