Bug report #18558

QGIS crash with SQL Server layer

Added by Francisco Jose Campos Menendez over 6 years ago. Updated about 6 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Data Provider/MSSQL
Affected QGIS version:3.2.1 Regression?:Yes
Operating System:Windows 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:Yes Copied to github as #:26446

Description

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

2018-08-06 13-09-04.png (20.8 KB) Antony Zonato, 2018-08-06 07:33 PM

History

#1 Updated by Francisco Jose Campos Menendez over 6 years ago

In Windows 10 x86 work fine...

#2 Updated by Francisco Jose Campos Menendez over 6 years ago

  • Status changed from Open to Closed

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

#3 Updated by Antony Zonato over 6 years ago

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.

#4 Updated by Francisco Jose Campos Menendez over 6 years ago

  • Status changed from Closed to Reopened

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

#5 Updated by Antony Zonato over 6 years ago

Thanks Francisco!

#6 Updated by Antony Zonato over 6 years ago

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.

#7 Updated by Antony Zonato over 6 years ago

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

#8 Updated by Francisco Jose Campos Menendez over 6 years ago

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

#9 Updated by Antony Zonato over 6 years ago

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

#10 Updated by Richard Duivenvoorde over 6 years ago

  • Regression? changed from No to Yes

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

#11 Updated by Antony Zonato over 6 years ago

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

#12 Updated by Antony Zonato over 6 years ago

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.

#13 Updated by Antony Zonato over 6 years ago

Same thing with 3.2.1.

#14 Updated by Giovanni Manghi over 6 years ago

  • Status changed from Reopened to Feedback
  • Affected QGIS version changed from 3.1(master) to 3.2.1

Antony Zonato wrote:

Same thing with 3.2.1.

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

#15 Updated by Antony Zonato over 6 years ago

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

#16 Updated by Giovanni Manghi over 6 years ago

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".

#17 Updated by Antony Zonato over 6 years ago

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).

#18 Updated by Giovanni Manghi over 6 years ago

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".

#19 Updated by Antony Zonato over 6 years ago

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

#20 Updated by Giovanni Manghi over 6 years ago

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.

#21 Updated by Giovanni Manghi about 6 years ago

  • Priority changed from Normal to High
  • Status changed from Feedback to Open

#22 Updated by Antony Zonato about 6 years ago

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

Antony

#23 Updated by Giovanni Manghi about 6 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed/implemented

Also available in: Atom PDF