navrocky / urtconnector

Automatically exported from code.google.com/p/urtconnector
0 stars 0 forks source link

Seg fault in server_info_manager #92

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Запускаем пару слежений (например, 
подключение к занятому серверу, и поиск 
друга). Открываем окно закладок, выделяем 
сервер, который ждем. И ждем.

Через некоторое время выпадает сегфолт.

===============================================================================
bool server_info_manager::eventFilter(QObject* obj, QEvent* e)
{
    LOG_HARD << "event:"<<e->type();
    bool ret = QObject::eventFilter(obj, e);
    if( obj == browser_ && ( e->type() == QEvent::Paint || e->type() == QEvent::Resize ) )
    {
        LOG_HARD << "handling widgets visibility, Paint Event";

        QRect viewport_rect = visible_rect( browser_ );

        //QTextBrowser engine does not updates block thats are hidden away from QAbstractScrollArea visible surface
        //So we mannually hide widget when associated block is not in visible area
        BOOST_FOREACH( const WidgetsByBlock::value_type& p, widgets ) {
            LOG_HARD << "handling widget favorites. Block:%1 Widget: %2", p.first.blockNumber(), p.second.front();

>>>>>>>>>>>> вот здесь, внутри функции blockBoundingRect
            QRect block_rect = browser_->document()->documentLayout()->blockBoundingRect( p.first ).toRect();

>>>>>>>>>>>>>

            LOG_HARD << "block_rect: %1-%2 %3-%4" ,  block_rect.left(), block_rect.top(), block_rect.width(), block_rect.height();
            LOG_HARD << "viewport: %1-%2 %3-%4" ,  viewport_rect.left(), viewport_rect.top(), viewport_rect.width(), viewport_rect.height();
            std::for_each( p.second.begin(), p.second.end(), bind( &QWidget::setVisible, _1, viewport_rect.intersects(block_rect) ) );
            LOG_HARD << "visibility:"<< viewport_rect.intersects(block_rect);
            QRect intersected = viewport_rect.intersected( block_rect );
            LOG_HARD << "intersected: %1-%2 %3-%4" ,  intersected.left(), intersected.top(), intersected.width(), intersected.height();
        }
    }
    return ret;
}
===============================================================================

Стек падения:

QTextLayout::boundingRect(this=0x54) at text/qtextlayout.cpp:858
QTextDocumentLayout::blockBoundingRect(this=0xbfffd640,block=@0x965d568: {p = 
0x85c15e0, n = 64}) at text/qtextdocumentlayout.cpp:3157
server_info_manager::eventFilter(this=0x85b8c00,obj=0x85ba240,e=0xbfffdc38) at 
/home/vlad/prog/urtconnector/src/server_info_manager.cpp:180
QCoreApplicationPrivate::sendThroughObjectEventFilters(this=0x844fc30,receiver=0
x85ba240,event=0xbfffdc38) at kernel/qcoreapplication.cpp:846
QApplicationPrivate::notify_helper(this=0x844fc30,receiver=0x85ba240,e=0xbfffdc3
8) at kernel/qapplication.cpp:4458

Original issue reported on code.google.com by navrocky.vlad on 17 Sep 2011 at 1:05

GoogleCodeExporter commented 9 years ago

Original comment by navrocky.vlad on 16 Jan 2012 at 3:43