Crash while drawing text ?



  • Hi all,
    There is a crash in our embedded linux system. We analysed the core file generated, and here is the output of core file ;

    Program terminated with signal 11, Segmentation fault.
    #0 qt_alphamapblit_quint32 (rasterBuffer=0x1e, x=-16777216, y=<value optimized out>,
    color=3069460152, map=0xb5406000 "", mapWidth=9, mapHeight=<value optimized out>, mapStride=12,
    clip=0x0)
    at qt-everywhere-opensource-src-4.8.6/src/gui/painting/qdrawhelper.cpp:7198

    7198 const int coverage = map[i];

    (gdb) bt
    #0 qt_alphamapblit_quint32 (rasterBuffer=0x1e, x=-16777216, y=<value optimized out>,
    color=3069460152, map=0xb5406000 "", mapWidth=9, mapHeight=<value optimized out>, mapStride=12,
    clip=0x0)
    at qt-everywhere-opensource-src-4.8.6/src/gui/painting/qdrawhelper.cpp:7198
    #1 0xb6123204 in QRasterPaintEngine::alphaPenBlt (this=<value optimized out>, src=0xb613d570,
    bpl=12, depth=164, rx=59, ry=151, w=9, h=13)
    at qt-everywhere-opensource-src-4.8.6/src/gui/painting/qpaintengine_raster.cpp:2605
    #2 0xb623a9ec in QFontEngineQPF::draw (this=0xe50308, p=0x1102228, _x=57, _y=<value optimized out>,
    si=...)
    at qt-everywhere-opensource-src-4.8.6/src/gui/text/qfontengine_qpf.cpp:669
    #3 0xb612dd70 in QRasterPaintEngine::drawTextItem (this=0x1102228, p=..., textItem=...)
    at qt-everywhere-opensource-src-4.8.6/src/gui/painting/qpaintengine_raster.cpp:3133
    #4 0xb60cb718 in QPainter::drawTextItem (this=<value optimized out>, p=..., _ti=...)
    at qt-everywhere-opensource-src-4.8.6/src/gui/painting/qpainter.cpp:6709
    #5 0xb61be58c in drawMenuText (this=<value optimized out>, p=0x0, pos=<value optimized out>,
    selection=<value optimized out>)
    at qt-everywhere-opensource-src-4.8.6/src/gui/text/qtextlayout.cpp:2050
    #6 QTextLine::draw (this=<value optimized out>, p=0x0, pos=<value optimized out>,
    selection=<value optimized out>)
    at qt-everywhere-opensource-src-4.8.6/src/gui/text/qtextlayout.cpp:
    #7 0xb60cea4c in qt_format_text (fnt=..., _r=<value optimized out>, tf=134217745, option=0x0,
    str=..., brect=0x0, tabstops=-1090535288, ta=0x0, tabarraylen=0, painter=0xbeffc0f8)
    at qt-everywhere-opensource-src-4.8.6/src/gui/painting/qpainter.cpp:8283
    #8 0xb60cf3c4 in QPainter::drawText (this=0xbeffc0f8, r=<value optimized out>,
    flags=<value optimized out>, str=..., br=0x0)
    at qt-everywhere-opensource-src-4.8.6/src/gui/painting/qpainter.cpp:6199

    We examined that the painter is NULL in frame 6 while it is not NULL in frame 7 ;

    #6  QTextLine::draw (this=<value optimized out>, p=0x0, pos=<value optimized out>,
        selection=<value optimized out>)
        at qt-everywhere-opensource-src-4.8.6/src/gui/text/qtextlayout.cpp:2425
    2425                drawMenuText(p, iterator.x, itemBaseLine, si, gf, eng, iterator.itemStart, iterator.glyphsStart);
    2429                    QPainterPath path;
    (gdb) p p
    $30 = (QPainter *) 0x0
    
    Frame 7 gdb trace : 
    (gdb) frame 7
    #7  0xb60cea4c in qt_format_text (fnt=..., _r=<value optimized out>, tf=134217745, option=0x0,
        str=..., brect=0x0, tabstops=-1090535288, ta=0x0, tabarraylen=0, painter=0xbeffc0f8)
        at  qt-everywhere-opensource-src-4.8.6/src/gui/painting/qpainter.cpp:8283
    8283                line.draw(painter, QPointF(r.x() + xoff, r.y() + yoff));
    (gdb) p painter
    **$31 = (QPainter *) 0xbeffc0f8**
    
    

    I suppose, there are two possible causes of this corruption, one of them is related to the third party library, Qt ( the version we use is 4.8 ), the other one is related to the our source code. We will be investigating the problem from the point of our source code. Could you please analyse the problem, and give us feedback about the possible reasons ?

    Thanks,


Log in to reply
 

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