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.59k stars 3k forks source link

QGIS crash with SQL Server layer #26446

Closed qgib closed 6 years ago

qgib commented 6 years ago

Author Name: Francisco Jose Campos Menendez (Francisco Jose Campos Menendez) Original Redmine Issue: 18558 Affected QGIS version: 3.2.1 Redmine category:data_provider/mssql


After accessing the layers from ODBC of SQL Server, when performing any zoom or selection of a layer element, it still closes.

User Feedback

Report Details

Crash ID: b34cac9fbb8037774af8927b08571505e2c24e0c

Stack Trace

RtlEnterCriticalSection :
SQLDisconnect :
SQLFetch :
QSqlDatabase::open :
isProvider :
isProvider :
QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator :
QgsVectorLayerFeatureSource::getFeatures :
QgsVectorLayerLabelProvider::registerFeature :
QgsMapRendererCustomPainterJob::doRender :
QgsMapRendererCustomPainterJob::staticRender :
QgsRenderContext::segmentationToleranceType :
QThreadPoolPrivate::reset :
QThread::start :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info QGIS Version: 3.0.1-Girona QGIS code revision: a86bec25eb 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: 10.0.16299


qgib commented 6 years ago

Author Name: Francisco Jose Campos Menendez (Francisco Jose Campos Menendez)


In Windows 10 x86 work fine...

qgib commented 6 years ago

Author Name: Francisco Jose Campos Menendez (Francisco Jose Campos Menendez)


The problem is with the ODBC SQL Server 17 driver, with the ODBC version of SQL Server 13 works fine in Windows 10 x64.


qgib commented 6 years ago

Author Name: Antony Zonato (Antony Zonato)


Why is that marked as Closed? It should works with SQL Server 17 driver. I cannot use QGIS 3.0 or 3.1 as it is.

qgib commented 6 years ago

Author Name: Francisco Jose Campos Menendez (Francisco Jose Campos Menendez)


Okay, you're right, I'll open it again. Thank you


qgib commented 6 years ago

Author Name: Antony Zonato (Antony Zonato)


Thanks Francisco!

qgib commented 6 years ago

Author Name: Antony Zonato (Antony Zonato)


Just to add some information. On my machine, it affects both 3.0 and 3.1. Regression should be set to yes, as it works fine with 2.18.16 and prior versions.

qgib commented 6 years ago

Author Name: Antony Zonato (Antony Zonato)


Tested with 3.0.2, and it still crashes. Francisco, can you change the issue to "Regression = yes"? It worked with 2.18.

qgib commented 6 years ago

Author Name: Francisco Jose Campos Menendez (Francisco Jose Campos Menendez)


I'm sorry Antony Zonato but I don't know how to make that modification, how to change the issue?

qgib commented 6 years ago

Author Name: Antony Zonato (Antony Zonato)


Hi Francisco. I wrote to Richard so that the regression status could be changed.

qgib commented 6 years ago

Author Name: Richard Duivenvoorde (@rduivenvoorde)


You should be able to do that yourself, I always forget though how to open all this properties again. But I'm almost sure that you can just do that yourself, just like you can change the title then. Anyway: changed to regression


qgib commented 6 years ago

Author Name: Antony Zonato (Antony Zonato)


Richard Duivenvoorde wrote:

You should be able to do that yourself, I always forget though how to open all this properties again. But I'm almost sure that you can just do that yourself, just like you can change the title then. Anyway: changed to regression

Only the creator of the issue or anyone? If I click on "Copy" it opens a new issue form where we can change all the fields. Normally, I guess that the "Edit" button would do the same thing, but with the current issue. Unfortunately, that is not the case, it just opens a text box so that we can comment. Is this a bug with redmine?

Antony

qgib commented 6 years ago

Author Name: Antony Zonato (Antony Zonato)


Does exactly the same thing with 3.2.

Crash ID: b0ee67212954603a0166eb376a13b280632183af

Stack Trace

QSqlDatabase::open : sourceSelectProviders : sourceSelectProviders : QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator : QgsVectorLayerFeatureSource::getFeatures : QgsVectorLayerLabelProvider::registerFeature : QgsMapRendererParallelJob::renderLayerStatic : QgsArchive::zip : QgsImageOperation::overlayColor : QgsImageOperation::flipImage : QtConcurrent::ThreadEngineBase::run : QThreadPoolPrivate::reset : QThread::start : BaseThreadInitThunk : RtlUserThreadStart :

QGIS Info QGIS Version: 3.2.0-Bonn QGIS code revision: bc43194061 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: 10.0.17134

I checked it with DebugView: here's what it is telling me after zooming / dezooming:

[4964] Warning: QSqlDatabasePrivate::removeDatabase: connection 'eeq-sql01.SIG.116' is still in use, all queries will cease to work. [4964] Warning: "QODBCDriver::cleanup: Unable to free connection handle" Error: "" [4964] Warning: "QODBCDriver::cleanup: Unable to free environment handle" Error: "[Microsoft][Gestionnaire de pilotes ODBC] Erreur de séquence de la fonction" [4964] Warning: "QODBCResult::reset: Unable to allocate statement handle" Error: "[Microsoft][Gestionnaire de pilotes ODBC] Erreur de séquence de la fonction" [4964] Warning: QSqlDatabasePrivate::addDatabase: duplicate connection name 'eeq-sql01.SIG.116', old connection removed. [4964] Warning: QSqlQuery::exec: database not open [4964] Warning: QSqlDatabasePrivate::removeDatabase: connection 'eeq-sql01.SIG.224' is still in use, all queries will cease to work. [4964] Warning: "QODBCDriver::cleanup: Unable to free connection handle" Error: "" [4964] Warning: "QODBCDriver::cleanup: Unable to free environment handle" Error: "[Microsoft][Gestionnaire de pilotes ODBC] Erreur de séquence de la fonction" [4964] Warning: QSqlDatabasePrivate::addDatabase: duplicate connection name 'eeq-sql01.SIG.224', old connection removed.

I also installed 2 different dev version, 3.1 and 3.3 MASTER. Both versions does NOT cause this bug. The canvas is redrawned successfully each time.

qgib commented 6 years ago

Author Name: Antony Zonato (Antony Zonato)


Same thing with 3.2.1.

qgib commented 6 years ago

Author Name: Giovanni Manghi (@gioman)


Antony Zonato wrote:

Same thing with 3.2.1.

is this about accessing to the server with ODBC or the native provider?


qgib commented 6 years ago

Author Name: Antony Zonato (Antony Zonato)


Can you tell me how to check for that? I'm using the default MSSQL connection prompt (see attachement)



qgib commented 6 years ago

Author Name: Giovanni Manghi (@gioman)


Antony Zonato wrote:

Can you tell me how to check for that? I'm using the default MSSQL connection prompt (see attachement)

that is the native provider. The description of this ticket says "After accessing the layers from ODBC of SQL Server", but then the ticket was tagged as "mssql data provider".

qgib commented 6 years ago

Author Name: Antony Zonato (Antony Zonato)


Then you are right, the problem is with the native provider. Also, I cannot wrap my mind about why it works with the 3.3 version and not with the official releases (3.1, 3.2.0, 3.2.1).

qgib commented 6 years ago

Author Name: Giovanni Manghi (@gioman)


Antony Zonato wrote:

Also, I cannot wrap my mind about why it works with the 3.3 version and not with the official releases (3.1, 3.2.0, 3.2.1).

There is nothing strange: 3.3 is the next 3.4 to be. Is this fixed in 3.3? if yes this ticket must be closed. And by the way, any release that ends with an odd number is an official release, called "master".

qgib commented 6 years ago

Author Name: Antony Zonato (Antony Zonato)


Of course, I understand that 3.3 is the next 3.4. But as stated in the last line of comment #12, I tested it with an earlier dev version and it worked. Then 3.2 came out and it stopped working. This is what I don't understand.

Antony

qgib commented 6 years ago

Author Name: Giovanni Manghi (@gioman)


Antony Zonato wrote:

Of course, I understand that 3.3 is the next 3.4. But as stated in the last line of comment #12, I tested it with an earlier dev version and it worked. Then 3.2 came out and it stopped working. This is what I don't understand.

I don't do MSSQL server so I cannot be of much help with tests.

qgib commented 6 years ago

Author Name: Giovanni Manghi (@gioman)


qgib commented 6 years ago

Author Name: Antony Zonato (Antony Zonato)


I installed 3.2.2 and it looks like it is resolved. Good job to whoever fixed that.

Antony

qgib commented 6 years ago

Author Name: Giovanni Manghi (@gioman)