[Boost.Test] Problem with vc9 runtime library
Hello all. I have the following program: -------------------------- #define BOOST_TEST_MODULE Test #include <boost/test/unit_test.hpp> #include <boost/test/test_case_template.hpp> #include <boost/mpl/list.hpp> typedef boost::mpl::list<float,double> Types; BOOST_AUTO_TEST_CASE_TEMPLATE( my_test, T, Types ) { } -------------------------- The program compiles and links successfully. However, when compiled with Multithreaded Debug Dll runtime library (/MDd) The program reports: Running 2 test cases... *** No errors detected But when compiled with Mulithreaded Debug runtime library (/MTD) The program reports: Running 2 test cases... *** No errors detected Detected memory leaks! Dumping objects -> {94} normal block at 0x00342ED8, 7 bytes long. Data: <double > 64 6F 75 62 6C 65 00 {93} normal block at 0x00342EA0, 8 bytes long. Data: < .4 )4 > D8 2E 34 00 B0 29 34 00 {84} normal block at 0x003429E8, 6 bytes long. Data: <float > 66 6C 6F 61 74 00 {83} normal block at 0x003429B0, 8 bytes long. Data: < )4 > E8 29 34 00 00 00 00 00 Object dump complete. What could cause this? Any suggestions? Greg
Any workarounds? On Sun, Jun 15, 2008 at 3:27 AM, Gennadiy Rozental <rogeeff@gmail.com> wrote:
Greg Ravikovich <grisharav <at> gmail.com> writes:
But when compiled with Mulithreaded Debug runtime library (/MTD) The program reports: Detected memory leaks!
What could cause this?Any suggestions?
Mulithreaded Debug runtime library ;)
Gennadiy
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Thanks, Greg
When trying to determine where memory leaks are coming from, you could try something like this... #include <crtdbg.h> int main() // try replacing this line with BOOST_AUTO_TEST_CASE_TEMPLATE { // break on memory allocation number _crtBreakAlloc = 83; // or 84, 93,94 } Mike ----- Original Message ----- From: Greg Ravikovich To: boost-users@lists.boost.org Sent: Saturday, June 14, 2008 12:15 PM Subject: [Boost-users] [Boost.Test] Problem with vc9 runtime library Hello all. I have the following program: <cut> {83} normal block at 0x003429B0, 8 bytes long. Data: < )4 > E8 29 34 00 00 00 00 00 Object dump complete. What could cause this? Any suggestions? Greg
Mike(dev <dev.wilson <at> ntlworld.com> writes:
When trying to determine where memory leaks are coming from, you could try something like this...
#include <crtdbg.h> int main() // try replacing this line with BOOST_AUTO_TEST_CASE_TEMPLATE { // break on memory allocation number _crtBreakAlloc = 83; // or 84, 93,94 }
Boost.Test supports this directly just pass allocation number as the value of the argument detect_memory_leaks: test_modul.exe --detect_memory_leaks=83 Unfortunately in my experience with previous version of MS runtime this doesn't actually break exactly at the same allocation we if you did not pass the parameter. It's somewhere in a vicinity though: plus/minus couple. Gennadiy
The Microsoft debug libraries have some memory leaks in them. It's frustrating but I've given up on making my debug builds leak-free. If you've inspected all your DEBUG-conditional code carefully and you're sure there are no leaks in the release build, go on to another problem. I suggest you introduce an intentional leak to make sure leak detection is working properly in your release configuration. Then write off any leaks that occur only in the debug configuration.
Thanks a lot guys. I'll work with the DLL runtime libraries meanwhile, The code seems to work alright using them. Greg On Mon, Jun 16, 2008 at 3:41 PM, Stephen Nuchia <snuchia@statsoft.com> wrote:
The Microsoft debug libraries have some memory leaks in them. It's frustrating but I've given up on making my debug builds leak-free. If you've inspected all your DEBUG-conditional code carefully and you're sure there are no leaks in the release build, go on to another problem.
I suggest you introduce an intentional leak to make sure leak detection is working properly in your release configuration. Then write off any leaks that occur only in the debug configuration.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Thanks, Greg
participants (4)
-
Gennadiy Rozental
-
Greg Ravikovich
-
Mike(dev)
-
Stephen Nuchia