Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in QgsPointCloudLayerRenderer when closing while rendering still active #44144

Closed
rouault opened this issue Jul 13, 2021 · 0 comments · Fixed by #45227
Closed

Crash in QgsPointCloudLayerRenderer when closing while rendering still active #44144

rouault opened this issue Jul 13, 2021 · 0 comments · Fixed by #45227
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Point Clouds

Comments

@rouault
Copy link
Contributor

rouault commented Jul 13, 2021

When closing QGIS while it is still rendering the attached .qgs file test_ept.qgs.zip with qgis run under Valgrind, one gets the following crash

==2626485== Invalid read of size 8
==2626485==    at 0xB233347: QgsPointCloudLayerRenderer::renderNodesAsync(QVector<IndexedPointCloudNode> const&, QgsPointCloudIndex*, QgsPointCloudRenderContext&, QgsPointCloudRequest&, bool&) (src/core/pointcloud/qgspointcloudlayerrenderer.cpp:274)
==2626485==    by 0xB2321BC: QgsPointCloudLayerRenderer::render() (src/core/pointcloud/qgspointcloudlayerrenderer.cpp:188)
==2626485==    by 0xAF902E1: QgsMapRendererParallelJob::renderLayerStatic(LayerRenderJob&) (src/core/maprenderer/qgsmaprendererparalleljob.cpp:367)
==2626485==    by 0xAF93B9C: QtConcurrent::FunctionWrapper1<void, LayerRenderJob&>::operator()(LayerRenderJob&) (qtconcurrentfunctionwrappers.h:80)
==2626485==    by 0xAF93444: QtConcurrent::MapKernel<QList<LayerRenderJob>::iterator, QtConcurrent::FunctionWrapper1<void, LayerRenderJob&> >::runIteration(QList<LayerRenderJob>::iterator, int, void*) (qtconcurrentmapkernel.h:68)
==2626485==    by 0xAF934D2: QtConcurrent::MapKernel<QList<LayerRenderJob>::iterator, QtConcurrent::FunctionWrapper1<void, LayerRenderJob&> >::runIterations(QList<LayerRenderJob>::iterator, int, int, void*) (qtconcurrentmapkernel.h:77)
==2626485==    by 0xAF93839: QtConcurrent::IterateKernel<QList<LayerRenderJob>::iterator, void>::forThreadFunction() (qtconcurrentiteratekernel.h:255)
==2626485==    by 0xAF932D6: QtConcurrent::IterateKernel<QList<LayerRenderJob>::iterator, void>::threadFunction() (qtconcurrentiteratekernel.h:217)
==2626485==    by 0x104AFCB4: QtConcurrent::ThreadEngineBase::run() (in /usr/lib/x86_64-linux-gnu/libQt5Concurrent.so.5.12.8)
==2626485==    by 0x15A0FF81: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.12.8)
==2626485==    by 0x15A0C9D1: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.12.8)
==2626485==    by 0x16291608: start_thread (pthread_create.c:477)
==2626485==  Address 0x435a3dc0 is 176 bytes inside a block of size 336 free'd
==2626485==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==2626485==    by 0xB642948: laszip::utils::aligned_free(void*) (external/laz-perf/util.hpp:50)
==2626485==    by 0xB64C6D7: laszip::models::arithmetic::~arithmetic() (external/laz-perf/model.hpp:80)
==2626485==    by 0xB6526E0: laszip::formats::field<laszip::formats::las::point10, laszip::formats::standard_diff_method<laszip::formats::las::point10> >::__common::~__common() (external/laz-perf/detail/field_point10.hpp:405)
==2626485==    by 0xB652FD0: laszip::formats::field<laszip::formats::las::point10, laszip::formats::standard_diff_method<laszip::formats::las::point10> >::~field() (external/laz-perf/detail/field_point10.hpp:150)
==2626485==    by 0xB65FFE4: laszip::formats::dynamic_decompressor_field<laszip::decoders::arithmetic<laszip::io::__ifstream_wrapper<std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> > > >, laszip::formats::field<laszip::formats::las::point10, laszip::formats::standard_diff_method<laszip::formats::las::point10> > >::~dynamic_decompressor_field() (external/laz-perf/formats.hpp:421)
==2626485==    by 0xB66001B: laszip::formats::dynamic_decompressor_field<laszip::decoders::arithmetic<laszip::io::__ifstream_wrapper<std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> > > >, laszip::formats::field<laszip::formats::las::point10, laszip::formats::standard_diff_method<laszip::formats::las::point10> > >::~dynamic_decompressor_field() (external/laz-perf/formats.hpp:421)
==2626485==    by 0xB660AEE: std::_Sp_counted_ptr<laszip::formats::dynamic_decompressor_field<laszip::decoders::arithmetic<laszip::io::__ifstream_wrapper<std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> > > >, laszip::formats::field<laszip::formats::las::point10, laszip::formats::standard_diff_method<laszip::formats::las::point10> > >*, (__gnu_cxx::_Lock_policy)2>::_M_dispose() (shared_ptr_base.h:380)
==2626485==    by 0x4BE16B3: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (shared_ptr_base.h:158)
==2626485==    by 0x4BE15F9: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (shared_ptr_base.h:733)
==2626485==    by 0xB650D6D: std::__shared_ptr<laszip::formats::base_field, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (shared_ptr_base.h:1183)
==2626485==    by 0xB650C77: std::shared_ptr<laszip::formats::base_field>::~shared_ptr() (shared_ptr.h:121)
==2626485==  Block was alloc'd at
==2626485==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==2626485==    by 0xB642822: laszip::utils::aligned_malloc(int) (external/laz-perf/util.hpp:43)
==2626485==    by 0xB64CB62: laszip::models::arithmetic::arithmetic(unsigned int, bool, unsigned int*) (external/laz-perf/model.hpp:55)
==2626485==    by 0xB652131: laszip::formats::field<laszip::formats::las::point10, laszip::formats::standard_diff_method<laszip::formats::las::point10> >::__common::__common() (external/laz-perf/detail/field_point10.hpp:393)
==2626485==    by 0xB651DC2: laszip::formats::field<laszip::formats::las::point10, laszip::formats::standard_diff_method<laszip::formats::las::point10> >::field() (external/laz-perf/detail/field_point10.hpp:153)
==2626485==    by 0xB65FF51: laszip::formats::dynamic_decompressor_field<laszip::decoders::arithmetic<laszip::io::__ifstream_wrapper<std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> > > >, laszip::formats::field<laszip::formats::las::point10, laszip::formats::standard_diff_method<laszip::formats::las::point10> > >::dynamic_decompressor_field(laszip::decoders::arithmetic<laszip::io::__ifstream_wrapper<std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> > > >&) (external/laz-perf/formats.hpp:423)
==2626485==    by 0xB65F726: void laszip::formats::dynamic_field_decompressor<laszip::decoders::arithmetic<laszip::io::__ifstream_wrapper<std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> > > > >::add_field<laszip::formats::las::point10>() (external/laz-perf/formats.hpp:494)
==2626485==    by 0xB65EFEF: std::shared_ptr<laszip::formats::dynamic_decompressor> laszip::factory::build_decompressor<laszip::decoders::arithmetic<laszip::io::__ifstream_wrapper<std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> > > > >(laszip::decoders::arithmetic<laszip::io::__ifstream_wrapper<std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> > > >&, laszip::factory::record_schema const&) (external/laz-perf/factory.hpp:184)
==2626485==    by 0xB65C1D6: laszip::io::reader::basic_file<std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> > >::readPoint(char*) (external/laz-perf/io.hpp:516)
==2626485==    by 0xB645DD8: QgsPointCloudBlock* __decompressLaz<std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&, QgsPointCloudAttributeCollection const&, QgsPointCloudAttributeCollection const&, QgsVector3D const&, QgsVector3D const&) (src/core/pointcloud/qgseptdecoder.cpp:409)
==2626485==    by 0xB641BDD: QgsEptDecoder::decompressLaz(QByteArray const&, QgsPointCloudAttributeCollection const&, QgsPointCloudAttributeCollection const&, QgsVector3D const&, QgsVector3D const&) (src/core/pointcloud/qgseptdecoder.cpp:501)
==2626485==    by 0xB21F284: QgsPointCloudBlockRequest::blockFinishedLoading() (src/core/pointcloud/qgspointcloudblockrequest.cpp:74)
==2626485== 
==2626485== Invalid read of size 8
==2626485==    at 0xB23334A: QgsPointCloudLayerRenderer::renderNodesAsync(QVector<IndexedPointCloudNode> const&, QgsPointCloudIndex*, QgsPointCloudRenderContext&, QgsPointCloudRequest&, bool&) (src/core/pointcloud/qgspointcloudlayerrenderer.cpp:274)
==2626485==    by 0xB2321BC: QgsPointCloudLayerRenderer::render() (src/core/pointcloud/qgspointcloudlayerrenderer.cpp:188)
==2626485==    by 0xAF902E1: QgsMapRendererParallelJob::renderLayerStatic(LayerRenderJob&) (src/core/maprenderer/qgsmaprendererparalleljob.cpp:367)
==2626485==    by 0xAF93B9C: QtConcurrent::FunctionWrapper1<void, LayerRenderJob&>::operator()(LayerRenderJob&) (qtconcurrentfunctionwrappers.h:80)
==2626485==    by 0xAF93444: QtConcurrent::MapKernel<QList<LayerRenderJob>::iterator, QtConcurrent::FunctionWrapper1<void, LayerRenderJob&> >::runIteration(QList<LayerRenderJob>::iterator, int, void*) (qtconcurrentmapkernel.h:68)
==2626485==    by 0xAF934D2: QtConcurrent::MapKernel<QList<LayerRenderJob>::iterator, QtConcurrent::FunctionWrapper1<void, LayerRenderJob&> >::runIterations(QList<LayerRenderJob>::iterator, int, int, void*) (qtconcurrentmapkernel.h:77)
==2626485==    by 0xAF93839: QtConcurrent::IterateKernel<QList<LayerRenderJob>::iterator, void>::forThreadFunction() (qtconcurrentiteratekernel.h:255)
==2626485==    by 0xAF932D6: QtConcurrent::IterateKernel<QList<LayerRenderJob>::iterator, void>::threadFunction() (qtconcurrentiteratekernel.h:217)
==2626485==    by 0x104AFCB4: QtConcurrent::ThreadEngineBase::run() (in /usr/lib/x86_64-linux-gnu/libQt5Concurrent.so.5.12.8)
==2626485==    by 0x15A0FF81: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.12.8)
==2626485==    by 0x15A0C9D1: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.12.8)
==2626485==    by 0x16291608: start_thread (pthread_create.c:477)
==2626485==  Address 0x830000013f is not stack'd, malloc'd or (recently) free'd
==2626485== 
QGIS died on signal 11[New LWP 2626513]
Version de QGIS 3.21.0-Master Révision du code db74bf5
Qt version 5.12.8
Python version 3.8.10
Compilé avec GDAL/OGR 3.4.0dev-21732a1f27 Utilisé avec GDAL/OGR 3.4.0dev-5da4752475-dirty
PROJ version 8.1.0
EPSG Registry database version v10.027 (2021-06-17)
Compilé avec GEOS 3.8.0-CAPI-1.13.1 Utilisé avec GEOS 3.10.0dev-CAPI-1.15.0
SQLite version 3.31.1
PDAL version 2.0.1
PostgreSQL client version 12.7 (Ubuntu 12.7-0ubuntu0.20.04.1)
SpatiaLite version 5.0.1
QWT version 6.1.4
QScintilla2 version 2.11.2
OS version Ubuntu 20.04.2 LTS
@rouault rouault added Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Point Clouds labels Jul 13, 2021
rouault added a commit to rouault/QGIS that referenced this issue Sep 23, 2021
…t, to avoid rendering jobs to access deleted objects (fixes qgis#44144)
@rouault rouault self-assigned this Sep 23, 2021
rouault added a commit to rouault/QGIS that referenced this issue Sep 23, 2021
…t, to avoid rendering jobs to access deleted objects (fixes qgis#44144)
nyalldawson pushed a commit that referenced this issue Sep 24, 2021
…t, to avoid rendering jobs to access deleted objects (fixes #44144)
rouault added a commit to rouault/QGIS that referenced this issue Sep 24, 2021
…t, to avoid rendering jobs to access deleted objects (fixes qgis#44144)
nyalldawson pushed a commit that referenced this issue Sep 24, 2021
…t, to avoid rendering jobs to access deleted objects (fixes #44144)
espinafre pushed a commit to espinafre/QGIS that referenced this issue Sep 29, 2021
…t, to avoid rendering jobs to access deleted objects (fixes qgis#44144)
nyalldawson pushed a commit that referenced this issue Nov 1, 2021
…t, to avoid rendering jobs to access deleted objects (fixes #44144)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Point Clouds
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant