Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 893206 - dev-qt/qtsvg-6.4.2: crash when loading svg
Summary: dev-qt/qtsvg-6.4.2: crash when loading svg
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-04 09:27 UTC by Viorel Munteanu
Modified: 2024-01-23 18:02 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge--info.txt,24.83 KB, text/plain)
2023-02-04 09:29 UTC, Viorel Munteanu
Details
the variables before the crash (debug.txt,5.80 KB, text/plain)
2023-02-05 08:11 UTC, Viorel Munteanu
Details
no-force-O2-choose-O0.patch (no-force-O2-choose-O0.patch,1.83 KB, patch)
2023-02-05 17:03 UTC, Sam James
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Viorel Munteanu gentoo-dev 2023-02-04 09:27:07 UTC
This is the shortest way to reproduce I could come up with.  Works with QT5, crashes with QT6.  I also added a backtrace.

Thank you!

viorel@gandalf ~ $ python
Python 3.11.1 (main, Jan 31 2023, 10:45:16) [GCC 12.2.1 20230121] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt5 import QtGui
>>> QtGui.QGuiApplication([])
WARNING: CPU random generator seem to be failing, disabling hardware random number generation
WARNING: RDRND generated: 0xffffffff 0xffffffff 0xffffffff 0xffffffff
<PyQt5.QtGui.QGuiApplication object at 0x7febc24cf910>
>>> QtGui.QPixmap('/usr/lib/python3.11/site-packages/maestral_qt/resources/maestral_tray-idle-light.svg')
<PyQt5.QtGui.QPixmap object at 0x7febc23c9d20>
>>> 
viorel@gandalf ~ $ python
Python 3.11.1 (main, Jan 31 2023, 10:45:16) [GCC 12.2.1 20230121] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt6 import QtGui
WARNING: CPU random generator seem to be failing, disabling hardware random number generation
WARNING: RDRND generated: 0xffffffff 0xffffffff 0xffffffff 0xffffffff
>>> QtGui.QGuiApplication([])
<PyQt6.QtGui.QGuiApplication object at 0x7f2317537760>
>>> QtGui.QPixmap('/usr/lib/python3.11/site-packages/maestral_qt/resources/maestral_tray-idle-light.svg')
Segmentation fault (core dumped)
viorel@gandalf ~ $ gdb /usr/bin/python3.11 core
GNU gdb (Gentoo 12.1 vanilla) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/python3.11...
Reading symbols from /usr/lib/debug//usr/bin/python3.11.debug...

warning: core file may not match specified executable file.
[New LWP 20729]
[New LWP 20756]
[New LWP 20755]
[New LWP 20758]
[New LWP 20759]
[New LWP 20754]
[New LWP 20757]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/usr/lib/python-exec/python3.11/python'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000000000 in ?? ()
[Current thread is 1 (Thread 0x7f2317f44740 (LWP 20729))]
(gdb) bt
#0  0x0000000000000000 in  ()
#1  0x00007f2311b0a19f in QSvgIOHandler::read(QImage*) (image=0x7ffef73a62c0, this=0x5622584d3540)
    at /mnt/tmp/portage/dev-qt/qtsvg-6.4.2/work/qtsvg-everywhere-src-6.4.2/src/plugins/imageformats/svg/qsvgiohandler.cpp:155
#2  QSvgIOHandler::read(QImage*) (this=0x5622584d3540, image=0x7ffef73a62c0) at /mnt/tmp/portage/dev-qt/qtsvg-6.4.2/work/qtsvg-everywhere-src-6.4.2/src/plugins/imageformats/svg/qsvgiohandler.cpp:119
#3  0x00007f23169abf91 in QImageReader::read(QImage*) (this=0x7ffef73a6308, image=0x7ffef73a62c0)
    at /mnt/extratmp/portage/dev-qt/qtbase-6.4.2/work/qtbase-everywhere-src-6.4.2/src/gui/image/qimagereader.cpp:1219
#4  0x00007f23169ac755 in QImageReader::read() (this=this@entry=0x7ffef73a6308) at /mnt/extratmp/portage/dev-qt/qtbase-6.4.2/work/qtbase-everywhere-src-6.4.2/src/gui/image/qimagereader.cpp:1162
#5  0x00007f23169cd43f in QPlatformPixmap::fromFile(QString const&, char const*, QFlags<Qt::ImageConversionFlag>) (this=0x7f2300009800, fileName=<optimized out>, format=<optimized out>, flags=...)
    at /mnt/extratmp/portage/dev-qt/qtbase-6.4.2/work/qtbase-everywhere-src-6.4.2/src/gui/image/qplatformpixmap.cpp:98
#6  0x00007f23169be813 in QPixmap::load(QString const&, char const*, QFlags<Qt::ImageConversionFlag>) (this=this@entry=0x5622584ee320, fileName=..., format=0x0, flags=...)
    at /mnt/extratmp/portage/dev-qt/qtbase-6.4.2/work/qtbase-everywhere-src-6.4.2/src/corelib/tools/qshareddata.h:131
#7  0x00007f23169beb0e in QPixmap::QPixmap(QString const&, char const*, QFlags<Qt::ImageConversionFlag>) (this=this@entry=0x5622584ee320, fileName=<optimized out>, format=<optimized out>, flags=...)
    at /mnt/extratmp/portage/dev-qt/qtbase-6.4.2/work/qtbase-everywhere-src-6.4.2/src/gui/image/qpixmap.cpp:171
#8  0x00007f2317333d99 in sipQPixmap::sipQPixmap(QString const&, char const*, QFlags<Qt::ImageConversionFlag>) (this=0x5622584ee320, a0=<optimized out>, a1=<optimized out>, a2=...) at sipQtGuiQPixmap.cpp:130
#9  0x00007f2317334176 in init_type_QPixmap(sipSimpleWrapper*, PyObject*, PyObject*, PyObject**, PyObject**, PyObject**)
    (sipSelf=0x7f2317431a80, sipArgs=('/usr/lib/python3.11/site-packages/maestral_qt/resources/maestral_tray-idle-light.svg',), sipKwds=0x0, sipUnused=<optimized out>, sipParseErr=0x7ffef73a65e0)
    at sipQtGuiQPixmap.cpp:1583
#10 0x00007f23161e6d34 in sipSimpleWrapper_init (self=0x7f2317431a80, args=('/usr/lib/python3.11/site-packages/maestral_qt/resources/maestral_tray-idle-light.svg',), kwds=0x0) at sip_core.c:8788
#11 0x00007f23183a76d5 in type_call (type=<optimized out>, args=('/usr/lib/python3.11/site-packages/maestral_qt/resources/maestral_tray-idle-light.svg',), kwds=0x0) at Objects/typeobject.c:1112
#12 0x00007f231834b08b in _PyObject_MakeTpCall (tstate=0x7f231873a798 <_PyRuntime+166328>, callable=<PyQt6.sip.wrappertype at remote 0x5622581b79b0>, args=<optimized out>, nargs=1, keywords=0x0)
    at Objects/call.c:214
#13 0x00007f23182f74a6 in _PyEval_EvalFrameDefault (tstate=0x7f231028e010, frame=0x7f2317816020, throwflag=262144) at Python/ceval.c:4772
#14 0x00007f2318424a00 in _PyEval_EvalFrame (throwflag=0, frame=0x7f2317816020, tstate=0x7f231873a798 <_PyRuntime+166328>) at ./Include/internal/pycore_ceval.h:73
#15 _PyEval_Vector
    (tstate=tstate@entry=0x7f231873a798 <_PyRuntime+166328>, func=func@entry=0x7f231771fba0, locals=locals@entry={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <type at remote 0x562257fc7470>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7f23178c4a90>, 'QtGui': <module at remote 0x7f23175ba980>}, args=args@entry=0x0, argcount=argcount@entry=0, kwnames=kwnames@entry=0x0) at Python/ceval.c:6435
#16 0x00007f2318424abd in PyEval_EvalCode
    (co=co@entry=<code at remote 0x7f2317626d30>, globals=globals@entry={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <type at remote 0x562257fc7470>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7f23178c4a90>, 'QtGui': <module at remote 0x7f23175ba980>}, locals=locals@entry={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <type at remote 0x562257fc7470>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7f23178c4a90>, 'QtGui': <module at remote 0x7f23175ba980>}) at Python/ceval.c:1154
#17 0x00007f23184669a3 in run_eval_code_obj
    (tstate=tstate@entry=0x7f231873a798 <_PyRuntime+166328>, co=co@entry=0x7f2317626d30, globals=globals@entry={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <type at remote 0x562257fc7470>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7f23178c4a90>, 'QtGui': <module at remote 0x7f23175ba980>}, locals=locals@entry={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <type at remote 0x562257fc7470>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7f23178c4a90>, 'QtGui': <module at remote 0x7f23175ba980>})
    at Python/pythonrun.c:1714
#18 0x00007f2318466bc6 in run_mod
    (mod=mod@entry=0x5622580fcbd8, filename=filename@entry='<stdin>', globals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <type at remote 0x562257fc7470>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7f23178c4a90>, 'QtGui': <module at remote 0x7f23175ba980>}, locals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <type at remote 0x562257fc7470>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7f23178c4a90>, 'QtGui': <module at remote 0x7f23175ba980>}, flags=flags@entry=0x7ffef73a6aa8, arena=arena@entry=0x7f23178577f0) at Python/pythonrun.c:1735
#19 0x00007f231846871e in PyRun_InteractiveOneObjectEx (fp=fp@entry=0x7f23181eda80 <_IO_2_1_stdin_>, filename=filename@entry='<stdin>', flags=flags@entry=0x7ffef73a6aa8) at Python/pythonrun.c:261
#20 0x00007f23184693f6 in _PyRun_InteractiveLoopObject (fp=fp@entry=0x7f23181eda80 <_IO_2_1_stdin_>, filename=filename@entry='<stdin>', flags=flags@entry=0x7ffef73a6aa8) at Python/pythonrun.c:138
#21 0x00007f2318469d1e in _PyRun_AnyFileObject (fp=fp@entry=0x7f23181eda80 <_IO_2_1_stdin_>, filename=filename@entry='<stdin>', closeit=closeit@entry=0, flags=flags@entry=0x7ffef73a6aa8)
    at Python/pythonrun.c:73
#22 0x00007f2318469dc9 in PyRun_AnyFileExFlags (fp=0x7f23181eda80 <_IO_2_1_stdin_>, filename=filename@entry=0x7f23184fa4b1 "<stdin>", closeit=closeit@entry=0, flags=flags@entry=0x7ffef73a6aa8)
    at Python/pythonrun.c:105
#23 0x00007f2318487a38 in pymain_run_stdin (config=0x7f23187207e0 <_PyRuntime+59904>) at Modules/main.c:509
#24 pymain_run_python (exitcode=0x7ffef73a6aa0) at Modules/main.c:604
#25 Py_RunMain () at Modules/main.c:680
#26 0x00007f2318487dfa in pymain_main (args=0x7ffef73a6bc0) at Modules/main.c:710
#27 Py_BytesMain (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:734
#28 0x00007f231804634a in __libc_start_call_main (main=main@entry=0x5622567de050 <main>, argc=argc@entry=1, argv=argv@entry=0x7ffef73a6d48) at ../sysdeps/nptl/libc_start_call_main.h:58
#29 0x00007f23180463fc in __libc_start_main_impl (main=0x5622567de050 <main>, argc=1, argv=0x7ffef73a6d48, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffef73a6d38)
--Type <RET> for more, q to quit, c to continue without paging--
    at ../csu/libc-start.c:381
#30 0x00005622567de081 in _start ()
(gdb) 
quit
Comment 1 Viorel Munteanu gentoo-dev 2023-02-04 09:29:46 UTC
Created attachment 849858 [details]
emerge --info
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-04 14:44:39 UTC
We're dying at https://github.com/qt/qtsvg/blob/v6.4.2/src/plugins/imageformats/svg/qsvgiohandler.cpp#L155.

Is d null there?
Comment 3 Viorel Munteanu gentoo-dev 2023-02-05 08:11:29 UTC
Created attachment 849880 [details]
the variables before the crash
Comment 4 Viorel Munteanu gentoo-dev 2023-02-05 08:11:47 UTC
No, it crashes inside `void QImage::fill(uint pixel)` from portage/dev-qt/qtbase-6.4.2/work/qtbase-everywhere-src-6.4.2/src/gui/image/qimage.cpp

It seems to crash inside one of the qt_rectfill calls, but I cannot see exactly what happens there because anything I do, something adds -O2 after my -O0.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-05 17:03:06 UTC
Created attachment 849928 [details, diff]
no-force-O2-choose-O0.patch

Cheesy patch to use -O0 attached. Obviously we need to fix this properly so that the Qt optimisation level is prepended to user flags, not appended though. But this is good enough for you to debug for now.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-05 17:05:12 UTC
(In reply to Sam James from comment #5)
> Created attachment 849928 [details, diff] [details, diff]
> no-force-O2-choose-O0.patch
> 
> Cheesy patch to use -O0 attached. Obviously we need to fix this properly so
> that the Qt optimisation level is prepended to user flags, not appended
> though. But this is good enough for you to debug for now.

We probably need to fix qt_internal_set_up_config_optimizations_like_in_qmake in cmake/QtFlagHandlingHelpers.cmake to always prepend.
Comment 7 Ionen Wolkens gentoo-dev 2024-01-23 18:02:02 UTC
(In reply to Sam James from comment #6)
> We probably need to fix
> qt_internal_set_up_config_optimizations_like_in_qmake in
> cmake/QtFlagHandlingHelpers.cmake to always prepend.
To update that was later fixed in bug #911822. Built qtbase earlier with -O0 just fine for the see also bug (which may or may not be related to this if rdrnd being non-functional is going to be doing strange things).