[Lazarus] Qt4 crash in CudaText

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Qt4 crash in CudaText

Free Pascal - Lazarus mailing list
I just tested CudaText Linux x64 qt4 build: it now crashes on showing
Command Palette dialog. Crash inside ATListbox.pas in Paint handler, in
some Qt painting code. (I tried to change ATListbox.DoubleBuffered, no
help.)

--
Regards,
Alexey

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Qt4 crash in CudaText

Free Pascal - Lazarus mailing list
On 09/27/2019 03:46 PM, AlexeyT via lazarus wrote:
> I just tested CudaText Linux x64 qt4 build: it now crashes on showing
> Command Palette dialog. Crash inside ATListbox.pas in Paint handler, in
> some Qt painting code. (I tried to change ATListbox.DoubleBuffered, no
> help.)

Please send gdb stacktrace.

zeljko
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Qt4 crash in CudaText

Free Pascal - Lazarus mailing list
Stack trace.

#0 QTransform::type() const at :0

#1 ?? at :0
#2 QPainter::drawImage(QRectF const&, QImage const&, QRectF const&,
QFlags<Qt::ImageConversionFlag>) at :0
#3 QPainter_drawImage2 at :0
#4 DRAWIMAGE(0x7fffdd6aad80, 0x7fffffffb2e4, 0x18bd8a0, 0x7fffffffb2f4,
0x0, 0x7fffffffb2d4, 0) at qt/qtobjects.pas:3568
#5 STRETCHMASKBLT(0x7fffef808d30, 140736908144000, 0, 0, 438, 256,
140736908144384, 0, 0, 438, 256, 0, 0, 0, 13369376) at qt/qtwinapi.inc:6990
#6 STRETCHBLT(0x7fffef808d30, 140736908144000, 0, 0, 438, 256,
140736908144384, 0, 0, 438, 256, 13369376) at qt/qtwinapi.inc:6787
#7 STRETCHBLT(140736908144000, 0, 0, 438, 256, 140736908144384, 0, 0,
438, 256, 13369376) at include/winapi.inc:1025
#8 COPYRECT(0x7fffd6997ae0, {LEFT = 0, TOP = 0, RIGHT = 438, BOTTOM =
256, TOPLEFT = {X = 0, Y = 0}, BOTTOMRIGHT = {X = 438, Y = 256}, VECTOR
= {0, 0, 438, 256}}, 0x7fffd6997f00, {LEFT = 0, TOP = 0, RIGHT = 438,
BOTTOM = 256, TOPLEFT = {X = 0, Y = 0}, BOTTOMRIGHT = {X = 438, Y =
256}, VECTOR = {0, 0, 438, 256}}) at include/canvas.inc:122
#9 PAINT(0x7fffd6eae8f0) at atlistbox.pas:541
#10 PAINTWINDOW(0x7fffd6eae8f0, 140736908144000) at
include/customcontrol.inc:118
#11 PAINTHANDLER(0x7fffd6eae8f0, {MSG = 15, UNUSEDMSG = 0, DC =
140736908144000, PAINTSTRUCT = 0x7fffd6cf69c0, RESULT = 0}) at
include/wincontrol.inc:4856
#12 WMPAINT(0x7fffd6eae8f0, {MSG = 15, UNUSEDMSG = 0, DC =
140736908144000, PAINTSTRUCT = 0x7fffd6cf69c0, RESULT = 0}) at
include/wincontrol.inc:6828
#13 WMPAINT(0x7fffd6eae8f0, {MSG = 15, UNUSEDMSG = 0, DC =
140736908144000, PAINTSTRUCT = 0x7fffd6cf69c0, RESULT = 0}) at
include/customcontrol.inc:98
#14 SYSTEM$_$TOBJECT_$__$$_DISPATCH$formal at :0
#15 ?? at :0
#16 ?? at :0
#17 ?? at :0
#18 ?? at :0
#19 .Ld255 at :0
#20 ?? at :0
#21 ?? at :0
#22 ?? at :0
#23 ?? at :0
#24 ?? at :0


Alex

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Qt4 crash in CudaText

Free Pascal - Lazarus mailing list
On 09/27/2019 06:57 PM, AlexeyT via lazarus wrote:
> Stack trace.
>
> #0 QTransform::type() const at :0
>
> #1 ?? at :0
> #2 QPainter::drawImage(QRectF const&, QImage const&, QRectF const&,
> QFlags<Qt::ImageConversionFlag>) at :0

This is crash in Qt library.

> #3 QPainter_drawImage2 at :0
> #4 DRAWIMAGE(0x7fffdd6aad80, 0x7fffffffb2e4, 0x18bd8a0, 0x7fffffffb2f4,
> 0x0, 0x7fffffffb2d4, 0) at qt/qtobjects.pas:3568

At line 3568 we are trying to draw image which is converted from
QImageFormat_RGB32 format to QImageFormat_ARGB32.
That conversion is needed to fix few issues we had in past with various
qt versions on linux and windows. See issues #11713 and #25590 for
details. Quick check if that works is to change line (above line 3568 in
qtobjects.pas)

     if (not EqualRect(LocalRect, sourceRect^) or (Mask = nil)) and
       (QImage_format(Image) = QImageFormat_RGB32) then
      ...
     to
     if (not EqualRect(LocalRect, sourceRect^) then
      ....

and give feedback. As I can see from stack trace your LocalRect and
SourceRect are equal , so it will not convert your image to
QImageFormat_ARGB32 , but it will directly draw it in line 3611
(qtobjects.pas).

Just change that, rebuild your project and test.


zeljko





> #5 STRETCHMASKBLT(0x7fffef808d30, 140736908144000, 0, 0, 438, 256,
> 140736908144384, 0, 0, 438, 256, 0, 0, 0, 13369376) at qt/qtwinapi.inc:6990
> #6 STRETCHBLT(0x7fffef808d30, 140736908144000, 0, 0, 438, 256,
> 140736908144384, 0, 0, 438, 256, 13369376) at qt/qtwinapi.inc:6787
> #7 STRETCHBLT(140736908144000, 0, 0, 438, 256, 140736908144384, 0, 0,
> 438, 256, 13369376) at include/winapi.inc:1025
> #8 COPYRECT(0x7fffd6997ae0, {LEFT = 0, TOP = 0, RIGHT = 438, BOTTOM =
> 256, TOPLEFT = {X = 0, Y = 0}, BOTTOMRIGHT = {X = 438, Y = 256}, VECTOR
> = {0, 0, 438, 256}}, 0x7fffd6997f00, {LEFT = 0, TOP = 0, RIGHT = 438,
> BOTTOM = 256, TOPLEFT = {X = 0, Y = 0}, BOTTOMRIGHT = {X = 438, Y =
> 256}, VECTOR = {0, 0, 438, 256}}) at include/canvas.inc:122
> #9 PAINT(0x7fffd6eae8f0) at atlistbox.pas:541
> #10 PAINTWINDOW(0x7fffd6eae8f0, 140736908144000) at
> include/customcontrol.inc:118
> #11 PAINTHANDLER(0x7fffd6eae8f0, {MSG = 15, UNUSEDMSG = 0, DC =
> 140736908144000, PAINTSTRUCT = 0x7fffd6cf69c0, RESULT = 0}) at
> include/wincontrol.inc:4856
> #12 WMPAINT(0x7fffd6eae8f0, {MSG = 15, UNUSEDMSG = 0, DC =
> 140736908144000, PAINTSTRUCT = 0x7fffd6cf69c0, RESULT = 0}) at
> include/wincontrol.inc:6828
> #13 WMPAINT(0x7fffd6eae8f0, {MSG = 15, UNUSEDMSG = 0, DC =
> 140736908144000, PAINTSTRUCT = 0x7fffd6cf69c0, RESULT = 0}) at
> include/customcontrol.inc:98
> #14 SYSTEM$_$TOBJECT_$__$$_DISPATCH$formal at :0
> #15 ?? at :0
> #16 ?? at :0
> #17 ?? at :0
> #18 ?? at :0
> #19 .Ld255 at :0
> #20 ?? at :0
> #21 ?? at :0
> #22 ?? at :0
> #23 ?? at :0
> #24 ?? at :0
>
>
> Alex
>

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Qt4 crash in CudaText

Free Pascal - Lazarus mailing list
 >>    if (not EqualRect(LocalRect, sourceRect^) then

Changed this; still crash. call stack is similar:

#0 QTransform::type() const at :0
#1 ?? at :0
#2 QPainter::drawImage(QRectF const&, QImage const&, QRectF const&,
QFlags<Qt::ImageConversionFlag>) at :0
#3 QPainter_drawImage2 at :0
#4 DRAWIMAGE(0x7fffdd6aad80, 0x7fffffffb2f4, 0x184edd0, 0x7fffffffb304,
0x0, 0x7fffffffb2e4, 0) at qt/qtobjects.pas:3612
#5 STRETCHMASKBLT(0x7fffef808d30, 140736908144000, 0, 0, 438, 256,
140736908144384, 0, 0, 438, 256, 0, 0, 0, 13369376) at qt/qtwinapi.inc:6990
#6 STRETCHBLT(0x7fffef808d30, 140736908144000, 0, 0, 438, 256,
140736908144384, 0, 0, 438, 256, 13369376) at qt/qtwinapi.inc:6787
#7 STRETCHBLT(140736908144000, 0, 0, 438, 256, 140736908144384, 0, 0,
438, 256, 13369376) at include/winapi.inc:1025
#8 COPYRECT(0x7fffd6997ae0, {LEFT = 0, TOP = 0, RIGHT = 438, BOTTOM =
256, TOPLEFT = {X = 0, Y = 0}, BOTTOMRIGHT = {X = 438, Y = 256}, VECTOR
= {0, 0, 438, 256}}, 0x7fffd6997f00, {LEFT = 0, TOP = 0, RIGHT = 438,
BOTTOM = 256, TOPLEFT = {X = 0, Y = 0}, BOTTOMRIGHT = {X = 438, Y =
256}, VECTOR = {0, 0, 438, 256}}) at include/canvas.inc:122
#9 PAINT(0x7fffd6eae8f0) at atlistbox.pas:541

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Qt4 crash in CudaText

Free Pascal - Lazarus mailing list
On 09/27/2019 07:40 PM, AlexeyT wrote:
>  >>    if (not EqualRect(LocalRect, sourceRect^) then
>
> Changed this; still crash. call stack is similar:

In that case it looks like a bug in Qt library (QPainter::drawImage is
called after our libQt4Pas inside Qt lib). What is your qt4 library
version ?

>
> #0 QTransform::type() const at :0
> #1 ?? at :0
> #2 QPainter::drawImage(QRectF const&, QImage const&, QRectF const&,
> QFlags<Qt::ImageConversionFlag>) at :0
> #3 QPainter_drawImage2 at :0
> #4 DRAWIMAGE(0x7fffdd6aad80, 0x7fffffffb2f4, 0x184edd0, 0x7fffffffb304,
> 0x0, 0x7fffffffb2e4, 0) at qt/qtobjects.pas:3612
> #5 STRETCHMASKBLT(0x7fffef808d30, 140736908144000, 0, 0, 438, 256,
> 140736908144384, 0, 0, 438, 256, 0, 0, 0, 13369376) at qt/qtwinapi.inc:6990
> #6 STRETCHBLT(0x7fffef808d30, 140736908144000, 0, 0, 438, 256,
> 140736908144384, 0, 0, 438, 256, 13369376) at qt/qtwinapi.inc:6787
> #7 STRETCHBLT(140736908144000, 0, 0, 438, 256, 140736908144384, 0, 0,
> 438, 256, 13369376) at include/winapi.inc:1025
> #8 COPYRECT(0x7fffd6997ae0, {LEFT = 0, TOP = 0, RIGHT = 438, BOTTOM =
> 256, TOPLEFT = {X = 0, Y = 0}, BOTTOMRIGHT = {X = 438, Y = 256}, VECTOR
> = {0, 0, 438, 256}}, 0x7fffd6997f00, {LEFT = 0, TOP = 0, RIGHT = 438,
> BOTTOM = 256, TOPLEFT = {X = 0, Y = 0}, BOTTOMRIGHT = {X = 438, Y =
> 256}, VECTOR = {0, 0, 438, 256}}) at include/canvas.inc:122
> #9 PAINT(0x7fffd6eae8f0) at atlistbox.pas:541
>
>

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Qt4 crash in CudaText

Free Pascal - Lazarus mailing list
Qt4 version.

user@PC:~$ dpkg-query -s qtchooser

Package: qtchooser
Status: install ok installed
Priority: optional
Section: libdevel
Installed-Size: 127
Maintainer: Ubuntu Developers <[hidden email]>
Architecture: amd64
Multi-Arch: foreign
Version: 66-1
Replaces: libqt5core5a (<< 5.5.1+dfsg-17~), libqtcore4 (<<
4:4.8.7+dfsg-7~), qtchooser-bin (<< 64-ga1b6736-2~)
Depends: libc6 (>= 2.14), libgcc1 (>= 1:3.0), libstdc++6 (>= 5.2)
Breaks: libqt5core5a (<< 5.5.1+dfsg-17~), libqtcore4 (<<
4:4.8.7+dfsg-7~), qtbase5-dev-tools (<< 5.9.2+dfsg-3~), qtchooser-bin
(<< 64-ga1b6736-2~), qttools5-dev-tools (<< 5.9.2-2~)

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Qt4 crash in CudaText

Free Pascal - Lazarus mailing list
On 09/28/2019 09:54 AM, AlexeyT wrote:
> Qt4 version.

Ok, as I can see it's 4.8.7, so last Qt4 release and it's ok.
Please open an issue about it, in this case I must install your
components and see what's going on inside your atlistbox.pas , and what
kind of image is that.

zeljko
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus