LINUX.ORG.RU

посоветуйте как ловить редкие топтания по памяти


0

0

в часности наблюдаются топтания по сегменту данных и по стеку.

Код не мой.

кстати не подскажите чем можно сделатьревизию кода на тему подозрительных мест?

приложение написано на Qt4.2

★★★★★

Re: посоветуйте как ловить редкие топтания по памяти

Что такое "топтание"?

mv ★★★★★ ()

Re: посоветуйте как ловить редкие топтания по памяти

==3973== Conditional jump or move depends on uninitialised value(s)
==3973==    at 0x45281D3: miUnionO(QRegionPrivate&, QRect const*, QRect const*, QRect const*, QRect const*, int, int) (qregion_unix.cpp:846)
==3973==    by 0x4526A0C: miRegionOp(QRegionPrivate&, QRegionPrivate const*, QRegionPrivate const*, void (*)(QRegionPrivate&, QRect const*, Q
==3973==    by 0x4526F44: UnionRegion(QRegionPrivate const*, QRegionPrivate const*, QRegionPrivate&) (qregion_unix.cpp:902)
==3973==    by 0x45290B1: QRegion::unite(QRegion const&) const (qregion_unix.cpp:2441)
==3973==    by 0x44F5D5F: QRegion::united(QRegion const&) const (qregion.h:80)
==3973==    by 0x44F4B01: QRegion::operator+(QRegion const&) const (qregion.cpp:393)
==3973==    by 0x44F4B3B: QRegion::operator+=(QRegion const&) (qregion.cpp:440)
==3973==    by 0x452B96B: QWidgetBackingStore::dirtyRegion(QRegion const&, QWidget*) (qbackingstore.cpp:498)
==3973==    by 0x452BB63: QWidget::update(QRegion const&) (qbackingstore.cpp:894)
==3973==    by 0x452BBD6: QWidget::update(QRect const&) (qbackingstore.cpp:878)
==3973==    by 0x4820132: QAbstractItemView::dataChanged(QModelIndex const&, QModelIndex const&) (qabstractitemview.cpp:2524)
==3973==    by 0x4826ABE: QAbstractItemView::qt_metacall(QMetaObject::Call, int, void**) (moc_qabstractitemview.cpp:197)
==3973==
==3973== Conditional jump or move depends on uninitialised value(s)
==3973==    at 0x4528208: miUnionO(QRegionPrivate&, QRect const*, QRect const*, QRect const*, QRect const*, int, int) (qregion_unix.cpp:846)
==3973==    by 0x4526A0C: miRegionOp(QRegionPrivate&, QRegionPrivate const*, QRegionPrivate const*, void (*)(QRegionPrivate&, QRect const*, Q
==3973==    by 0x4526F44: UnionRegion(QRegionPrivate const*, QRegionPrivate const*, QRegionPrivate&) (qregion_unix.cpp:902)
==3973==    by 0x45290B1: QRegion::unite(QRegion const&) const (qregion_unix.cpp:2441)
==3973==    by 0x44F5D5F: QRegion::united(QRegion const&) const (qregion.h:80)
==3973==    by 0x44F4B01: QRegion::operator+(QRegion const&) const (qregion.cpp:393)
==3973==    by 0x44F4B3B: QRegion::operator+=(QRegion const&) (qregion.cpp:440)
==3973==    by 0x452B96B: QWidgetBackingStore::dirtyRegion(QRegion const&, QWidget*) (qbackingstore.cpp:498)
==3973==    by 0x452BB63: QWidget::update(QRegion const&) (qbackingstore.cpp:894)
==3973==    by 0x452BBD6: QWidget::update(QRect const&) (qbackingstore.cpp:878)
==3973==    by 0x4820132: QAbstractItemView::dataChanged(QModelIndex const&, QModelIndex const&) (qabstractitemview.cpp:2524)
==3973==    by 0x4826ABE: QAbstractItemView::qt_metacall(QMetaObject::Call, int, void**) (moc_qabstractitemview.cpp:197)
==3973==
==3973== Conditional jump or move depends on uninitialised value(s)
==3973==    at 0x452839B: miUnionO(QRegionPrivate&, QRect const*, QRect const*, QRect const*, QRect const*, int, int) (qregion_unix.cpp:852)
==3973==    by 0x4526A0C: miRegionOp(QRegionPrivate&, QRegionPrivate const*, QRegionPrivate const*, void (*)(QRegionPrivate&, QRect const*, Q
==3973==    by 0x4526F44: UnionRegion(QRegionPrivate const*, QRegionPrivate const*, QRegionPrivate&) (qregion_unix.cpp:902)
==3973==    by 0x45290B1: QRegion::unite(QRegion const&) const (qregion_unix.cpp:2441)
==3973==    by 0x44F5D5F: QRegion::united(QRegion const&) const (qregion.h:80)
==3973==    by 0x44F4B01: QRegion::operator+(QRegion const&) const (qregion.cpp:393)
==3973==    by 0x44F4B3B: QRegion::operator+=(QRegion const&) (qregion.cpp:440)
==3973==    by 0x452B96B: QWidgetBackingStore::dirtyRegion(QRegion const&, QWidget*) (qbackingstore.cpp:498)
==3973==    by 0x452BB63: QWidget::update(QRegion const&) (qbackingstore.cpp:894)
==3973==    by 0x452BBD6: QWidget::update(QRect const&) (qbackingstore.cpp:878)
==3973==    by 0x4820132: QAbstractItemView::dataChanged(QModelIndex const&, QModelIndex const&) (qabstractitemview.cpp:2524)
==3973==    by 0x4826ABE: QAbstractItemView::qt_metacall(QMetaObject::Call, int, void**) (moc_qabstractitemview.cpp:197)
==3973==
==3973== Conditional jump or move depends on uninitialised value(s)
==3973==    at 0x45263BE: miCoalesce(QRegionPrivate&, int, int) (qregion_unix.cpp:494)
==3973==    by 0x4526A2A: miRegionOp(QRegionPrivate&, QRegionPrivate const*, QRegionPrivate const*, void (*)(QRegionPrivate&, QRect const*, Q
==3973==    by 0x4526F44: UnionRegion(QRegionPrivate const*, QRegionPrivate const*, QRegionPrivate&) (qregion_unix.cpp:902)
==3973==    by 0x45290B1: QRegion::unite(QRegion const&) const (qregion_unix.cpp:2441)
==3973==    by 0x44F5D5F: QRegion::united(QRegion const&) const (qregion.h:80)
==3973==    by 0x44F4B01: QRegion::operator+(QRegion const&) const (qregion.cpp:393)
==3973==    by 0x44F4B3B: QRegion::operator+=(QRegion const&) (qregion.cpp:440)
==3973==    by 0x452B96B: QWidgetBackingStore::dirtyRegion(QRegion const&, QWidget*) (qbackingstore.cpp:498)
==3973==    by 0x452BB63: QWidget::update(QRegion const&) (qbackingstore.cpp:894)
==3973==    by 0x452BBD6: QWidget::update(QRect const&) (qbackingstore.cpp:878)
==3973==    by 0x4820132: QAbstractItemView::dataChanged(QModelIndex const&, QModelIndex const&) (qabstractitemview.cpp:2524)
==3973==    by 0x4826ABE: QAbstractItemView::qt_metacall(QMetaObject::Call, int, void**) (moc_qabstractitemview.cpp:197)

cvv ★★★★★ ()

Re: посоветуйте как ловить редкие топтания по памяти

а такие:

==3973== Use of uninitialised value of size 4
==3973==    at 0x62D300: pthread_mutex_lock (in /lib/libpthread-2.5.so)
==3973==    by 0x68268E: (within /usr/lib/libX11.so.6.2.0)
==3973==    by 0x69D85E: XrmDestroyDatabase (in /usr/lib/libX11.so.6.2.0)
==3973==    by 0x683FAB: _XFreeDisplayStructure (in /usr/lib/libX11.so.6.2.0)
==3973==    by 0x66FB09: XCloseDisplay (in /usr/lib/libX11.so.6.2.0)
==3973==    by 0x4425963: qt_cleanup() (qapplication_x11.cpp:2024)
==3973==    by 0x43C0CA8: QApplication::~QApplication() (qapplication.cpp:913)
==3973==    by 0x80D4AEC: main (main.cpp:47)
==3973== 
==3973== Invalid read of size 4
==3973==    at 0x62D300: pthread_mutex_lock (in /lib/libpthread-2.5.so)
==3973==    by 0x68268E: (within /usr/lib/libX11.so.6.2.0)
==3973==    by 0x69D85E: XrmDestroyDatabase (in /usr/lib/libX11.so.6.2.0)
==3973==    by 0x683FAB: _XFreeDisplayStructure (in /usr/lib/libX11.so.6.2.0)
==3973==    by 0x66FB09: XCloseDisplay (in /usr/lib/libX11.so.6.2.0)
==3973==    by 0x4425963: qt_cleanup() (qapplication_x11.cpp:2024)
==3973==    by 0x43C0CA8: QApplication::~QApplication() (qapplication.cpp:913)
==3973==    by 0x80D4AEC: main (main.cpp:47)
==3973==  Address 0xC is not stack'd, malloc'd or (recently) free'd
==3973== 
==3973== Process terminating with default action of signal 11 (SIGSEGV)
==3973==  Access not within mapped region at address 0xC
==3973==    at 0x62D300: pthread_mutex_lock (in /lib/libpthread-2.5.so)
==3973==    by 0x68268E: (within /usr/lib/libX11.so.6.2.0)
==3973==    by 0x69D85E: XrmDestroyDatabase (in /usr/lib/libX11.so.6.2.0)
==3973==    by 0x683FAB: _XFreeDisplayStructure (in /usr/lib/libX11.so.6.2.0)
==3973==    by 0x66FB09: XCloseDisplay (in /usr/lib/libX11.so.6.2.0)
==3973==    by 0x4425963: qt_cleanup() (qapplication_x11.cpp:2024)
==3973==    by 0x43C0CA8: QApplication::~QApplication() (qapplication.cpp:913)
==3973==    by 0x80D4AEC: main (main.cpp:47)

cvv ★★★★★ ()

Re: посоветуйте как ловить редкие топтания по памяти

ты "-v -v" добавь и увеличь величину раскрутки стека,
man valgrind в общем, обычно ошибка в библиотеках вызвана ошибками в самой программе.

fghj ★★★★★ ()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.