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

cresh on QgsTextDocumentMetrics::calculateMetrics for save 3d layout #60256

Open
2 tasks done
yz271544 opened this issue Jan 24, 2025 · 0 comments · May be fixed by #60258
Open
2 tasks done

cresh on QgsTextDocumentMetrics::calculateMetrics for save 3d layout #60256

yz271544 opened this issue Jan 24, 2025 · 0 comments · May be fixed by #60258
Labels
3D Relates to QGIS' 3D engine or rendering Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks

Comments

@yz271544
Copy link

What is the bug or the crash?

crash:

src/3d/qgsgltf3dutils.cpp:537 : (gltfToEntity) [6ms] [thread:0x555556814e80] Warnings raised reading http://47.94.145.6/map/realistic3d/1847168269595754497-jkg/BlockBXXA/BlockBXXA_L14_2.b3dm: BIN Chunk end is not aligned to a 4-byte boundary.

src/3d/qgsgltf3dutils.cpp:537 : (gltfToEntity) [176ms] [thread:0x5555559024f0] Warnings raised reading http://47.94.145.6/map/realistic3d/1847168269595754497-jkg/BlockYAXY/BlockYAXY_L14_1.b3dm: BIN Chunk end is not aligned to a 4-byte boundary.

ASSERT: "!isEmpty()" in file /usr/include/x86_64-linux-gnu/qt5/QtCore/qvector.h, line 245

Thread 1 "qgis_demo3d1" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140736897903104) at ./nptl/pthread_kill.c:44
44      ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140736897903104) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140736897903104) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140736897903104, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007fffef944476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007fffef92a7f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007fffefef0ba3 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fffefeefff0 in qt_assert_x(char const*, char const*, char const*, int) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007ffff4a273e3 in QVector<double>::last() (this=0x7fffffffbe90) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qvector.h:245
#8  0x00007ffff536c3a7 in QgsTextDocumentMetrics::finalizeBlock(QgsTextDocumentMetrics&, QgsTextFormat const&, DocumentMetrics&, QgsTextBlock&, BlockMetrics&)
    (res=..., documentMetrics=..., outputBlock=..., metrics=...) at /lyndon/iProject/cpath/QGIS/src/core/textrenderer/qgstextdocumentmetrics.cpp:188
#9  0x00007ffff536fd60 in QgsTextDocumentMetrics::calculateMetrics(QgsTextDocument const&, QgsTextFormat const&, QgsRenderContext const&, double, QgsTextDocumentRenderContext const&)
    (document=..., format=..., context=..., scaleFactor=4.8000000011999999, documentContext=...) at /lyndon/iProject/cpath/QGIS/src/core/textrenderer/qgstextdocumentmetrics.cpp:678
#10 0x00007ffff5387b7b in QgsTextRenderer::drawText(QRectF const&, double, Qgis::TextHorizontalAlignment, QStringList const&, QgsRenderContext&, QgsTextFormat const&, bool, Qgis::TextVerticalAlignment, QFlags<Qgis::TextRendererFlag>, Qgis::TextLayoutMode)
    (rect=..., rotation=0, alignment=Qgis::TextHorizontalAlignment::Left, text=..., context=..., _format=..., vAlignment=Qgis::TextVerticalAlignment::VerticalCenter, flags=..., mode=Qgis::TextLayoutMode::Rectangle) at /lyndon/iProject/cpath/QGIS/src/core/textrenderer/qgstextrenderer.cpp:90
#11 0x00007ffff59a41ab in QgsLayoutItemLabel::draw(QgsLayoutItemRenderContext&) (this=0x555556b15d40, context=...)
    at /lyndon/iProject/cpath/QGIS/src/core/layout/qgslayoutitemlabel.cpp:144
#12 0x00007ffff59769e4 in QgsLayoutItem::paint(QPainter*, QStyleOptionGraphicsItem const*, QWidget*) (this=0x555556b15d40, painter=0x7fffffffcf48, itemStyle=0x5555564bc588)
    at /lyndon/iProject/cpath/QGIS/src/core/layout/qgslayoutitem.cpp:415
#13 0x00007ffff0f557b3 in  () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#14 0x00007ffff0f56773 in  () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007ffff0f570b7 in QGraphicsScene::drawItems(QPainter*, int, QGraphicsItem**, QStyleOptionGraphicsItem const*, QWidget*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#16 0x00007ffff0f43b47 in QGraphicsScene::render(QPainter*, QRectF const&, QRectF const&, Qt::AspectRatioMode) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#17 0x00007ffff594b772 in QgsLayoutExporter::renderRegion(QPainter*, QRectF const&) const (this=0x7fffffffd4d0, painter=0x7fffffffcf48, region=...)
    at /lyndon/iProject/cpath/QGIS/src/core/layout/qgslayoutexporter.cpp:285
#18 0x00007ffff594bbfe in QgsLayoutExporter::renderRegionToImage(QRectF const&, QSize, double) const (this=0x7fffffffd4d0, region=..., imageSize=..., dpi=300)
    at /lyndon/iProject/cpath/QGIS/src/core/layout/qgslayoutexporter.cpp:326
#19 0x00007ffff594b4c1 in QgsLayoutExporter::renderPageToImage(int, QSize, double) const (this=0x7fffffffd4d0, page=0, imageSize=..., dpi=300)
    at /lyndon/iProject/cpath/QGIS/src/core/layout/qgslayoutexporter.cpp:231
#20 0x00007ffff595ae03 in QgsLayoutExporter::createImage(QgsLayoutExporter::ImageExportSettings const&, int, QRectF&, bool&) const
    (this=0x7fffffffd4d0, settings=..., page=0, bounds=..., skipPage=@0x7fffffffd1d7: false) at /lyndon/iProject/cpath/QGIS/src/core/layout/qgslayoutexporter.cpp:2175
#21 0x00007ffff594c325 in QgsLayoutExporter::exportToImage(QString const&, QgsLayoutExporter::ImageExportSettings const&) (this=0x7fffffffd4d0, filePath=..., s=...)
    at /lyndon/iProject/cpath/QGIS/src/core/layout/qgslayoutexporter.cpp:446
#22 0x00005555555be6ee in JwLayout3D::exportLayoutToImage(QString const&) (this=0x555556809370, outputFilePath=...)
    at /lyndon/iProject/cpath/qgis_demo1/core/qgis/layout/JwLayout3D.cpp:931
#23 0x000055555557992f in main(int, char**) (argc=1, argv=0x7fffffffded8) at /lyndon/iProject/cpath/qgis_demo1/main3d1.cpp:456
(gdb)

Steps to reproduce the issue

I'm using qgis to print a viewport to a picture in 2D and 3D, but i found this bug.

The following address is my test case
qgis_demo1

Versions

QGIS version
3.41.0-Master
QGIS code revision
2d70b7a

Libraries
Qt version
5.15.3
Python version
3.10.12
GDAL/OGR version
3.4.1
PROJ version
8.2.1
EPSG Registry database version
v10.041 (2021-12-03)
GEOS version
3.10.2-CAPI-1.16.0
SQLite version
3.37.2
PDAL version
2.3.0
PostgreSQL client version
14.15 (Ubuntu 14.15-0ubuntu0.22.04.1)
SpatiaLite version
5.0.1
QWT version
6.1.4
QScintilla2 version
2.11.6
OS version
Ubuntu 22.04.1 LTS
This copy of QGIS writes debugging output.

Active Python plugins
db_manager
0.1.20
grassprovider
2.12.99
MetaSearch
0.3.6
processing
2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

@yz271544 yz271544 added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jan 24, 2025
@yz271544 yz271544 linked a pull request Jan 24, 2025 that will close this issue
@agiudiceandrea agiudiceandrea added Crash/Data Corruption 3D Relates to QGIS' 3D engine or rendering Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks labels Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3D Relates to QGIS' 3D engine or rendering Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants