CB2007 ofstream: mem/critical section leak?..
Posted: Wed Jun 19, 2013 8:08 am
HI!
Last version of madExcept on CB2007, XP/32.
New VCL form app, button:
#include<fstream>
void __fastcall TForm1::Button1Click(TObject *Sender)
{
std::ofstream f("Test.txt");
}
I see strange leak reports on program exit.
-----------------------------------------------------------------------
Linker->Dynamic RTL off, Packages->Runtime packages off. (I mainly use this configuration)
allocation number: 1908
program up time: 1.88 s
type: InitializeCriticalSection
address: $4da8c4
access rights: read/write
main thread ($fa4):
671d0820 madExcept32.dll madExceptDbg 4159 InitializeCriticalSectionCallback
004c0a6e Project3.exe __create_lock
004c12eb Project3.exe __lock_stream
0049c273 Project3.exe _setvbuf
004c1759 Project3.exe std _Init_atexit.Destroy
004c17cb Project3.exe _fopen
0049c987 Project3.exe std _Fiopen
00404a1e Project3.exe fstream 139 std.basic_filebuf
0040477d Project3.exe fstream 765 std.basic_ofstream
004046a1 Project3.exe unit1.cpp 19 TForm1.Button1Click
allocation number: 1918
program up time: 1.88 s
type: InitializeCriticalSection
address: $4da8dc
access rights: read/write
main thread ($fa4):
671d0820 madExcept32.dll madExceptDbg 4159 InitializeCriticalSectionCallback
004c0a6e Project3.exe __create_lock
004c4717 Project3.exe __lock_handle
004c148d Project3.exe ___close
0049c59e Project3.exe _fclose
00405062 Project3.exe fstream 180 std.basic_filebuf
00404b15 Project3.exe fstream 107 std.basic_filebuf
004047f4 Project3.exe fstream 813 std.basic_ofstream
004046c9 Project3.exe unit1.cpp 20 TForm1.Button1Click
-----------------------------------------------------------------------
Linker->Dynamic RTL on, Packages->Runtime packages on. (For testing)
allocation number: 1200
program up time: 1.98 s
type: GetMem
address: $502eff0
size: 16
access rights: read/write
main thread ($efc):
671ca8b9 madExcept32.dll madExceptDbg 1453 GetMemCallback
32862333 CC3280MT.DLL _malloc
3282324c CC3280MT.DLL $bnew
00409007 Project3.exe xlocale 1266 std.ctype
00408b71 Project3.exe xlocale 323 std.use_facet
004083c4 Project3.exe ios 117 std.basic_ios
00407ef6 Project3.exe ios 128 std.basic_ios
00407c04 Project3.exe ostream 51 std.basic_ostream
004079e6 Project3.exe fstream 763 std.basic_ofstream
0040795d Project3.exe unit1.cpp 19 TForm1.Button1Click
allocation number: 1204
program up time: 1.98 s
type: GetMem
address: $5026e00
size: 512
access rights: read/write
main thread ($efc):
671ca8b9 madExcept32.dll madExceptDbg 1453 GetMemCallback
32862333 CC3280MT.DLL _malloc
32861c7d CC3280MT.DLL _calloc
3285a0c6 CC3280MT.DLL __Getctyptab
00409950 Project3.exe xlocinfo 75 std._Locinfo._Getctype
004097f4 Project3.exe xlocale 1287 std.ctype
00409434 Project3.exe xlocale 1259 std.ctype
00409058 Project3.exe xlocale 1266 std.ctype
00408b71 Project3.exe xlocale 323 std.use_facet
004083c4 Project3.exe ios 117 std.basic_ios
00407ef6 Project3.exe ios 128 std.basic_ios
00407c04 Project3.exe ostream 51 std.basic_ostream
004079e6 Project3.exe fstream 763 std.basic_ofstream
0040795d Project3.exe unit1.cpp 19 TForm1.Button1Click
allocation number: 1207
program up time: 1.98 s
type: GetMem
address: $5020ff8
size: 8
access rights: read/write
main thread ($efc):
671ca8b9 madExcept32.dll madExceptDbg 1453 GetMemCallback
32862333 CC3280MT.DLL _malloc
3282324c CC3280MT.DLL $bnew
328213e6 CC3280MT.DLL std locale.facet._Register
00408be3 Project3.exe xlocale 339 std.use_facet
004083c4 Project3.exe ios 117 std.basic_ios
00407ef6 Project3.exe ios 128 std.basic_ios
00407c04 Project3.exe ostream 51 std.basic_ostream
004079e6 Project3.exe fstream 763 std.basic_ofstream
0040795d Project3.exe unit1.cpp 19 TForm1.Button1Click
allocation number: 1211
program up time: 1.98 s
type: GetMem
address: $5018ff8
size: 8
access rights: read/write
main thread ($efc):
671ca8b9 madExcept32.dll madExceptDbg 1453 GetMemCallback
32862333 CC3280MT.DLL _malloc
3282324c CC3280MT.DLL $bnew
00408677 Project3.exe xlocale 586 std.codecvt
00408195 Project3.exe xlocale 323 std.use_facet
00407d23 Project3.exe fstream 143 std.basic_filebuf
00407a39 Project3.exe fstream 765 std.basic_ofstream
0040795d Project3.exe unit1.cpp 19 TForm1.Button1Click
allocation number: 1217
program up time: 1.98 s
type: GetMem
address: $544cff8
size: 8
access rights: read/write
main thread ($efc):
671ca8b9 madExcept32.dll madExceptDbg 1453 GetMemCallback
32862333 CC3280MT.DLL _malloc
3282324c CC3280MT.DLL $bnew
328213e6 CC3280MT.DLL std locale.facet._Register
00408207 Project3.exe xlocale 339 std.use_facet
00407d23 Project3.exe fstream 143 std.basic_filebuf
00407a39 Project3.exe fstream 765 std.basic_ofstream
0040795d Project3.exe unit1.cpp 19 TForm1.Button1Click
-----------------------------------------------------------------------
What do you think about it?
Is this real leaks (all kinds of quirks are possible in borland as we know) or a problem in leak detector?
Last version of madExcept on CB2007, XP/32.
New VCL form app, button:
#include<fstream>
void __fastcall TForm1::Button1Click(TObject *Sender)
{
std::ofstream f("Test.txt");
}
I see strange leak reports on program exit.
-----------------------------------------------------------------------
Linker->Dynamic RTL off, Packages->Runtime packages off. (I mainly use this configuration)
allocation number: 1908
program up time: 1.88 s
type: InitializeCriticalSection
address: $4da8c4
access rights: read/write
main thread ($fa4):
671d0820 madExcept32.dll madExceptDbg 4159 InitializeCriticalSectionCallback
004c0a6e Project3.exe __create_lock
004c12eb Project3.exe __lock_stream
0049c273 Project3.exe _setvbuf
004c1759 Project3.exe std _Init_atexit.Destroy
004c17cb Project3.exe _fopen
0049c987 Project3.exe std _Fiopen
00404a1e Project3.exe fstream 139 std.basic_filebuf
0040477d Project3.exe fstream 765 std.basic_ofstream
004046a1 Project3.exe unit1.cpp 19 TForm1.Button1Click
allocation number: 1918
program up time: 1.88 s
type: InitializeCriticalSection
address: $4da8dc
access rights: read/write
main thread ($fa4):
671d0820 madExcept32.dll madExceptDbg 4159 InitializeCriticalSectionCallback
004c0a6e Project3.exe __create_lock
004c4717 Project3.exe __lock_handle
004c148d Project3.exe ___close
0049c59e Project3.exe _fclose
00405062 Project3.exe fstream 180 std.basic_filebuf
00404b15 Project3.exe fstream 107 std.basic_filebuf
004047f4 Project3.exe fstream 813 std.basic_ofstream
004046c9 Project3.exe unit1.cpp 20 TForm1.Button1Click
-----------------------------------------------------------------------
Linker->Dynamic RTL on, Packages->Runtime packages on. (For testing)
allocation number: 1200
program up time: 1.98 s
type: GetMem
address: $502eff0
size: 16
access rights: read/write
main thread ($efc):
671ca8b9 madExcept32.dll madExceptDbg 1453 GetMemCallback
32862333 CC3280MT.DLL _malloc
3282324c CC3280MT.DLL $bnew
00409007 Project3.exe xlocale 1266 std.ctype
00408b71 Project3.exe xlocale 323 std.use_facet
004083c4 Project3.exe ios 117 std.basic_ios
00407ef6 Project3.exe ios 128 std.basic_ios
00407c04 Project3.exe ostream 51 std.basic_ostream
004079e6 Project3.exe fstream 763 std.basic_ofstream
0040795d Project3.exe unit1.cpp 19 TForm1.Button1Click
allocation number: 1204
program up time: 1.98 s
type: GetMem
address: $5026e00
size: 512
access rights: read/write
main thread ($efc):
671ca8b9 madExcept32.dll madExceptDbg 1453 GetMemCallback
32862333 CC3280MT.DLL _malloc
32861c7d CC3280MT.DLL _calloc
3285a0c6 CC3280MT.DLL __Getctyptab
00409950 Project3.exe xlocinfo 75 std._Locinfo._Getctype
004097f4 Project3.exe xlocale 1287 std.ctype
00409434 Project3.exe xlocale 1259 std.ctype
00409058 Project3.exe xlocale 1266 std.ctype
00408b71 Project3.exe xlocale 323 std.use_facet
004083c4 Project3.exe ios 117 std.basic_ios
00407ef6 Project3.exe ios 128 std.basic_ios
00407c04 Project3.exe ostream 51 std.basic_ostream
004079e6 Project3.exe fstream 763 std.basic_ofstream
0040795d Project3.exe unit1.cpp 19 TForm1.Button1Click
allocation number: 1207
program up time: 1.98 s
type: GetMem
address: $5020ff8
size: 8
access rights: read/write
main thread ($efc):
671ca8b9 madExcept32.dll madExceptDbg 1453 GetMemCallback
32862333 CC3280MT.DLL _malloc
3282324c CC3280MT.DLL $bnew
328213e6 CC3280MT.DLL std locale.facet._Register
00408be3 Project3.exe xlocale 339 std.use_facet
004083c4 Project3.exe ios 117 std.basic_ios
00407ef6 Project3.exe ios 128 std.basic_ios
00407c04 Project3.exe ostream 51 std.basic_ostream
004079e6 Project3.exe fstream 763 std.basic_ofstream
0040795d Project3.exe unit1.cpp 19 TForm1.Button1Click
allocation number: 1211
program up time: 1.98 s
type: GetMem
address: $5018ff8
size: 8
access rights: read/write
main thread ($efc):
671ca8b9 madExcept32.dll madExceptDbg 1453 GetMemCallback
32862333 CC3280MT.DLL _malloc
3282324c CC3280MT.DLL $bnew
00408677 Project3.exe xlocale 586 std.codecvt
00408195 Project3.exe xlocale 323 std.use_facet
00407d23 Project3.exe fstream 143 std.basic_filebuf
00407a39 Project3.exe fstream 765 std.basic_ofstream
0040795d Project3.exe unit1.cpp 19 TForm1.Button1Click
allocation number: 1217
program up time: 1.98 s
type: GetMem
address: $544cff8
size: 8
access rights: read/write
main thread ($efc):
671ca8b9 madExcept32.dll madExceptDbg 1453 GetMemCallback
32862333 CC3280MT.DLL _malloc
3282324c CC3280MT.DLL $bnew
328213e6 CC3280MT.DLL std locale.facet._Register
00408207 Project3.exe xlocale 339 std.use_facet
00407d23 Project3.exe fstream 143 std.basic_filebuf
00407a39 Project3.exe fstream 765 std.basic_ofstream
0040795d Project3.exe unit1.cpp 19 TForm1.Button1Click
-----------------------------------------------------------------------
What do you think about it?
Is this real leaks (all kinds of quirks are possible in borland as we know) or a problem in leak detector?