Beta binary

Thiago Macieira thiago at macieira.org
Fri Nov 29 19:57:20 UTC 2013


On sexta-feira, 29 de novembro de 2013 15:35:39, Lubomir I. Ivanov wrote:
> On 29 November 2013 05:19, Thiago Macieira <thiago at macieira.org> wrote:
> > On sexta-feira, 29 de novembro de 2013 03:05:15, Lubomir I. Ivanov wrote:
> >> thiago, would you appreciate a "dr.memory" log as well?
> >> it has been considered as one of the best valgrind alternatives for
> >> win32, if not even better.
> > 
> > Yup, any report should be useful.
> 
> here is running with the default dr. memory arguments and opening a
> single dive in subsurface, while doing some actions on the UI.
> 
> there seem to be a lot of "uninitialized reads"
> http://www.drmemory.org/docs/page_uninit.html

Error #1: UNINITIALIZED READ: reading 0x0028f490-0x0028f494 4 byte(s) within 
0x0028f490-0x0028f494
# 0 system call NtUserEnumDisplayMonitors parameter value #4
# 1 QtGuid4.dll!QDesktopWidgetPrivate::init()                              
[kernel/qdesktopwidget_win.cpp:170]

    enumDisplayMonitors(0, 0, enumCallback, 0);

enumCallback is a function. It's impossible to create an uninitialised read 
with that code. If there's a bug, it's in Windows code.

Error #2: UNINITIALIZED READ: reading register eax
# 0 QtGuid4.dll!comp_func_solid_SourceOver_sse2()        
[c:/mingw44/bin/../lib/gcc/mingw32/4.4.0/include/emmintrin.h:594]
[...]
Note: instruction: data16 pinsrw %eax $0x01 -> %xmm0


emmintrin.h:594 is in function _mm_set_epi16 in GCC 4.4 branch. That would be 
called from
        const __m128i minusAlphaOfColorVector = 
_mm_set1_epi16(minusAlphaOfColor);

Unfortunately, that doesn't lead me anywhere because minusAlphaOfColor is 
calculated inside the same function. There should have been a complaint when 
calculating that variable. It's possible the BYTE_MUL macro is doing something 
wrong, but I doubt it.

Also, _mm_set_epi16 should not generate the PINSRW instruction. I see it in my 
code stream, though.

Error #16: UNINITIALIZED READ: reading register eax
# 0 msvcrt.dll!longjmp   
# 1 QtGuid4.dll!gray_record_cell                         
[painting/qgrayraster.c:441]

I don't know what to make of this, it's third-party code.

Error #28: UNINITIALIZED READ: reading register eax
# 0 QtGuid4.dll!qt_blend_argb32_on_argb32_sse2()           
[c:/mingw44/bin/../lib/gcc/mingw32/4.4.0/include/emmintrin.h:594]

There's no _mm_set_epi16 in qt_blend_argb32_on_argb32_sse2. The debugging 
infor can't be trusted...

Error #38: UNINITIALIZED READ: reading register eax
# 0 QtGuid4.dll!swap_bit_order()                                           
[image/qimage.cpp:2640]
# 1 QtGuid4.dll!QImage::convertToFormat()                                  
[image/qimage.cpp:3902]
# 2 QtGuid4.dll!QCursorData::update()                                      
[kernel/qcursor_win.cpp:381]

381 is:
            QBitmap cb = QBitmap::fromData(QSize(16, 16), open ? openhand_bits 
: closedhand_bits);
            bbits = cb.toImage().convertToFormat(QImage::Format_Mono);

openhand_bits and closedhand_bits are static const data, so they are definitely 
initialised. This is beyond my area of expertise to understand how the data 
could be invalid.

Error #48: UNINITIALIZED READ: reading register al
# 0 StarWidget::mouseReleaseEvent()                        [qt-
ui/starwidget.cpp:29]
        if (readOnly) {

Real error. The readOnly member is never initialised!

Error #62: LEAK 56 direct bytes 0x34471e30-0x34471e68 + 308 indirect bytes
# 0 replace_operator_new                             [d:
\drmemory_package\common\alloc_replace.c:2421]
# 1 QtCored4.dll!QLibraryPrivate::findOrCreate()     [plugin/qlibrary.cpp:440]

Known problem. Fixed for Qt 5.2.

Error #63: LEAK 24 direct bytes 0x344f42e8-0x344f4300 + 0 indirect bytes
# 0 replace_operator_new                             [d:
\drmemory_package\common\alloc_replace.c:2421]
# 1 MinMaxAvgWidget::MinMaxAvgWidget()               [qt-
ui/simplewidgets.cpp:64]

MinMaxAvgWidget::MinMaxAvgWidget(QWidget* parent)
: d(new MinMaxAvgWidgetPrivate(this)){

Real error. We never free the d pointer.

Error #65: LEAK 32 direct bytes 0x3453e530-0x3453e550 + 938 indirect bytes
# 0 replace_malloc                                                   [d:
\drmemory_package\common\alloc_replace.c:2292]
# 1 QtCored4.dll!qMalloc()                                           
[global/qmalloc.cpp:55]
# 2 QtCored4.dll!QListData::detach_grow()                            
[tools/qlist.cpp:85]
[...]
#10 QtGuid4.dll!QMenu::QMenu()                                       
[widgets/qmenu.cpp:1398]
#11 libmarblewidgetd.dll!Marble::MarbleWidgetPopupMenu::createInfoBoxMenu() 
[C:/dev/marble/src/lib/MarbleWidgetPopupMenu.cpp:131]

QList doesn't leak memory, so I'm guessing that the QMenu created on that 
Marble function was leaked. Need more context to verify.

Error #66: POSSIBLE LEAK 16 direct bytes 0x3458d730-0x3458d740 + 0 indirect 
bytes
# 9 PreferencesDialog::instance()                        [qt-
ui/preferences.cpp:8]

Correct, we don't delete the PreferencesDialog. In fact, we never delete any 
of the singletons. The design pattern that Tomaz chose is that they are lazy-
allocated on first use and never deleted. That's not a problem for the program, 
since we don't cause extra memory usage. It's not a real leak. But they do 
trip memory analysers.

Error #67: LEAK 20 direct bytes 0x345a1ad8-0x345a1aec + 264 indirect bytes
# 5 TankInfoDelegate::TankInfoDelegate()               [qt-
ui/modeldelegates.cpp:221]
# 6 MainTab::MainTab()                                 [qt-ui/maintab.cpp:85]

        ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::TYPE, 
new TankInfoDelegate());

I'm guessing that the TakInfoDelegate created above is never freed. However, 
this is in the constructor of the MainTab, which is part of the MainWindow, 
which is only deleted on program exit. One more fake leak.

Error #69: LEAK 20 direct bytes 0x345af5b0-0x345af5c4 + 3324 indirect bytes
# 5 WSInfoDelegate::WSInfoDelegate()                   [qt-
ui/modeldelegates.cpp:287]
# 6 MainTab::MainTab()                                 [qt-ui/maintab.cpp:86]

Same as above.

Error #71: LEAK 20 direct bytes 0x345b8040-0x345b8054 + 264 indirect bytes
# 5 TankInfoDelegate::TankInfoDelegate()                 [qt-
ui/modeldelegates.cpp:221]
# 6 DivePlannerWidget::DivePlannerWidget()               [qt-
ui/diveplanner.cpp:943]

Very similar to the above, only replace the main tab with the dive planner. I 
wonder if there's any way to share the delegate instead of creating two.

Error #72: LEAK 16 direct bytes 0x345bd3e0-0x345bd3f0 + 140 indirect bytes
# 0 replace_operator_new                                                       
[d:\drmemory_package\common\alloc_replace.c:2421]
# 1 libmarblewidgetd.dll!Marble::GeoTrackGraphicsItem::GeoTrackGraphicsItem()  
[C:/dev/marble/src/lib/geodata/graphicsitem/GeoTrackGraphicsItem.cpp:20]

GeoTrackGraphicsItem::GeoTrackGraphicsItem( const GeoDataFeature *feature, 
const GeoDataTrack *track )
    : GeoLineStringGraphicsItem( feature, new GeoDataLineString() )

Real leak in Marble, that GeoDataLineString is never deleted.

Error #77: LEAK 24 direct bytes 0x34617390-0x346173a8 + 20 indirect bytes
# 0 replace_operator_new                                         [d:
\drmemory_package\common\alloc_replace.c:2421]
# 1 libmarblewidgetd.dll!Marble::FileLoaderPrivate::FileLoaderPrivate() 
[C:/dev/marble/src/lib/FileLoader.cpp:53]

Same, m_styleMap is never deleted.

Error #79: LEAK 16 direct bytes 0x3463e2a0-0x3463e2b0 + 288 indirect bytes
# 0 replace_operator_new                                                       
[d:\drmemory_package\common\alloc_replace.c:2421]
# 1 
libmarblewidgetd.dll!Marble::GeometryLayerPrivate::createGraphicsItemFromGeometry() 
[C:/dev/marble/src/lib/layers/GeometryLayer.cpp:335]
        item = new GeoTrackGraphicsItem( placemark, track );
   [...]
    m_scene.addItem( item );

Real leak in marble. Looks like GeoGraphicsScene does not take ownership.

Error #89: LEAK 36 direct bytes 0x347672c0-0x347672e4 + 20 indirect bytes
# 0 replace_operator_new                                             [d:
\drmemory_package\common\alloc_replace.c:2421]
# 1 libmarblewidgetd.dll!Marble::GeoDataTrack::GeoDataTrack()        
[C:/dev/marble/src/lib/geodata/data/GeoDataTrack.cpp:56]

GeoDataTrack::GeoDataTrack()
    : d( new GeoDataTrackPrivate() )

Real leak, the d pointer is never deleted.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20131129/3b8d25f9/attachment.sig>


More information about the subsurface mailing list