Bug report #19297

Repeated Crash making SQL Query in DB Manager

Added by Loren Amelang almost 2 years ago. Updated over 1 year ago.

Status:Open
Priority:High
Assignee:-
Category:DB Manager
Affected QGIS version:3.2.1 Regression?:Yes
Operating System:Windows 10 Creators with 3000x2000 screen and 175% scaling Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:27125

Description

My Attribute Table views show data rows sorted randomly. Trying to understand, I tried this against a shapefile:

Database -> DB Manager -> Virtual Layers -> QGIS Layers -> Profiles -> SQL Window ->
select * from ProfilesLinesOnly
order by id

It auto-enters only "ProfilesLinesOnly" despite showing "ProfilesLinesOnly 100-50..." in the Tree...
And it forces the column name to "id" despite showing "ID" in the Attribute Table.

It crashed!! And "Reload QGIS" didn't...

---
h2. Report Details

Crash ID: 7f7fe12663f1e633a0c13ed0e00e224678193a18

Stack Trace

RaiseException :
_TypeMatch :
RtlCaptureContext :
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.16299
---

I tried again with the spaces removed from the shapefile name in QGIS and on disk:

Database Error
An error occurred
(wait cursor, blank dialog)
Crashed on close:

---
h2. Report Details

Crash ID: 26a6ac7056ec4001ffdb66d4cdd268098d2a2145

Stack Trace

QBasicMutex::unlockInternal :
QgsTask::processSubTasksForTermination :
QgsTask::cancel :
PyInit__core :
PyCFunction_FastCallDict :
PyObject_GenericGetAttr :
PyEval_EvalFrameDefault :
PyFunction_FastCallDict :
PyObject_CallFunctionObjArgs :
PyObject_Call :
PyInit_sip :
std::basic_string<char,std::char_traits<char>,std::allocator<char> >::shrink_to_fit :
PyInit__core :
QgsTask::subTaskStatusChanged :
QMetaCallEvent::placeMetaCall :
QObject::event :
PyInit__core :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QCoreApplicationPrivate::sendPostedEvents :
qt_plugin_query_metadata :
QEventDispatcherWin32::processEvents :
CallWindowProcW :
DispatchMessageW :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
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.16299
---

Again, with "ID", "asc" added to sort:

---
h2. Report Details

Crash ID: 26a6ac7056ec4001ffdb66d4cdd268098d2a2145

Stack Trace

QBasicMutex::unlockInternal :
QgsTask::processSubTasksForTermination :
QgsTask::cancel :
PyInit__core :
PyCFunction_FastCallDict :
PyObject_GenericGetAttr :
PyEval_EvalFrameDefault :
PyFunction_FastCallDict :
PyObject_CallFunctionObjArgs :
PyObject_Call :
PyInit_sip :
std::basic_string<char,std::char_traits<char>,std::allocator<char> >::shrink_to_fit :
PyInit__core :
QgsTask::subTaskStatusChanged :
QMetaCallEvent::placeMetaCall :
QObject::event :
PyInit__core :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QCoreApplicationPrivate::sendPostedEvents :
qt_plugin_query_metadata :
QEventDispatcherWin32::processEvents :
CallWindowProcW :
DispatchMessageW :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
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.16299
---

I gave up. I'm far from a SQL expert, but it shouldn't crash even if my queries are stupid.

Doc error on download page.JPG - documentation error, please report (111 KB) Loren Amelang, 2018-07-21 05:01 AM

SQL error 19297.JPG - Blank error dialog before total crash (138 KB) Loren Amelang, 2018-08-12 09:35 PM

SQL error 19297 crash report.JPG - First crash report (224 KB) Loren Amelang, 2018-08-12 09:35 PM

Mystery project (not) in OSGeo4W64 after crash.JPG - After the crash and reload, a strange project appeared... (120 KB) Loren Amelang, 2018-08-12 10:07 PM

History

#1 Updated by Bugmi Gnott almost 2 years ago

Second part (Crash ID: 26a6ac7056ec4001ffdb66d4cdd268098d2a2145) is the same as #19271

#2 Updated by Giovanni Manghi almost 2 years ago

  • Priority changed from Normal to High
  • Crashes QGIS or corrupts data changed from No to Yes
  • Regression? changed from No to Yes

Of course should not crash. If it works on 2.18 this is a regression. Also the stable release of QGIS is 2.18, not 3.*.

#3 Updated by Nyall Dawson over 1 year ago

  • Status changed from Open to Feedback

Please test with QGIS 3.2.1

#4 Updated by Loren Amelang over 1 year ago

Nyall,

Help -> Check Version says I'm current, 3.3 is next step.

I checked the web download page, it opened with the "documentation error" message in the screenshot. Does it deserve its own bug report?
The newest version there is the 3.2.0-1 that I have.

I see a "final-3_2_1" on Github - is that what you're suggesting? It takes me a couple of hours (if I'm lucky) to download a full version out here. And I'd hate to risk replacing what I have which is mostly working... But I guess I could keep 3.2.0 available alongside that 3.2.1?

#5 Updated by Loren Amelang over 1 year ago

I just remembered this issue and realized I now have 3.2.1 - so I tried the SQL query again. I was in a different QGIS project, but I was able to load the original file into my current project and repeat the query. It seems to me 3.2.1 has crashed in exactly the same way.

"SQL error 19297.JPG" shows the query and the error report. No message ever fills in, and mousing over the error dialog gets a wait cursor.
"SQL error 19297 crash report.JPG" shows the rest of QGIS with the crash report and id.

After the crash report and "restart QGIS", at the end of the reload of my "Recent Projects" screen, it showed several errors at the top of the project list area. It often shows such messages for such a short time I can't read even the one line that is visible.

The test file for my SQL query was:
C:\Users\loren\Giant Files\HEC-RAS Dam Break\QGIS Projects\TestProject\Profiles100-50-25LinesOnly\Profiles100-50-25.shp

I'm not sure if these are leftover from the crash, but I've never seen such reports at this point in QGIS operation:

2018-08-12T10:54:14     INFO    QGIS Ready!
2018-08-12T10:54:15     WARNING    Unable to load C:\Users\loren\Giant
2018-08-12T10:54:15     WARNING    Unable to load C:\OSGeo4W64\bin\Files\HEC-RAS
2018-08-12T10:54:15     WARNING    Unable to load C:\OSGeo4W64\bin\Dam
2018-08-12T10:54:15     WARNING    Unable to load C:\OSGeo4W64\bin\Break\QGIS

So I tried a different SQL query on PostGIS tables, that I know works in pgAdmin4. Crash ID: 26a6ac7056ec4001ffdb66d4cdd268098d2a2145. Plus it took about ten times as long as pgAdmin4 execution before it crashed.

The reload showed even more strange error messages:

2018-08-12T11:34:43     INFO    QGIS Ready!
2018-08-12T11:34:44     WARNING    Unable to load C:\Users\loren\Giant
2018-08-12T11:34:44     WARNING    Unable to load C:\OSGeo4W64\bin\Files\HEC-RAS
2018-08-12T11:34:44     WARNING    Unable to load C:\OSGeo4W64\bin\Dam
2018-08-12T11:34:44     WARNING    Unable to load C:\OSGeo4W64\bin\Break\QGIS
2018-08-12T11:34:44     WARNING    Unable to load C:\Users\loren\Giant
2018-08-12T11:34:44     WARNING    Unable to load C:\OSGeo4W64\bin\Files\HEC-RAS
2018-08-12T11:34:44     WARNING    Unable to load C:\OSGeo4W64\bin\Dam
2018-08-12T11:34:44     WARNING    Unable to load C:\OSGeo4W64\bin\Break\QGIS

The first crash report:

h2. User Feedback

Retrying #19297 in QGIS 3.2.1
Same problem!

h2. Report Details

*Crash ID*: 26a6ac7056ec4001ffdb66d4cdd268098d2a2145

*Stack Trace*

QBasicMutex::unlockInternal :
QgsTask::processSubTasksForTermination :
QgsTask::cancel :
PyInit__core :
PyCFunction_FastCallDict :
PyObject_GenericGetAttr :
PyEval_EvalFrameDefault :
PyFunction_FastCallDict :
PyObject_CallFunctionObjArgs :
PyObject_Call :
PyInit_sip :
std::basic_string<char,std::char_traits<char>,std::allocator<char> >::shrink_to_fit :
PyInit__core :
QgsTask::subTaskStatusChanged :
QMetaCallEvent::placeMetaCall :
QObject::event :
PyInit__core :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QCoreApplicationPrivate::sendPostedEvents :
qt_plugin_query_metadata :
QEventDispatcherWin32::processEvents :
CallWindowProcW :
DispatchMessageW :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
BaseThreadInitThunk :
RtlUserThreadStart :

*QGIS Info*
QGIS Version: 3.2.1-Bonn
QGIS code revision: commit:1edf372fb8
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

The second report:

h2. User Feedback

Re: #19297 Tried a SQL query that I know works in pgAdmin4

h2. Report Details

*Crash ID*: 26a6ac7056ec4001ffdb66d4cdd268098d2a2145

*Stack Trace*
QBasicMutex::unlockInternal :
QgsTask::processSubTasksForTermination :
QgsTask::cancel :
PyInit__core :
PyCFunction_FastCallDict :
PyObject_GenericGetAttr :
PyEval_EvalFrameDefault :
PyFunction_FastCallDict :
PyObject_CallFunctionObjArgs :
PyObject_Call :
PyInit_sip :
std::basic_string<char,std::char_traits<char>,std::allocator<char> >::shrink_to_fit :
PyInit__core :
QgsTask::subTaskStatusChanged :
QMetaCallEvent::placeMetaCall :
QObject::event :
PyInit__core :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QCoreApplicationPrivate::sendPostedEvents :
qt_plugin_query_metadata :
QEventDispatcherWin32::processEvents :
CallWindowProcW :
DispatchMessageW :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
BaseThreadInitThunk :
RtlUserThreadStart :

*QGIS Info*
QGIS Version: 3.2.1-Bonn
QGIS code revision: commit:1edf372fb8
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

#6 Updated by Giovanni Manghi over 1 year ago

  • Status changed from Feedback to Open
  • Affected QGIS version changed from 3.2 to 3.2.1

#7 Updated by Loren Amelang over 1 year ago

One more thing... After the crashes and reload, a strange project has appeared, both in the initial display screen and in the Open Recent menu. There is no "Projects" folder in OSGeo4W64. Perhaps this is the source of the "Unable to load" messages? I used the right-click remove option and it is now gone from both places.

#8 Updated by Giovanni Manghi over 1 year ago

  • Status changed from Open to Feedback

Please try on QGIS 3.4.1, if the issue is still valid change the affected version, thanks.

#9 Updated by Loren Amelang over 1 year ago

Giovanni,

Sorry to abandon this, but I switched strategies and did my model entirely in HEC-RAS and RAS Mapper, and the report is off to the California DSOD, so I'm not likely to return to this issue. It was extremely obscure, me trying to work around a problem with the RiverGIS plugin, and I solved that one by using a pgAdmin4 query instead. Guess nobody else has run into this...

#10 Updated by Giovanni Manghi over 1 year ago

  • Status changed from Feedback to Open

Also available in: Atom PDF