Qt crash in QRasterPaintEngine::alphaPenBlt() while painting label text

  • In our embedded Qt application, Qt is crashing with a segmentation fault in function QRasterPaintEngine::alphaPenBlt() while it's painting a label text and it generates core file too. Always I get the following call stack from the core files.

    #0 0x4074e234 in QRasterPaintEngine::alphaPenBlt(void const*, int, int, int, int, int, int) ()
    from /home/local/.../armv6jel-wrlinux_3_0/arm-wrs-linux-gnueabi/sysroot/lib/libQtGui.so.4
    #1 0x4088eeb0 in QFontEngineQPF::draw(QPaintEngine*, float, float, QTextItemInt const&) ()
    from /home/local/.../armv6jel-wrlinux_3_0/arm-wrs-linux-gnueabi/sysroot/lib/libQtGui.so.4
    #2 0x4088eeb0 in QFontEngineQPF::draw(QPaintEngine*, float, float, QTextItemInt const&) ()
    from /home/local/.../armv6jel-wrlinux_3_0/arm-wrs-linux-gnueabi/sysroot/lib/libQtGui.so.4
    Backtrace stopped: previous frame identical to this frame (corrupt stack?)

    After doing a quick Google search I found this reported Qt-Bug : https://bugreports.qt.io/browse/QTBUG-41355 which has not been attended yet. But applying the suggested fix as per this bug report, ie changing "glyphPos > glyphDataSize" to "glyphPos >= glyphDataSize" in qt-everywhere-opensource-src-4.7.4/src/gui/text/qfontengine_qpf.cpp findGlyph() function I'm not observing the crash.

    I'm not aware of Qt source code. Please let me know, if I should go ahead with the fix proposed by the reporter.

  • Lifetime Qt Champion


    If it works correctly and doesn't have other side effects, then go on.

  • Thank you SGaist.

    Even I was thinking of go-ahead with the code changes, but worried that, even after more than a year, no one from Qt support actually attended the bug raised here https://bugreports.qt.io/browse/QTBUG-41355. Neither they have verified the bug nor made any progress on it, not even a comment !!!

    Can you please tell me, Is it a expected norm of Qt bug reporting system ?

  • Lifetime Qt Champion

    No it's not, but you also have to understand that the Qt Company only has so much man power so they have to prioritize bugs. I know this means that sometimes certain bugs will take longer to get fixed. Note that since the project is OpenSource, you can also contribute fixes that will benefit everyone of the Qt Community.

    You should also be aware that Qt 4.7.4 is quite outdated. The latest release of the Qt 4 series is 4.8.7.

    Last thing to know is that 4.8.7 is the last release of the Qt 4 series unless there's a need for a security fix.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.