Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-77743

PNG with transparancy used in setWindowIcon will cause FPE



    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 5.12.4
    • 5.12.3
    • GUI: Painting
    • None
    • Linux/X11


      We just upgraded from 5.9.5 to 5.12.3. I have encountered a crash of most of our GUI applications on Linux directly at start. These applications exhibited a floating point exception (FPE). For the record: we have purposely enabled floating point exceptions (specifically FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW) in our applications to catch floating point errors in our signal processing code. In the debugger I could identify that a call of reciprocal_mul_ps() (SSE4 instruction) with a vector containing a 0 (resulting in INF) was the reason of the FPE.


      (Suspended : Signal : SIGFPE:Arithmetic exception) 
       reciprocal_mul_ps() at Qt5.12.3/source/qt/qtbase/src/gui/painting/qdrawhelper_sse4.cpp:101 0x7ffff6580e9f 
       convertARGBFromARGB32PM_sse4<false, false>() at Qt5.12.3/source/qt/qtbase/src/gui/painting/qdrawhelper_sse4.cpp:122 0x7ffff6580e9f 
       storeARGB32FromARGB32PM_sse4() at Qt5.12.3/source/qt/qtbase/src/gui/painting/qdrawhelper_sse4.cpp:297 0x7ffff6580e9f 
       convert_generic() at Qt5.12.3/source/qt/qtbase/src/gui/image/qimage_conversions.cpp:216 0x7ffff662371e 
       QImage::convertToFormat_helper() at Qt5.12.3/source/qt/qtbase/src/gui/image/qimage.cpp:2.087 0x7ffff6617d0f 
       QImage::convertToFormat(QImage::Format, QFlags<Qt::ImageConversionFlag>) && at Qt5.12.3/source/qt/qtbase/include/QtGui/../../src/gui/image/qimage.h:194 0x7ffff2146024 
       QXcbWindow::setWindowIcon() at Qt5.12.3/source/qt/qtbase/src/plugins/platforms/xcb/qxcbwindow.cpp:1.345 0x7ffff2146024 
       QXcbWindow::create() at Qt5.12.3/source/qt/qtbase/src/plugins/platforms/xcb/qxcbwindow.cpp:524 0x7ffff21459fd 
       QXcbIntegration::createPlatformWindow() at Qt5.12.3/source/qt/qtbase/src/plugins/platforms/xcb/qxcbintegration.cpp:267 0x7ffff212a2f4 
       QWindowPrivate::create() at Qt5.12.3/source/qt/qtbase/src/gui/kernel/qwindow.cpp:528 0x7ffff65d036f 
       <...more frames...>


      Other some more investigation I could narrow down the problem to a PNG file containing background transparency which is used as a window icon via QApplication::setWindowIcon() (to be precise the PNG file is embedded as Qt resource).

      When I replace the PNG file with another one without transparency I don't get a FPE.

      In the Qt git repository I found the commit dfa434a9799618eba48a84cbad279262679aa108 which optimized the SSE image conversion routines. This commit was made after Qt 5.9


        1. icon.png
          22 kB
        2. main.cpp
          0.8 kB
        3. QTBUG-77743_setWindowIcon.pro
          0.3 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.



              vgt Eirik Aavitsland
              axelm Axel Müller
              0 Vote for this issue
              2 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes