Bug report #20386

Program crashes in idle phase

Added by N. L. about 2 years ago. Updated almost 2 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Build/Install
Affected QGIS version:3.4.1 Regression?:Yes
Operating System:Win10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:duplicate
Crashes QGIS or corrupts data:Yes Copied to github as #:28206

Description

User Feedback

Program crashes in idle phase.

Report Details

Crash ID: 46bdfc53c9e65ba01bf6e65f60a8fdcad5a2dd77

Stack Trace

QgsWinNative::initializeMainWindow :
QAbstractEventDispatcher::filterNativeEvent :
CallWindowProcW :
CallWindowProcW :
GetMenuState :
KiUserCallbackDispatcher :
NtUserPeekMessage :
PeekMessageW :
PeekMessageW :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info
QGIS Version: 3.4.1-Madeira
QGIS code revision: 383851c597
Compiled against Qt: 5.11.2
Running against Qt: 5.11.2
Compiled against GDAL: 2.3.2
Running against GDAL: 2.3.2

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

Loading.PNG (19.9 KB) N. L., 2018-11-07 01:29 PM


Related issues

Related to QGIS Application - Bug report #20412: Distance matrix Closed 2018-11-08
Related to QGIS Application - Bug report #20400: crash ID :46bdfc53c9e65ba01bf6e65f60a8fdcad5a2dd77 Closed 2018-11-08
Related to QGIS Application - Bug report #20399: frequent Crash / QGIS 3.4.1 on W10 - no evident reason Closed 2018-11-07
Related to QGIS Application - Bug report #20364: Crash QGIS 3.4.1 Closed 2018-11-05
Related to QGIS Application - Bug report #20374: QGIS 3.4.1 Crash on eject sd card Closed 2018-11-06
Related to QGIS Application - Bug report #20355: Crashed when nothing happens Closed 2018-11-04
Related to QGIS Application - Bug report #20488: qgis desktop keeps crashing in both 3.4 and 3.4.1 Closed 2018-11-14
Related to QGIS Application - Bug report #20495: crash when insert or eject usb storage Closed 2018-11-15
Related to QGIS Application - Bug report #20500: Change style for polygon Closed 2018-11-15
Related to QGIS Application - Bug report #20513: QGIS crash when insert a USB disk Closed 2018-11-16
Related to QGIS Application - Bug report #20504: Qgis Crashes after Being Open for Some Time Closed 2018-11-15
Related to QGIS Application - Bug report #20534: qgis crashed Closed 2018-11-17
Related to QGIS Application - Bug report #20543: v. 3.4.1 Crash on plugging in my GPS unit Closed 2018-11-19
Duplicated by QGIS Application - Bug report #20492: QGIS crashes on connecting a USB drive Closed 2018-11-14
Duplicated by QGIS Application - Bug report #20554: QGIS crashed Closed 2018-11-19
Duplicated by QGIS Application - Bug report #20584: QGIS 3.4 Crashes on File Drive Change Closed 2018-11-21
Duplicated by QGIS Application - Bug report #20590: Crash after running Closed 2018-11-22
Duplicated by QGIS Application - Bug report #20599: QGIS 3.4.1 regularly crashing on Idle! Closed 2018-11-22
Duplicated by QGIS Application - Bug report #20602: Applicazione in backgound e disconnessione chiavetta Closed 2018-11-23
Duplicated by QGIS Application - Bug report #20634: QGIS 3.4.1 crashes when idle Closed 2018-11-26
Duplicated by QGIS Application - Bug report #20641: QGIS Crashed Closed 2018-11-27
Duplicated by QGIS Application - Bug report #20649: QGIS Crash Closed 2018-11-27
Duplicated by QGIS Application - Bug report #20684: Zamkniecie QGIS Desktop przy odpieciu zewnętrznego źródla... Closed 2018-11-30
Duplicated by QGIS Application - Bug report #20905: crash when flash or external drive is inserted Closed 2019-01-02
Duplicated by QGIS Application - Bug report #20860: QGIS crashing possibly during drives refresh Closed 2018-12-20
Duplicated by QGIS Application - Bug report #20827: QGIS3.4.1 crashes after short period inactivity Closed 2018-12-17
Duplicated by QGIS Application - Bug report #20820: QGIS 3.4 crashed when using ArcGIS MapServer and FeatureS... Closed 2018-12-16
Duplicated by QGIS Application - Bug report #20755: QGis Madeira crashes every time a USB Device (memory stic... Closed 2018-12-07
Duplicated by QGIS Application - Bug report #20918: Using go2streetview Closed 2019-01-04
Duplicated by QGIS Application - Bug report #20962: Crash instantly after open Closed 2019-01-10
Duplicated by QGIS Application - Bug report #20473: QGIS crash Closed 2018-11-13
Duplicated by QGIS Application - Bug report #20466: Qgis crash Closed 2018-11-12

Associated revisions

Revision df9307b9
Added by Nyall Dawson about 2 years ago

Further protection in windows event message handling

Refs #20386

Revision 2b4dc925
Added by Nyall Dawson about 2 years ago

Further protection in windows event message handling

Refs #20386

(cherry picked from commit df9307b9aa34b849f86d2ce435f2ae986b70549b)

History

#1 Updated by Saber Razmjooei about 2 years ago

  • Status changed from Open to Feedback

Could you provide step-by-step to reproduce the issue?

#2 Updated by Giovanni Manghi about 2 years ago

  • Category changed from Processing/Core to Build/Install
  • Priority changed from Normal to High

#3 Updated by N. L. about 2 years ago

  • File Loading.PNG added
  • Assignee set to Saber Razmjooei

The problem seems to be related to the project file. The project file is loaded up to 98% and then stays at this value. After about 15 minutes the above crash occurs. How can I find out where the error is in the project file?

#4 Updated by Giovanni Manghi about 2 years ago

  • Assignee deleted (Saber Razmjooei)

#5 Updated by Giovanni Manghi about 2 years ago

N. L. wrote:

The problem seems to be related to the project file.

what does contain your project (datasources, layouts, etc.?)?

#6 Updated by N. L. about 2 years ago

I rebuilt the project step by step and the bug was probably due to oversized csv attribute tables anchored in the project. If I leave them out now, Qgis seems to run stable.

#7 Updated by Giovanni Manghi about 2 years ago

N. L. wrote:

I rebuilt the project step by step and the bug was probably due to oversized csv attribute tables anchored in the project. If I leave them out now, Qgis seems to run stable.

tell us more: the csv was joined to what other datasource? how many columns has rhe CSV that causes the crash when joined? Does it crash if you add the CSV without joining it?

#8 Updated by N. L. about 2 years ago

I tried to link the CSV to a shape file. The CSV file has more than 36000 lines and 226 MB.
The crash happens without making the layer with the linked CSV file visible. The loading of the project cannot be completed. In version 3.3 this error did not appear yet.

#9 Updated by Martin Dobias about 2 years ago

#10 Updated by Martin Dobias about 2 years ago

Seems related to #20412 - same backtrace. Probably there is a bug in the new code for handling of native events on Windows to catch USB drive insertion/removal.

#11 Updated by Martin Dobias about 2 years ago

  • Related to Bug report #20400: crash ID :46bdfc53c9e65ba01bf6e65f60a8fdcad5a2dd77 added

#12 Updated by Martin Dobias about 2 years ago

  • Related to Bug report #20399: frequent Crash / QGIS 3.4.1 on W10 - no evident reason added

#13 Updated by Martin Dobias about 2 years ago

#14 Updated by Martin Dobias about 2 years ago

#15 Updated by Martin Dobias about 2 years ago

#16 Updated by Stephen Knox about 2 years ago

I get a similar, but not entirely the same stack trace:

Crash ID: 6138756c706cb33aebe0925fbe4e95b5b12f5787

Stack Trace

QgsWinNativeEventFilter::nativeEventFilter qgswinnative.cpp:182
QAbstractEventDispatcher::filterNativeEvent :
CallWindowProcW :
CallWindowProcW :
GetLastInputInfo :
KiUserCallbackDispatcher :
NtUserPeekMessage :
PeekMessageW :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main main.cpp:1505
WinMain mainwin.cpp:170
__scrt_common_main_seh exe_common.inl:253
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info
QGIS Version: 3.4.1-Madeira
QGIS code revision: cdf878d4b5
Compiled against Qt: 5.11.2
Running against Qt: 5.11.2
Compiled against GDAL: 2.3.2
Running against GDAL: 2.3.2

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

The line it points to is

182: unsigned long deviceType = reinterpret_cast<DEV_BROADCAST_HDR *>( lParam )->dbch_devicetype;
183: if ( deviceType == DBT_DEVTYP_VOLUME )

I had an outlandish theory that because I often get messages relating to Audio in DebugView around the crash,

such as

[10772] CxHDAudioDeviceControl::SetLEDStatusToDriver() + isPlaybackEndpoint = 1, ledStatus = 1

that it was something bizarre relating to an error somewhere caused by the difference between the concept of volume as a disk volume, as is meant in the QGIS message reading I think, and Sound Volume, but that seems somewhat far fetched.

The other thing that jumps out is
[9936] shell\lock\abovelock\shellcomponent\lockscreenapppositioner.cpp(256)\AboveLockAppHost.dll!00007FFDFC96323A: (caller: 00007FFE2D4784A3) ReturnHr(75) tid(232c) 8000FFFF Catastrophic failure

but it's hard to figure out exactly where things are going wrong from the traces.

#17 Updated by Nyall Dawson about 2 years ago

Stephen - are you using a custom build? I'd love to put some debugging code in here, but unfortunately(?) I haven't been able to trigger this crash myself.

#18 Updated by Stephen Knox about 2 years ago

I think I can now reproduce it. I have a machine with a Thunderbolt connector and when that is plugged in or out to connect external monitors, mice, keyboard and network connections I get a crash. Happy to start a new bug thread in case these are not related, but I strongly suspect they are.

This is the DebugView output immediately preceeding the crash:

[9936] avcore\npsm\localprovider\baseprovider\lib\baseprovider.cpp(604)\NPSMDesktopProvider.dll!00007FFDDD972140: (caller: 00007FFDDD9726E5) ReturnHr(2607) tid(232c) 80070490 Element not found.
[33204] ..\..\..\src\gui\qgsmapcanvas.cpp(1344) : (QgsMapCanvas::keyPressEvent) [14770ms] Ignoring key: 16777251
[9936] avcore\npsm\localprovider\baseprovider\lib\baseprovider.cpp(604)\NPSMDesktopProvider.dll!00007FFDDD972140: (caller: 00007FFDDD9726E5) ReturnHr(2608) tid(232c) 80070490 Element not found.
[9936] shell\lib\bindctx.cpp(128)\explorerframe.dll!00007FFDFC4A4280: (caller: 00007FFDFC4CA68B) ReturnHr(4458) tid(3624) 80070057 The parameter is incorrect.
[9936] shell\lib\bindctx.cpp(128)\explorerframe.dll!00007FFDFC4A4280: (caller: 00007FFDFC4CA68B) ReturnHr(4459) tid(5418) 80070057 The parameter is incorrect.
[9936] shell\lib\bindctx.cpp(128)\explorerframe.dll!00007FFDFC4A4280: (caller: 00007FFDFC4CA68B) ReturnHr(4460) tid(54dc) 80070057 The parameter is incorrect.
[9936] shell\lib\bindctx.cpp(128)\explorerframe.dll!00007FFDFC4A4280: (caller: 00007FFDFC4CA68B) ReturnHr(4461) tid(7ff8) 80070057 The parameter is incorrect.
[10772] *******************************************************************************
[10772] Types supported for 22
[10772] *******************************************************************************
[10772] Types supported for 25
[10772] DeviceIoControl failed with error 87: The parameter is incorrect.
[10772] DeviceIoControl failed with error 87: The parameter is incorrect.
[9936] onecoreuap\base\diagnosis\platform\notifications\platform\database\databasehelpers.cpp(143)\wpncore.dll!00007FFE100D1459: (caller: 00007FFE100D21AF) ReturnHr(274) tid(6448) 80070490 Element not found.
[10772] CCxHDAudioHDMI::get_MasterVolume
[10772] CCxHDAudioHDMI::get_MasterVolume: Created ()
[10772] CCxHDAudioHDMI::get_MasterVolume(): Before SetEndPointInfo()
[10772] CCxHDAudioHDMI::get_MasterVolume(): After SetEndPointInfo()
[10772] CCxHDAudioHDMI::get_MasterVolume(): Before QI<ICxHDMasterVolumeControl>
[10772] CCxHDAudioHDMI::get_MasterVolume(): After QI<ICxHDMasterVolumeControl>
[10772] CCHDAudioSPDIF::Final QI<ICxHDMasterVolumeControl>
[10772] CCxHDAudioHDMI::get_MasterVolume
[10772] CCxHDAudioHDMI::get_MasterVolume: Created ()
[9936] shell\lib\bindctx.cpp(128)\explorerframe.dll!00007FFDFC4A4280: (caller: 00007FFDFC4CA68B) ReturnHr(4462) tid(5418) 80070057 The parameter is incorrect.
[10772] CCxHDAudioHDMI::get_MasterVolume(): Before SetEndPointInfo()
[10772] CCxHDAudioHDMI::get_MasterVolume(): After SetEndPointInfo()
[10772] CCxHDAudioHDMI::get_MasterVolume(): Before QI<ICxHDMasterVolumeControl>
[10772] CCxHDAudioHDMI::get_MasterVolume(): After QI<ICxHDMasterVolumeControl>
[10772] CCHDAudioSPDIF::Final QI<ICxHDMasterVolumeControl>
[9936] shell\lib\bindctx.cpp(128)\explorerframe.dll!00007FFDFC4A4280: (caller: 00007FFDFC4CA68B) ReturnHr(4463) tid(7ff8) 80070057 The parameter is incorrect.
[9936] shell\lib\bindctx.cpp(128)\explorerframe.dll!00007FFDFC4A4280: (caller: 00007FFDFC4CA68B) ReturnHr(4464) tid(54dc) 80070057 The parameter is incorrect.
[9936] shell\lib\bindctx.cpp(128)\explorerframe.dll!00007FFDFC4A4280: (caller: 00007FFDFC4CA68B) ReturnHr(4465) tid(3624) 80070057 The parameter is incorrect.
[9936] avcore\npsm\localprovider\baseprovider\lib\baseprovider.cpp(604)\NPSMDesktopProvider.dll!00007FFDDD972140: (caller: 00007FFDDD9726E5) ReturnHr(2609) tid(232c) 80070490 Element not found.
[33204] ..\..\..\src\app\qgscrashhandler.cpp(34) : (QgsCrashHandler::handle) [6696ms] CRASH!!!

#19 Updated by Stephen Knox about 2 years ago

P.S., I am using qgis-rel-dev-g7.4.2.bat from OSGeo4W (i.e with debugging symbols) as I don't have a build system on Windows.

#20 Updated by Stephen Knox about 2 years ago

My apologies, it is not a Lightning connector, it is a Thunderbolt connector.

#21 Updated by Giovanni Manghi about 2 years ago

  • Status changed from Feedback to Open
  • Subject changed from Program crashes in idle phase. to Program crashes in idle phase
  • Regression? changed from No to Yes

#22 Updated by Nyall Dawson about 2 years ago

  • Status changed from Open to Feedback

Please test with the next round of QGIS 3.6 nightlies (not 3.4 - it hasn't been backported yet). I've added some extra safety checks which (fingers crossed!) might prevent this.

#23 Updated by Fabien Wl about 2 years ago

I have a Thunderbolt USB type-C port on my laptop.
I just tried an ejection of a USB drive connected to this port and QGIS crashed right away.
(same crash ID: Crash ID: 46bdfc53c9e65ba01bf6e65f60a8fdcad5a2dd77).
Same behaviour when I connect a USB drive.

Interestingly, crash may happen when nothing particular is done.
(QGIS crashed with this ID while I was away from computer..)
I assume that that there is some Windows 10 check in background.. (?)

#24 Updated by Markus - about 2 years ago

Nyall Dawson wrote:

Please test with the next round of QGIS 3.6 nightlies (not 3.4 - it hasn't been backported yet). I've added some extra safety checks which (fingers crossed!) might prevent this.

Did you mean 3.5? I tried installing using OSGeo4W, but it only lists 3.5 as far as I can see.

#25 Updated by Giovanni Manghi about 2 years ago

Did you mean 3.5?

yes

#26 Updated by Markus - about 2 years ago

I installed the dev version (it says QGIS eab40d0e4c in the title bar), still crashes in idle phase for me. I'm still able to force a crash by connecting to network shares. Like Stephen I'm also using a docking station with thunderbolt, I don't get any crashes however when I disconnect/connect the docking station (running QGIS 3.4.x).

#27 Updated by Nyall Dawson about 2 years ago

That build is too old -- it's missing the latest related fix

#28 Updated by Stephen Knox about 2 years ago

Yeah, think there is a build problem with the nightlies ATM. So will have to wait to fully test.

#29 Updated by Markus - about 2 years ago

I installed the dev version again using OSGeo4W, I now get revision eab40d0e4c (don't know if this is the latest one?). Unfortunately still crashes for me.

#30 Updated by Giovanni Manghi about 2 years ago

Markus - wrote:

I installed the dev version again using OSGeo4W, I now get revision eab40d0e4c (don't know if this is the latest one?). Unfortunately still crashes for me.

is still the same as #20386-26

#31 Updated by Jürgen Fischer about 2 years ago

#32 Updated by Jürgen Fischer about 2 years ago

  • Related to Bug report #20488: qgis desktop keeps crashing in both 3.4 and 3.4.1 added

#33 Updated by Jürgen Fischer about 2 years ago

#34 Updated by Markus - about 2 years ago

Giovanni Manghi wrote:

Markus - wrote:

I installed the dev version again using OSGeo4W, I now get revision eab40d0e4c (don't know if this is the latest one?). Unfortunately still crashes for me.

is still the same as #20386-26

Ah yes, sorry about that.

#35 Updated by Stephen Knox about 2 years ago

Looks promising so far with d4cf6a - no crash when removing the thunderbolt cable, and no crash in idle phase yet

#36 Updated by Markus - about 2 years ago

I'm running revision 7cce9b3eb9 and have not been able to force a crash by adding/removing network shares. No crash in idle yet either, though I've just been running it for an hour, but looks promising. Will this be backported to 3.4.2, 3.4.3 or 3.4.4? Thanks for the fast handling of the issue, great work.

#37 Updated by Jürgen Fischer about 2 years ago

#38 Updated by Jürgen Fischer about 2 years ago

#39 Updated by Jürgen Fischer about 2 years ago

#40 Updated by Jürgen Fischer about 2 years ago

#41 Updated by Jürgen Fischer about 2 years ago

Markus - wrote:

I'm running revision 7cce9b3eb9 and have not been able to force a crash by adding/removing network shares. No crash in idle yet either, though I've just been running it for an hour, but looks promising. Will this be backported to 3.4.2, 3.4.3 or 3.4.4? Thanks for the fast handling of the issue, great work.

It is backported to the release-3_4 branch and will appear in the 3.4.2 point release.

#42 Updated by Jürgen Fischer about 2 years ago

#43 Updated by Jürgen Fischer about 2 years ago

#44 Updated by Jürgen Fischer about 2 years ago

#45 Updated by Giovanni Manghi about 2 years ago

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

#46 Updated by Jürgen Fischer about 2 years ago

#47 Updated by Jürgen Fischer about 2 years ago

#48 Updated by Jürgen Fischer about 2 years ago

#49 Updated by Jürgen Fischer about 2 years ago

#50 Updated by Jürgen Fischer about 2 years ago

  • Duplicated by Bug report #20602: Applicazione in backgound e disconnessione chiavetta added

#51 Updated by Jürgen Fischer almost 2 years ago

#52 Updated by Jürgen Fischer almost 2 years ago

#53 Updated by Jürgen Fischer almost 2 years ago

#54 Updated by Jürgen Fischer almost 2 years ago

  • Duplicated by Bug report #20684: Zamkniecie QGIS Desktop przy odpieciu zewnętrznego źródla danych added

#55 Updated by Jürgen Fischer almost 2 years ago

  • Duplicated by Bug report #20905: crash when flash or external drive is inserted added

#56 Updated by Jürgen Fischer almost 2 years ago

  • Duplicated by Bug report #20860: QGIS crashing possibly during drives refresh added

#57 Updated by Jürgen Fischer almost 2 years ago

  • Duplicated by Bug report #20827: QGIS3.4.1 crashes after short period inactivity added

#58 Updated by Jürgen Fischer almost 2 years ago

  • Duplicated by Bug report #20820: QGIS 3.4 crashed when using ArcGIS MapServer and FeatureServer added

#59 Updated by Jürgen Fischer almost 2 years ago

  • Duplicated by Bug report #20755: QGis Madeira crashes every time a USB Device (memory stick, harddisk) is plugged in or out added

#60 Updated by Jürgen Fischer almost 2 years ago

#61 Updated by Jürgen Fischer almost 2 years ago

  • Resolution changed from fixed/implemented to duplicate

#62 Updated by Jürgen Fischer almost 2 years ago

#63 Updated by Jürgen Fischer almost 2 years ago

#64 Updated by Jürgen Fischer almost 2 years ago

#65 Updated by Jürgen Fischer almost 2 years ago

#66 Updated by Jürgen Fischer almost 2 years ago

Also available in: Atom PDF