Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QGIS crashes on Windows when loading and invalid KML file #27811

Closed
qgib opened this issue Oct 1, 2018 · 4 comments
Closed

QGIS crashes on Windows when loading and invalid KML file #27811

qgib opened this issue Oct 1, 2018 · 4 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Data Provider Related to specific vector, raster or mesh data providers High Priority

Comments

@qgib
Copy link
Contributor

qgib commented Oct 1, 2018

Author Name: Harry Clarke (@HarryEClarke)
Original Redmine Issue: 19989
Affected QGIS version: 3.3(master)
Redmine category:data_provider/ogr
Assignee: Even Rouault


User Feedback

Trying to load KML layer for
National Forest Inventory Woodland England

File downloaded from Forestry Commission website at
http://data-forestry.opendata.arcgis.com/datasets/national-forest-inventory-woodland-england?selectedAttribute=Shape_Leng

Report Details

Crash ID: e8c58a2f94d7f3fd2948b38a077a1a0795912c0c

Stack Trace

GDALReadWorldFile2 :
GDALAsyncReader::GetXSize :
GDALAsyncReader::GetXSize :
OGRCurveCollection::hasCurveGeometry :
OGRCurveCollection::hasCurveGeometry :
IGMLReader::~IGMLReader :
IGMLReader::~IGMLReader :
IGMLReader::~IGMLReader :
RegisterOGRLIBKML :
GDALOpenEx :
CPLStringList::FindString :
OGREnvelope::Merge :
std::basic_string<char,std::char_traits<char>,std::allocator<char> >::find_last_of :
std::basic_string<char,std::char_traits<char>,std::allocator<char> >::max_size :
OGREnvelope::OGREnvelope :
QgsProviderRegistry::createProvider :
QgsVectorLayer::setDataProvider :
QgsVectorLayer::setDataSource :
QgsVectorLayer::QgsVectorLayer :
QgisApp::addVectorLayer :
QgisApp::handleDropUriList :
CPLStringList::List :
QgisApp::identify :
QMetaObject::activate :
QTimer::timerEvent :
QObject::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QEventDispatcherWin32Private::sendTimerEvent :
QEventDispatcherWin32::processEvents :
DispatchMessageW :
NotifyWinEvent :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info
QGIS Version: 3.2.3-Bonn
QGIS code revision: 9b17680
Compiled against Qt: 5.9.2
Running against Qt: 5.9.2
Compiled against GDAL: 2.2.4
Running against GDAL: 2.2.4

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

@qgib
Copy link
Contributor Author

qgib commented Oct 2, 2018

Author Name: Giovanni Manghi (@gioman)


No crash here on master/linux. The KML (a whopping 2.1GB one) does not load. The QGIS logs says it is an invalid KML, in fact from the CLI ogr is clear about that:

giovanni@sibirica:~/Downloads$ ogrinfo -so National_Forest_Inventory_Woodland_England.kml
ERROR 4: ERROR parsing kml National_Forest_Inventory_Woodland_England.kml :invalid argument on line 1 at offset 0
ERROR 4: ERROR parsing kml National_Forest_Inventory_Woodland_England.kml :invalid argument on line 1 at offset 0
FAILURE:
Unable to open datasource `National_Forest_Inventory_Woodland_England.kml' with the following drivers.


  • status_id was changed from Open to Feedback
  • priority_id was changed from Normal to High
  • category_id was changed from Unknown to Data Provider/OGR

@qgib
Copy link
Contributor Author

qgib commented Oct 2, 2018

Author Name: Harry Clarke (@HarryEClarke)


Seems like there is a difference in behaviour between Linux and Windows versions of QGIS, in that some error condition is not being trapped, which is resulting in QGIS crashing, rather than reporting an error with the input file.

@qgib
Copy link
Contributor Author

qgib commented Oct 3, 2018

Author Name: Giovanni Manghi (@gioman)


Confirmed on master/windows 10.


  • status_id was changed from Feedback to Open
  • operating_system was changed from Windows 8.1 to Windows
  • version was changed from 3.2.3 to 3.3(master)
  • subject was changed from QGIS crash loading KML file to QGIS crashes on Windows when loading and invalid KML file

@qgib
Copy link
Contributor Author

qgib commented Oct 6, 2018

Author Name: Even Rouault (@rouault)


Didn't test on Windows, but could reproduce crashes on Linux with ogrinfo by limiting the process memory with ulimit -v

Fixes:
GDAL master: OSGeo/gdal@bcd6e4e
GDAL 2.3 branch: OSGeo/gdal@06b46ed

Note: the KML is likely valid but both KML and LIBKML drivers need to ingest it completely in memory, so they choke on such huge files.


  • resolution was changed from to up/downstream
  • status_id was changed from Open to Closed
  • assigned_to_id was configured as Even Rouault

@qgib qgib closed this as completed Oct 6, 2018
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Data Provider Related to specific vector, raster or mesh data providers Crash/Data Corruption labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Data Provider Related to specific vector, raster or mesh data providers High Priority
Projects
None yet
Development

No branches or pull requests

1 participant