Unit test FP comparisons - memory leaks in debug

I have tried to use the Boost 1.33 Unit test FP comparison with MSVC 8.0 beta 2 and the example test_fp_comparisons.cpp works as expected in release mode (runs 5 tests ok) (Though not auto - Had to run it myself). Defines WIN32;NDEBUG;_CONSOLE but in debug mode I get: ------ Rebuild All started: Project: unit_test_framework, Configuration: Debug Win32 ------ Deleting intermediate and output files for project 'unit_test_framework', configuration 'Debug|Win32' Compiling... xml_report_formatter.cpp xml_log_formatter.cpp unit_test_suite.cpp unit_test_parameters.cpp unit_test_monitor.cpp unit_test_main.cpp unit_test_log.cpp test_tools.cpp results_reporter.cpp results_collector.cpp progress_monitor.cpp plain_report_formatter.cpp framework.cpp i:\boost_1_33_0\boost/test/impl/framework.ipp(313) : warning C4244: 'initializing' : conversion from 'time_t' to 'unsigned int', possible loss of data execution_monitor.cpp compiler_log_formatter.cpp Generating Code... i:\boost_1_33_0\boost\lexical_cast.hpp(223) : warning C4701: potentially uninitialized local variable 'result' used Creating library... Creating browse information file... Microsoft Browse Information Maintenance Utility Version 8.00.50215 Copyright (C) Microsoft Corporation. All rights reserved. Build log was saved at "file://c:\temp\boost_test_library\Debug\BuildLog.htm" unit_test_framework - 0 error(s), 2 warning(s) ------ Rebuild All started: Project: test_fp_comparisons, Configuration: Debug Win32 ------ Deleting intermediate and output files for project 'test_fp_comparisons', configuration 'Debug|Win32' Compiling... test_fp_comparisons.cpp Linking... Auto run test Running 5 test cases... Detected memory leaks! Dumping objects -> {150} normal block at 0x003163F8, 12 bytes long. Data: <long double > 6C 6F 6E 67 20 64 6F 75 62 6C 65 00 {149} normal block at 0x003163C0, 8 bytes long. Data: < c1 0a1 > F8 63 31 00 30 61 31 00 {139} normal block at 0x00316168, 7 bytes long. Data: <double > 64 6F 75 62 6C 65 00 {138} normal block at 0x00316130, 8 bytes long. Data: <ha1 `41 > 68 61 31 00 60 34 31 00 {126} normal block at 0x00313498, 6 bytes long. Data: <float > 66 6C 6F 61 74 00 {125} normal block at 0x00313460, 8 bytes long. Data: < 41 > 98 34 31 00 00 00 00 00 Object dump complete. Build log was saved at "file://c:\temp\boost_test_library\Debug\BuildLog.htm" test_fp_comparisons - 0 error(s), 0 warning(s) ========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ========== _CONSOLE;WIN32;_DEBUG,BOOST_TEST_NO_AUTO_LINK are defined. Can anyone throw any light on this please? Thanks Paul Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539 561830 +44 7714 330204 mailto: pbristow@hetp.u-net.com www.hetp.u-net.com

Dumping objects -> {150} normal block at 0x003163F8, 12 bytes long. Data: <long double > 6C 6F 6E 67 20 64 6F 75 62 6C 65 00 {149} normal block at 0x003163C0, 8 bytes long. Data: < c1 0a1 > F8 63 31 00 30 61 31 00 {139} normal block at 0x00316168, 7 bytes long. Data: <double > 64 6F 75 62 6C 65 00 {138} normal block at 0x00316130, 8 bytes long. Data: <ha1 `41 > 68 61 31 00 60 34 31 00 {126} normal block at 0x00313498, 6 bytes long. Data: <float > 66 6C 6F 61 74 00 {125} normal block at 0x00313460, 8 bytes long. Data: < 41 > 98 34 31 00 00 00 00 00 Object dump complete. Build log was saved at "file://c:\temp\boost_test_library\Debug\BuildLog.htm" test_fp_comparisons - 0 error(s), 0 warning(s) ========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========
_CONSOLE;WIN32;_DEBUG,BOOST_TEST_NO_AUTO_LINK are defined.
Can anyone throw any light on this please?
I saw these link of leaks with STLPort. My guess is that iostream implementation is leaking. Gennadiy

Is this something that should be brought to the attention of Microsoft? Paul Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539 561830 +44 7714 330204 mailto: pbristow@hetp.u-net.com www.hetp.u-net.com | -----Original Message----- | From: boost-bounces@lists.boost.org | [mailto:boost-bounces@lists.boost.org] On Behalf Of Gennadiy Rozental | Sent: 29 September 2005 17:06 | To: boost@lists.boost.org | Subject: Re: [boost] Unit test FP comparisons - memory leaks in debug | | > Dumping objects -> | > {150} normal block at 0x003163F8, 12 bytes long. | > Data: <long double > 6C 6F 6E 67 20 64 6F 75 62 6C 65 00 | > {149} normal block at 0x003163C0, 8 bytes long. | > Data: < c1 0a1 > F8 63 31 00 30 61 31 00 | > {139} normal block at 0x00316168, 7 bytes long. | > Data: <double > 64 6F 75 62 6C 65 00 | > {138} normal block at 0x00316130, 8 bytes long. | > Data: <ha1 `41 > 68 61 31 00 60 34 31 00 | > {126} normal block at 0x00313498, 6 bytes long. | > Data: <float > 66 6C 6F 61 74 00 | > {125} normal block at 0x00313460, 8 bytes long. | > Data: < 41 > 98 34 31 00 00 00 00 00 | > Object dump complete. | > Build log was saved at | > "file://c:\temp\boost_test_library\Debug\BuildLog.htm" | > test_fp_comparisons - 0 error(s), 0 warning(s) | > ========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ========== | > | > _CONSOLE;WIN32;_DEBUG,BOOST_TEST_NO_AUTO_LINK are defined. | > | > Can anyone throw any light on this please? | | I saw these link of leaks with STLPort. My guess is that iostream | implementation is leaking. | | Gennadiy

But I am using MSVC entirely with a standard 8.0 beta 2 installation - no STLPort anywhere (life with MS is complicated enough!). However I don't understand what the messages mean at all :-( Just that it doesn't work. Since you wrote it, I suspect you have more idea? Paul PS I do know that there are some issues with the STL library as I have to enable MS language extensions to get some things doing IO on strings and vectors to compile. There are some undocumented macros to control bound checking etc that I also don't understand. Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539 561830 +44 7714 330204 mailto: pbristow@hetp.u-net.com www.hetp.u-net.com | -----Original Message----- | From: boost-bounces@lists.boost.org | [mailto:boost-bounces@lists.boost.org] On Behalf Of Gennadiy Rozental | Sent: 30 September 2005 15:19 | To: boost@lists.boost.org | Subject: Re: [boost] Unit test FP comparisons - memory leaks in debug | | | > Is this something that should be brought to the attention | of Microsoft? | | If you could confirm my suspicion, it would rather be STLPort guys. | | Gennadiy | | | | _______________________________________________ | Unsubscribe & other changes: | http://lists.boost.org/mailman/listinfo.cgi/boost |

"Paul A Bristow" <pbristow@hetp.u-net.com> wrote in message news:E1ELMF9-00033x-UT@he304war.uk.vianw.net...
But I am using MSVC entirely with a standard 8.0 beta 2 installation - no STLPort anywhere (life with MS is complicated enough!).
However I don't understand what the messages mean at all :-( Just that it doesn't work.
Since you wrote it, I suspect you have more idea?
Messages are quite simple really: | > {150} normal block at 0x003163F8, 12 bytes long. | > Data: <long double > 6C 6F 6E 67 20 64 6F 75 62 6C 65 00 150 - allocation number; essentially this was 150 allocation since the program start 0x003163F8 - address where it was allocated, 12 - size allocated <long double > content of the memory at the time this message is dumped, 6C 6F 6E 67 20 64 6F 75 62 6C 65 00 - hex dump of above I rely on Microsoft debug CRT to do the job. SO anything that is not released by the end of main gets automatically reported. In theory I could recommend you to start debugger and specify leak allocation number(150) http://www.boost.org/libs/test/doc/components/utf/parameters/detect_memory_l... and see where it gets you. In practice unfortunately it's not really 150, but some other number close to it. The reason is that under debugger program does some additional allocations. "long double" is most probably came from typeid(TestType).name() in test_case_template.hpp. So it could be just RTTI implementation after all. Gennadiy
participants (2)
-
Gennadiy Rozental
-
Paul A Bristow