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.34k stars 2.98k forks source link

Crash when creating 3D view #53941

Closed Nekzuris closed 7 months ago

Nekzuris commented 1 year ago

What is the bug or the crash?

After creating a 3D view, it freeze and then crash.

Steps to reproduce the issue

  1. Open a .laz file
  2. Go to View -> 3D View -> Create new 3D View

Then sometime it crash right away, sometime it crash only after resizing the window and sometime it works fine (about 1/10).

Versions

Version de QGIS | 3.32.0-Lima | Révision du code | 311a8cb8a6 -- | -- | -- | -- Version de Qt | 5.15.3 Version de Python | 3.9.5 Version de GDAL/OGR | 3.7.0 Version de Proj | 9.2.1 Version de la base de données du registre EPSG | v10.088 (2023-05-13) Version de GEOS | 3.11.2-CAPI-1.17.2 Version de SQLite | 3.41.1 Version de PDAL | 2.5.3 Version du client PostgreSQL | 15.2 Version de SpatiaLite | 5.0.1 Version de QWT | 6.1.6 Version de QScintilla2 | 2.13.1 Version de l'OS | Windows 10 Version 2009   |   |   |   Extensions Python actives db_manager | 0.1.20 grassprovider | 2.12.99 MetaSearch | 0.3.6 processing | 2.12.99 Version de QGIS 3.32.0-Lima Révision du code [311a8cb8a6](https://github.com/qgis/QGIS/commit/311a8cb8a6) Version de Qt 5.15.3 Version de Python 3.9.5 Version de GDAL/OGR 3.7.0 Version de Proj 9.2.1 Version de la base de données du registre EPSG v10.088 (2023-05-13) Version de GEOS 3.11.2-CAPI-1.17.2 Version de SQLite 3.41.1 Version de PDAL 2.5.3 Version du client PostgreSQL 15.2 Version de SpatiaLite 5.0.1 Version de QWT 6.1.6 Version de QScintilla2 2.13.1 Version de l'OS Windows 10 Version 2009 Extensions Python actives db_manager 0.1.20 grassprovider 2.12.99 MetaSearch 0.3.6 processing 2.12.99 ### Supported QGIS version - [x] I'm running a supported QGIS version according to [the roadmap](https://www.qgis.org/en/site/getinvolved/development/roadmap.html#release-schedule). ### New profile - [X] I tried with a new [QGIS profile](https://docs.qgis.org/latest/en/docs/user_manual/introduction/qgis_configuration.html#working-with-user-profiles) ### Additional context LAZ file from LidarHD project : https://geoservices.ign.fr/lidarhd Some tiles crash more often than other, but it doesn't seems to be related to the number of points. specifically this one always crash : [LHD_FXX_0991_6805_PTS_C_LAMB93_IGN69.copc.laz](https://storage.sbg.cloud.ovh.net/v1/AUTH_63234f509d6048bca3c9fd7928720ca1/ppk-lidar/RF/LHD_FXX_0991_6805_PTS_C_LAMB93_IGN69.copc.laz) Also I tested with 3.28.8-Firenze and got the same error. Edit: Just tested the last release 3.32.1-Lima same error.
nicogodet commented 1 year ago

Stacktrace I get

Python Stack Trace
Windows fatal exception: code 0xc0000139

Current thread 0x00001ad8 (most recent call first):

Windows fatal exception: code 0xc0000139

Current thread 0x00001ad8 (most recent call first):

Windows fatal exception: code 0xc0000139

Current thread 0x00001ad8 (most recent call first):
  File "C:\OSGeo4W/apps/qgis/./python\pyplugin_installer\installer.py", line 284 in showPluginManagerWhenReady
    iface.pluginManagerInterface().showPluginManager(tabIndex)
Windows fatal exception: code 0xc0000139

Current thread 0x00001ad8 (most recent call first):
  File "C:\OSGeo4W/apps/qgis/./python\pyplugin_installer\installer.py", line 284 in showPluginManagerWhenReady
    iface.pluginManagerInterface().showPluginManager(tabIndex)
Windows fatal exception: access violation

Current thread 0x00001ad8 (most recent call first):

Stack Trace

Qt3DCore::QSystemInformationService::tr :
Qt3DCore::QChangeArbiter::distributeQueueChanges :
Qt3DCore::QChangeArbiter::syncChanges :
Qt3DCore::QAspectManager::processFrame :
Qt3DCore::QAspectManager::exitSimulationLoop :
QObject::qt_static_metacall :
QUnifiedTimer::setSlowdownFactor :
QAbstractAnimation::setCurrentTime :
QUnifiedTimer::updateAnimationTimers :
QUnifiedTimer::updateAnimationTimers :
QAnimationDriver::advance :
QObject::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QEventDispatcherWin32Private::sendTimerEvent :
QEventDispatcherWin32::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QCoreApplicationPrivate::sendPostedEvents :
qt_plugin_query_metadata :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info
QGIS Version: 3.32.1-Lima
QGIS code revision: 4a078ecf63
Compiled against Qt: 5.15.3
Running against Qt: 5.15.3
Compiled against GDAL: 3.7.1
Running against GDAL: 3.7.1

System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.19044
saberraz commented 1 year ago

Could you start from a fresh profile with no plugins installed?

nicogodet commented 1 year ago

No crash on Master 6465736b42 Still crash on 3.32.1

Python Stack Trace
Windows fatal exception: code 0xc0000139

Current thread 0x00001e74 (most recent call first):

Windows fatal exception: code 0xc0000139

Current thread 0x00001e74 (most recent call first):

Windows fatal exception: access violation

Current thread 0x00001e74 (most recent call first):

Stack Trace

Qt3DCore::QChangeArbiter::distributeQueueChanges :
Qt3DCore::QChangeArbiter::syncChanges :
Qt3DCore::QAspectManager::processFrame :
Qt3DCore::QAspectManager::exitSimulationLoop :
QObject::qt_static_metacall :
QUnifiedTimer::setSlowdownFactor :
QAbstractAnimation::setCurrentTime :
QUnifiedTimer::updateAnimationTimers :
QUnifiedTimer::updateAnimationTimers :
QAnimationDriver::advance :
QObject::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QEventDispatcherWin32Private::sendTimerEvent :
QEventDispatcherWin32::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QCoreApplicationPrivate::sendPostedEvents :
qt_plugin_query_metadata :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info
QGIS Version: 3.32.1-Lima
QGIS code revision: 4a078ecf63
Compiled against Qt: 5.15.3
Running against Qt: 5.15.3
Compiled against GDAL: 3.7.1
Running against GDAL: 3.7.1

System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.19044
romainreignier commented 1 year ago

I have the same issue on Ubuntu 22.04 with Flatpak Qgis 3.32.2 and ArchLinux with Qgis 3.32.1. I don't have a stack trace for now, I need to see how to get one.

romainreignier commented 1 year ago

These issues seems related too: https://github.com/qgis/QGIS/issues/54415 and https://github.com/qgis/QGIS/issues/54331

romainreignier commented 1 year ago

For reference, to use gdb in Flatpak:

flatpak install org.qgis.qgis.Debug
flatpak install org.kde.Sdk
flatpak run --command=sh --devel org.qgis.qgis
gdb /app/bin/qgis

Backtrace:

Thread 1 "qgis" received signal SIGSEGV, Segmentation fault.
0x00007fffeb509cb4 in Qt3DCore::QChangeArbiter::distributeQueueChanges(std::vector<QSharedPointer<Qt3DCore::QSceneChange>, std::allocator<QSharedPointer<Qt3DCore::QSceneChange> > >*) () from /usr/lib/x86_64-linux-gnu/libQt53DCore.so.5
(gdb) 
(gdb) bt
#0  0x00007fffeb509cb4 in Qt3DCore::QChangeArbiter::distributeQueueChanges(std::vector<QSharedPointer<Qt3DCore::QSceneChange>, std::allocator<QSharedPointer<Qt3DCore::QSceneChange> > >*) () at /usr/lib/x86_64-linux-gnu/libQt53DCore.so.5
#1  0x00007fffeb509edc in Qt3DCore::QChangeArbiter::syncChanges() () at /usr/lib/x86_64-linux-gnu/libQt53DCore.so.5
#2  0x00007fffeb51792d in Qt3DCore::QAspectManager::processFrame() () at /usr/lib/x86_64-linux-gnu/libQt53DCore.so.5
#3  0x00007fffeb517b36 in  () at /usr/lib/x86_64-linux-gnu/libQt53DCore.so.5
#4  0x00007ffff4c36ffd in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff49f0b11 in QAbstractAnimation::stop() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff49f0ce2 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007ffff49ef68b in QUnifiedTimer::updateAnimationTimers(long long) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007ffff49f131c in QAnimationDriver::advanceAnimation(long long) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007ffff4c2b78d in QObject::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007ffff575cffe in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#11 0x00007ffff33d8812 in QgsApplication::notify(QObject*, QEvent*) (this=0x7fffffffd080, receiver=0x555558cf0d58, event=0x7fffffffcae0)
    at /run/build/qgis/src/core/qgsapplication.cpp:580
#12 0x00007ffff4bffd48 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ffff4c56e91 in QTimerInfoList::activateTimers() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff4c5775c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#15 0x00007fffe844fd71 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007fffe84a6028 in g_main_context_iterate.constprop () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007fffe844d4a3 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007ffff4c57a96 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#19 0x00007ffff4bfe7bb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007ffff4c06926 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x0000555555561d04 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /run/build/qgis/src/app/main.cpp:1817
romainreignier commented 1 year ago

I have also tried in QGis LTS from Flatpak: 3.28.9. I also have a crash but the backtrace is different:

Thread 37 "Thread (pooled)" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffaa0d9640 (LWP 55)]
0x00007fffeb36bc4f in Qt3DCore::QChangeArbiter::sceneChangeEvent(QSharedPointer<Qt3DCore::QSceneChange> const&) () from /usr/lib/x86_64-linux-gnu/libQt53DCore.so.5
(gdb) bt
#0  0x00007fffeb36bc4f in Qt3DCore::QChangeArbiter::sceneChangeEvent(QSharedPointer<Qt3DCore::QSceneChange> const&) ()
    at /usr/lib/x86_64-linux-gnu/libQt53DCore.so.5
#1  0x00007fffeb4ccb9a in Qt3DRender::Render::Geometry::notifyExtentChanged() () at /usr/lib/x86_64-linux-gnu/libQt53DRender.so.5
#2  0x00007fffeb5209a5 in Qt3DRender::Render::CalculateBoundingVolumeJob::run() () at /usr/lib/x86_64-linux-gnu/libQt53DRender.so.5
#3  0x00007fffeb3809f0 in  () at /usr/lib/x86_64-linux-gnu/libQt53DCore.so.5
#4  0x00007ffff4ad89a2 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff4ad57ff in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff49e33ba in start_thread () at /usr/lib/x86_64-linux-gnu/libpthread.so.0
#7  0x00007ffff25667a3 in clone () at /usr/lib/x86_64-linux-gnu/libc.so.6

Edit, on second run, the backtrace is the same as in the 3.32.2:

Thread 1 "qgis" received signal SIGSEGV, Segmentation fault.
0x00007fffeb36be79 in Qt3DCore::QChangeArbiter::distributeQueueChanges(std::vector<QSharedPointer<Qt3DCore::QSceneChange>, std::allocator<QSharedPointer<Qt3DCore::QSceneChange> > >*) () from /usr/lib/x86_64-linux-gnu/libQt53DCore.so.5
(gdb) bt
#0  0x00007fffeb36be79 in Qt3DCore::QChangeArbiter::distributeQueueChanges(std::vector<QSharedPointer<Qt3DCore::QSceneChange>, std::allocator<QSharedPointer<Qt3DCore::QSceneChange> > >*) () at /usr/lib/x86_64-linux-gnu/libQt53DCore.so.5
#1  0x00007fffeb36bf3b in Qt3DCore::QChangeArbiter::syncChanges() () at /usr/lib/x86_64-linux-gnu/libQt53DCore.so.5
#2  0x00007fffeb3796dd in Qt3DCore::QAspectManager::processFrame() () at /usr/lib/x86_64-linux-gnu/libQt53DCore.so.5
#3  0x00007fffeb3798f6 in  () at /usr/lib/x86_64-linux-gnu/libQt53DCore.so.5
#4  0x00007ffff4cff844 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff4abb78c in QAbstractAnimation::stop() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff4abb9a4 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007ffff4aba2db in QUnifiedTimer::updateAnimationTimers(long long) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007ffff4abbfed in QAnimationDriver::advanceAnimation(long long) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007ffff4cf543f in QObject::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007ffff58267af in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#11 0x00007ffff34b4a72 in QgsApplication::notify(QObject*, QEvent*) (this=0x7fffffffd150, receiver=0x555558e17108, event=0x7fffffffcb40)
    at /run/build/qgis/src/core/qgsapplication.cpp:542
#12 0x00007ffff4cc89aa in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ffff4d1fb6b in QTimerInfoList::activateTimers() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff4d2043c in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#15 0x00007fffe8570291 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007fffe8570538 in g_main_context_iterate.constprop () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007fffe8570604 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007ffff4d207c4 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#19 0x00007ffff4cc73ab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007ffff4ccf670 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x0000555555563026 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /run/build/qgis/src/app/main.cpp:1726
wonder-sk commented 11 months ago

I can confirm the crash on my machine. It is happening inside Qt3D. I think the problem is unrelated to point cloud data, it's just that point cloud layers are doing some heavier use of Qt3D and therefore it is more likely to trigger the problem.

It looks like a bug in Qt3D in Qt5 (even though there is no single QTBUG I could reference). I have tested also with Qt6 build and things seem to work fine. In Qt6 the core of Qt3D has been simplified a lot, and the code where the crash was happening does not exist anymore (removed in https://github.com/qt/qt3d/commit/b828609440a4771838c242b3ad9962ecd7a2fe99), so that would explain why the crash does not happen in Qt6 :-)

Fixing this in QGIS code may be quite difficult, especially because many times the bug is intermittent. I would be more in favor of speeding up the switch to Qt6, so that we don't need to find ugly workarounds for bugs in old versions of libraries...

Just in case, here's the backtrace including debug symbols in qt3d:

#0  0x00007ffff474a088 in Qt3DCore::QSceneChange::type() const (this=0x55555a72c1e0) at changes/qscenechange.cpp:137
#1  0x00007ffff4738dae in Qt3DCore::QChangeArbiter::distributeQueueChanges(std::vector<QSharedPointer<Qt3DCore::QSceneChange>, std::allocator<QSharedPointer<Qt3DCore::QSceneChange> > >*) (this=this@entry=0x55555aadcac0, changeQueue=0x555555b72b20) at ./src/core/qchangearbiter.cpp:119
#2  0x00007ffff4738fcb in Qt3DCore::QChangeArbiter::syncChanges() (this=0x55555aadcac0) at ./src/core/qchangearbiter.cpp:179
#3  0x00007ffff4746a25 in Qt3DCore::QAspectManager::processFrame() (this=0x55555ab0b2b0) at aspects/qaspectmanager.cpp:540
#4  0x00007ffff4746c4a in operator() (__closure=0x55555a583510) at aspects/qaspectmanager.cpp:178
#5  QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, Qt3DCore::QAspectManager::enterSimulationLoop()::<lambda()> >::call
    (arg=<optimized out>, f=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:146
#6  QtPrivate::Functor<Qt3DCore::QAspectManager::enterSimulationLoop()::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:256
#7  QtPrivate::QFunctorSlotObject<Qt3DCore::QAspectManager::enterSimulationLoop()::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x55555a583500, r=<optimized out>, a=<optimized out>, ret=<optimized out>)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:443
#8  0x00007ffff34f1793 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007ffff32b29dc in QAbstractAnimation::stop() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007ffff32b2bfc in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007ffff32b1493 in QUnifiedTimer::updateAnimationTimers(long long) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007ffff32b3271 in QAnimationDriver::advanceAnimation(long long) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ffff34e733f in QObject::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff416c713 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007ffff080dd13 in QgsApplication::notify(QObject*, QEvent*) (this=0x7fffffffd320, receiver=0x55555b8f44a8, event=0x7fffffffcca0)
    at /home/martin/qgis/git-master/src/core/qgsapplication.cpp:581
#16 0x00007ffff34b9e3a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007ffff35123eb in QTimerInfoList::activateTimers() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#18 0x00007ffff3512d34 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#19 0x00007fffe791bd3b in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007fffe7971258 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00007fffe79193e3 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007ffff35130b8 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x00007ffff34b875b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#24 0x00007ffff34c0cf4 in QCoreApplication::exec() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#25 0x000055555556d4d2 in main(int, char**) (argc=1, argv=0x7fffffffdcc8) at /home/martin/qgis/git-master/src/app/main.cpp:1830
vpicavet commented 11 months ago

I can confirm the bug on a fresh Flatpak install on Ubuntu 23.04, same dataset.

This is actually a bad one, since the first thing people do when downloading the new LIDAR HD dataset is opening it in QGIS and having a crash straightaway. If it is not fixable in short time, maybe we should have this whole set of features hidden behind a configuration option, flagged as experimental ?

Currently the impact on users makes them think QGIS is buggy and unusable, it does harm the reputation.

wonder-sk commented 10 months ago

@vpicavet we could get KDAB folks to look into that qt5 crash if it is a problem that needs addressing ASAP.

What do you suggest to hide behind a configuration option? To me that sounds like creating just more confusion among users as some features would be suddenly gone - and for most users these features work fine. Even with the french LIDAR HD, I have opened quite a few files from it and the referenced file here is the only one that was giving me a crash.

vpicavet commented 10 months ago

Having KDAB look into the issue would be a good idea.

The only two LIDAR HD files I randomly tried crashed QGIS ( flatpak install).

"for some users these features work fine" => maybe for some, but from what we hear from user feedback, most users consider 3D in QGIS not usable for production work, as there are a large amount of crashes and issues still pending, and i harms QGIS reputation as they would expect a shipped feature to be stable.

Besides, we have a problem with PDAL dependency for LAZ support, as PDAL has been kicked out Debian / Ubuntu packages. Therefore all users relying on official QGIS packages do not have 3D Pointcloud support any longer.

nyalldawson commented 9 months ago

There's no issue with this dataset on Fedora 39. Possibly the upstream bug was fixed in either the Qt 5.15 patch releases or in the KDE bug fix collection which Fedora uses.

ntw-au commented 9 months ago

LHD_FXX_0991_6805_PTS_C_LAMB93_IGN69.copc.laz continues to crash with QGIS 3.34.1 via OSGeo4W on Windows 11.

Python Stack Trace
Windows fatal exception: access violation

Current thread 0x0000d2cc (most recent call first):

Stack Trace

Qt3DCore::QSystemInformationService::tr :
Qt3DCore::QChangeArbiter::distributeQueueChanges :
Qt3DCore::QChangeArbiter::syncChanges :
Qt3DCore::QAspectManager::processFrame :
Qt3DCore::QAspectManager::exitSimulationLoop :
QObject::qt_static_metacall :
QUnifiedTimer::setSlowdownFactor :
QAbstractAnimation::setCurrentTime :
QUnifiedTimer::updateAnimationTimers :
QUnifiedTimer::updateAnimationTimers :
QAnimationDriver::advance :
QObject::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QEventDispatcherWin32Private::sendTimerEvent :
QEventDispatcherWin32::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QCoreApplicationPrivate::sendPostedEvents :
qt_plugin_query_metadata :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info
QGIS Version: 3.34.1-Prizren
QGIS code revision: 133927424d
Compiled against Qt: 5.15.3
Running against Qt: 5.15.3
Compiled against GDAL: 3.8.0
Running against GDAL: 3.8.0

System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.22631
nyalldawson commented 9 months ago

@ntw-au 3.34 windows builds is still using an outdated Qt version -- it wouldn't have any recent upstream fixes.

Nekzuris commented 7 months ago

Will this be updated and fix in 3.35?

nyalldawson commented 7 months ago

@Nekzuris

Will this be updated and fix in 3.35?

@jef-n what's the chance of a qt update to latest 5.15 in osgeo4w?

wonder-sk commented 7 months ago

Here's another COPC file where I can reproduce the crash pretty much every time: https://download-telecharger.services.geo.ca/pub/elevation/pointclouds_nuagespoints/NRCAN/FHIMP_PICAI_TBL_LAssomptio_Kinojevis_Yamaska_MTM10_2022/22_3325338f10_dc.copc.laz

But it seems like I am getting a crash on qt3d view with pretty much any remote COPC now :grimacing: - even those that definitely used to work fine.

Tracking down what exactly causes this is very difficult - obviously the crash somehow depends on the data (with some sources it crashes pretty much all the time, with others sometimes, with others never). But the crash does not depend on some geometries/materials sent to qt3d - it crashes before any data from the point cloud are actually prepared... and even when I commented out nearly everything in qgis 3d code, the crash would be still happening.

It turned out that (at least for me) it is linked to calculation of statistics of point cloud layer (!) ... COPC files that included stats worked fine, while COPC files without stats were crashing (due to the stats calculation when such layer got loaded) - and #52913 seems to be the cause.

I believe we are getting hit by QTBUG-104593 - Qt 3D started to use global thread pool in 5.14 in https://github.com/qt/qt3d/commit/a2b5b5c8f6e09ccfaca8044b34f4d9675c3be14a (see related article) and the bug got fixed in https://github.com/qt/qt3d/commit/c9bb0a3d1ef819033a674c5c05499d18bc898a70 which went into 5.15.11 release (which is maybe why @nyalldawson can't replicate it?). It seems that qt3d's QChangeArbiter in qt5 is quite sensitive to other parts of the app using "its" thread pool, ending up with dangling pointers in thread-local storage.

(By the way, there is QT3D_MAX_THREAD_COUNT env variable (to use given value instead of the ideal count reported by Qt), but playing with its value did not go anywhere.)