[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    reads/writes in deleted KFileMetaInfoItem
From:       Julian Seward <Julian_Seward () muraroa ! demon ! co ! uk>
Date:       2002-01-31 2:59:44
[Download RAW message or body]


There appear to be some use of fields in KFileMetaInfoItem's after
they have been deleted.  This happens in the KDE head as of about 2300
GMT on Weds Jan 30.  The following line numbers pertain to CVS rev
1.18 of kdelibs/kio/kio/kfilemetainfo.cpp.

As a complete KDE newbie, I do not know how to fix this, so I merely
offer a somewhat edited transcript generated by a tool which checks
all memory accesses.  To generate the errors, I started kate, and then
did File->Quit.  Comments from me are in [ ]; comments from the tool
start ==4053==.  Some of the errors occurred multiple times; each is
only shown once.

There is something bad going on here, and hopefully someone
can figure out what it is.  Reading/writing memory after free()/delete
is definitely illegal, and the last error in the sequence shows a
duplicate delete, which is probably related.

J

kdebuilder@phoenix:~$ rigr --sloppy-malloc=yes
                                   /home/kdebuilder/KdeCVS/Inst/bin/kate

==4053== Rigr 0.5, a memory error detector for x86 RedHat 7.2/7.1/6.2.
==4053== Loaded 45792 symbols, 765305 line number locations.
==4053== For more details, rerun with: -v
==4053== 

kdecore (KLibLoader): library libkatepart.la not found under 'module' but under 'lib'
insertCatalogue kate
Kate (Document): dirtyBlock 0x44a10458
[.. tons of debugging msgs from Kate and kio deleted ...]

[.. kate is now up and running; now do File->Quit ..]

Kate: queryClose()
Kate (View): saveViewSpaceConfig()
Kate (View): clearing session config file before saving list
Kate (View): >>>> saveViewSpaceConfig() DONE
Kate (View): saveAllDocsAtCloseDown()
QGList::locate: Index 0 out of range
kparts: Part::~Part 0x44734f64
insertCatalogue kate
Kate (Document): dirtyBlock 0x44c9a6d0
Kate (View): >>>> saveAllDocsAtCloseDown() DONE
kio (KDirListerCache): -KDirListerCache

[.. and you get the following cascade of errors ..]

==4053== 
==4053== Invalid read of size 4
==4053==    at 0x40D9F46B: KFileMetaInfoItem::~KFileMetaInfoItem(..) \
(kfilemetainfo.cpp:50) ==4053==    by 0x40E15D5F: ??? \
(/home/kdebuilder/KdeCVS/qt-copy/include/qmap.h:407) ==4053==    by 0x40E162F2: ??? \
(../../kdecore/kstaticdeleter.h:94) ==4053==    by 0x41192362: \
KGlobal::deleteStaticDeleters() (kglobal.cpp:183) ==4053==    Address 0x44B5593C is 0 \
bytes inside a block of size 28 free'd ==4053==    at 0x4004E2D7: __builtin_delete \
(ri_clientmalloc.c:620) ==4053==    by 0x40E15C4F: ??? (kfilemetainfo.cpp:87)
==4053==    by 0x40E16192: ??? (../../kdecore/kstaticdeleter.h:94)
==4053==    by 0x41192362: KGlobal::deleteStaticDeleters() (kglobal.cpp:183)
==4053== 
==4053== Invalid write of size 4
==4053==    at 0x40D9F46B: KFileMetaInfoItem::~KFileMetaInfoItem(..) \
(kfilemetainfo.cpp:50) ==4053==    by 0x40E15D5F: ??? \
(/home/kdebuilder/KdeCVS/qt-copy/include/qmap.h:407) ==4053==    by 0x40E162F2: ??? \
(../../kdecore/kstaticdeleter.h:94) ==4053==    by 0x41192362: \
KGlobal::deleteStaticDeleters() (kglobal.cpp:183) ==4053==    Address 0x44B5593C is 0 \
bytes inside a block of size 28 free'd ==4053==    at 0x4004E2D7: __builtin_delete \
(ri_clientmalloc.c:620) ==4053==    by 0x40E15C4F: ??? (kfilemetainfo.cpp:87)
==4053==    by 0x40E16192: ??? (../../kdecore/kstaticdeleter.h:94)
==4053==    by 0x41192362: KGlobal::deleteStaticDeleters() (kglobal.cpp:183)
==4053== 
==4053== Invalid read of size 4
==4053==    at 0x4178C076: ??? \
(/home/kdebuilder/KdeCVS/qt-copy/include/qstring.h:752) ==4053==    by 0x416F4610: \
__apl__7QStringRC7QString (tools/qstring.cpp:15216) ==4053==    by 0x40D9F54A: \
KFileMetaInfoItem::~KFileMetaInfoItem(..) \
(/home/kdebuilder/KdeCVS/qt-copy/include/qstring.h:752) ==4053==    by 0x40E15D5F: \
??? (/home/kdebuilder/KdeCVS/qt-copy/include/qmap.h:407) ==4053==    Address \
0x44B55940 is 4 bytes inside a block of size 28 free'd ==4053==    at 0x4004E2D7: \
__builtin_delete (ri_clientmalloc.c:620) ==4053==    by 0x40E15C4F: ??? \
(kfilemetainfo.cpp:87) ==4053==    by 0x40E16192: ??? \
(../../kdecore/kstaticdeleter.h:94) ==4053==    by 0x41192362: \
                KGlobal::deleteStaticDeleters() (kglobal.cpp:183)
KFileMetaInfo: a metainfoitem  is finally deleted
==4053== 
==4053== Invalid read of size 4
==4053==    at 0x415008AA: QVariant::~QVariant(..) (kernel/qvariant.cpp:450)
==4053==    by 0x40E15B95: ??? (/home/kdebuilder/KdeCVS/qt-copy/include/qstring.h:50)
==4053==    by 0x40D9F65B: KFileMetaInfoItem::~KFileMetaInfoItem(..) \
(kfilemetainfo.cpp:87) ==4053==    by 0x40E15D5F: ??? \
(/home/kdebuilder/KdeCVS/qt-copy/include/qmap.h:407) ==4053==    Address 0x44B55950 \
is 20 bytes inside a block of size 28 free'd ==4053==    at 0x4004E2D7: \
__builtin_delete (ri_clientmalloc.c:620) ==4053==    by 0x40E15C4F: ??? \
(kfilemetainfo.cpp:87) ==4053==    by 0x40E16192: ??? \
(../../kdecore/kstaticdeleter.h:94) ==4053==    by 0x41192362: \
KGlobal::deleteStaticDeleters() (kglobal.cpp:183) ==4053== 
==4053== Invalid read of size 4
==4053==    at 0x4178F2E2: ??? (/home/kdebuilder/KdeCVS/qt-copy/include/qshared.h:50)
==4053==    by 0x415008B2: QVariant::~QVariant(..) (kernel/qvariant.cpp:450)
==4053==    by 0x40E15B95: ??? (/home/kdebuilder/KdeCVS/qt-copy/include/qstring.h:50)
==4053==    by 0x40D9F65B: KFileMetaInfoItem::~KFileMetaInfoItem(..) \
(kfilemetainfo.cpp:87) ==4053==    Address 0x44B5A23C is 0 bytes inside a block of \
size 16 free'd ==4053==    at 0x4004E2D7: __builtin_delete (ri_clientmalloc.c:620)
==4053==    by 0x4150040A: _._Q28QVariant7Private (kernel/qvariant.cpp:211)
==4053==    by 0x415008CD: QVariant::~QVariant(..) (kernel/qvariant.cpp:451)
==4053==    by 0x40E15B95: ??? (/home/kdebuilder/KdeCVS/qt-copy/include/qstring.h:50)
==4053== 
==4053== Invalid write of size 4
==4053==    at 0x4178F2E2: ??? (/home/kdebuilder/KdeCVS/qt-copy/include/qshared.h:50)
==4053==    by 0x415008B2: QVariant::~QVariant(..) (kernel/qvariant.cpp:450)
==4053==    by 0x40E15B95: ??? (/home/kdebuilder/KdeCVS/qt-copy/include/qstring.h:50)
==4053==    by 0x40D9F65B: KFileMetaInfoItem::~KFileMetaInfoItem(..) \
(kfilemetainfo.cpp:87) ==4053==    Address 0x44B5A23C is 0 bytes inside a block of \
size 16 free'd ==4053==    at 0x4004E2D7: __builtin_delete (ri_clientmalloc.c:620)
==4053==    by 0x4150040A: _._Q28QVariant7Private (kernel/qvariant.cpp:211)
==4053==    by 0x415008CD: QVariant::~QVariant(..) (kernel/qvariant.cpp:451)
==4053==    by 0x40E15B95: ??? (/home/kdebuilder/KdeCVS/qt-copy/include/qstring.h:50)
==4053== 
==4053== Invalid read of size 4
==4053==    at 0x40E15B95: ??? (/home/kdebuilder/KdeCVS/qt-copy/include/qstring.h:50)
==4053==    by 0x40D9F65B: KFileMetaInfoItem::~KFileMetaInfoItem(..) \
(kfilemetainfo.cpp:87) ==4053==    by 0x40E15D5F: ??? \
(/home/kdebuilder/KdeCVS/qt-copy/include/qmap.h:407) ==4053==    by 0x40E162F2: ??? \
(../../kdecore/kstaticdeleter.h:94) ==4053==    Address 0x44B5594C is 16 bytes inside \
a block of size 28 free'd ==4053==    at 0x4004E2D7: __builtin_delete \
(ri_clientmalloc.c:620) ==4053==    by 0x40E15C4F: ??? (kfilemetainfo.cpp:87)
==4053==    by 0x40E16192: ??? (../../kdecore/kstaticdeleter.h:94)
==4053==    by 0x41192362: KGlobal::deleteStaticDeleters() (kglobal.cpp:183)
==4053== 
==4053== Invalid read of size 4
==4053==    at 0x40E15BC1: ??? (/home/kdebuilder/KdeCVS/qt-copy/include/qstring.h:50)
==4053==    by 0x40D9F65B: KFileMetaInfoItem::~KFileMetaInfoItem(..) \
(kfilemetainfo.cpp:87) ==4053==    by 0x40E15D5F: ??? \
(/home/kdebuilder/KdeCVS/qt-copy/include/qmap.h:407) ==4053==    by 0x40E162F2: ??? \
(../../kdecore/kstaticdeleter.h:94) ==4053==    Address 0x44B55948 is 12 bytes inside \
a block of size 28 free'd ==4053==    at 0x4004E2D7: __builtin_delete \
(ri_clientmalloc.c:620) ==4053==    by 0x40E15C4F: ??? (kfilemetainfo.cpp:87)
==4053==    by 0x40E16192: ??? (../../kdecore/kstaticdeleter.h:94)
==4053==    by 0x41192362: KGlobal::deleteStaticDeleters() (kglobal.cpp:183)
==4053== 
==4053== Invalid read of size 4
==4053==    at 0x40E15BEA: ??? (/home/kdebuilder/KdeCVS/qt-copy/include/qstring.h:50)
==4053==    by 0x40D9F65B: KFileMetaInfoItem::~KFileMetaInfoItem(..) \
(kfilemetainfo.cpp:87) ==4053==    by 0x40E15D5F: ??? \
(/home/kdebuilder/KdeCVS/qt-copy/include/qmap.h:407) ==4053==    by 0x40E162F2: ??? \
(../../kdecore/kstaticdeleter.h:94) ==4053==    Address 0x44B55944 is 8 bytes inside \
a block of size 28 free'd ==4053==    at 0x4004E2D7: __builtin_delete \
(ri_clientmalloc.c:620) ==4053==    by 0x40E15C4F: ??? (kfilemetainfo.cpp:87)
==4053==    by 0x40E16192: ??? (../../kdecore/kstaticdeleter.h:94)
==4053==    by 0x41192362: KGlobal::deleteStaticDeleters() (kglobal.cpp:183)
==4053== 
==4053== Invalid read of size 4
==4053==    at 0x40E15C13: ??? (/home/kdebuilder/KdeCVS/qt-copy/include/qstring.h:50)
==4053==    by 0x40D9F65B: KFileMetaInfoItem::~KFileMetaInfoItem(..) \
(kfilemetainfo.cpp:87) ==4053==    by 0x40E15D5F: ??? \
(/home/kdebuilder/KdeCVS/qt-copy/include/qmap.h:407) ==4053==    by 0x40E162F2: ??? \
(../../kdecore/kstaticdeleter.h:94) ==4053==    Address 0x44B55940 is 4 bytes inside \
a block of size 28 free'd ==4053==    at 0x4004E2D7: __builtin_delete \
(ri_clientmalloc.c:620) ==4053==    by 0x40E15C4F: ??? (kfilemetainfo.cpp:87)
==4053==    by 0x40E16192: ??? (../../kdecore/kstaticdeleter.h:94)
==4053==    by 0x41192362: KGlobal::deleteStaticDeleters() (kglobal.cpp:183)
==4053== 
==4053== Invalid free()
==4053==    at 0x4004E2D7: __builtin_delete (ri_clientmalloc.c:620)
==4053==    by 0x40E15C4F: ??? (kfilemetainfo.cpp:87)
==4053==    by 0x40D9F65B: KFileMetaInfoItem::~KFileMetaInfoItem(..) \
(kfilemetainfo.cpp:87) ==4053==    by 0x40E15D5F: ??? \
(/home/kdebuilder/KdeCVS/qt-copy/include/qmap.h:407) ==4053==    Address 0x44B5593C \
is 0 bytes inside a block of size 28 free'd ==4053==    at 0x4004E2D7: \
__builtin_delete (ri_clientmalloc.c:620) ==4053==    by 0x40E15C4F: ??? \
(kfilemetainfo.cpp:87) ==4053==    by 0x40E16192: ??? \
(../../kdecore/kstaticdeleter.h:94) ==4053==    by 0x41192362: \
KGlobal::deleteStaticDeleters() (kglobal.cpp:183) kdecore (KLibLoader): The \
KLibLoader contains the library libkatepart (0x4472e560) kdecore (KLibLoader): \
                Factory still has object 0x45c94e1c unnamed Library = libkatepart
kparts: Part::~Part 0x45c94e1c
==4053== 
==4053== ERROR SUMMARY: 47 errors from 18 contexts (suppressed: 360 from 9)
==4053== malloc/free: in use at exit: 1082182 bytes in 25185 blocks.
==4053== malloc/free: 360143 allocs, 335000 frees, 14621291 bytes allocated.
==4053== For a detailed leak analysis,  rerun with: --leak-check=yes
==4053== For counts of detected errors, rerun with: -v


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic