Boost logo

Boost Users :

From: KLINIK Markus SDI2-G (AREVA NP GmbH) (Markus.Klinik_at_[hidden])
Date: 2007-04-30 09:04:22


Hi,

there seems to be a problem if Boost.Test and mpatrol are used together.
The following program hangs and constantly uses more and more memory.

How to reproduce the behaviour:

System: Windows XP Prof. SP2
MS Visual Studio 7
mpatrol-1.4.8
boost-1.33.1

<code>
#define BOOST_AUTO_TEST_MAIN
#include <boost/test/auto_unit_test.hpp>

BOOST_AUTO_TEST_CASE(testA)
{
        int* a = new int[100];
}
</code>

After "sourcing" vsvars32.bat the following command was used to compile
& link the sample.
cl -Zi -EHsc -ML -Ic:\boost\include\boost-1_33_1 test.cpp -link
-libpath:c:\local\lib mpatrol.lib -libpath:c:\boost\lib
libboost_unit_test_framework-vc7-s.lib

Static linkage of mpatrol results in the same behaviour:
cl -Zi -EHsc -ML -Ic:\boost\include\boost-1_33_1 test.cpp -link
-libpath:c:\local\lib libmpatrol.lib
imagehlp.lib -libpath:c:\boost\lib
libboost_unit_test_framework-vc7-s.lib

Same with -MT, mpatrolmt.lib and
libboost_unit_test_framework-vc7-mt-s.lib

The combinations
  -MLd, mpatrol.lib and libboost_unit_test_framework-vc7-sgd.lib
  -MTd, mpatrolmt.lib and libboost_unit_test_framework-vc7-mt-sgd.lib
do not result in the erroneous behaviour, but memory debugging is buggy
because mpatrol and the M$ debug malloc implementation are incompatible
(according to the mpatrol documentation/mailing list).

I've posted the bug description here because I don't know where to
start. Even "it is their fault" pointers would be helpful.

Thanks in advance,
Markus

Appendix: real quick howto install mpatrol (to make it work for this
example):
- download from
http://www.cbmamiga.demon.co.uk/mpatrol/files/mpatrol_1.4.8.tar.gz
- unpack to c:\src
- cmd prompt to C:\src\mpatrol\build\windows
- "source" vsvars32.bat (YMMV):
    $ "c:\Programme\Microsoft Visual Studio
.NET\Common7\Tools\vsvars32.bat"
- $ nmake -f NMakefile all
- copy mpatrolmt.lib to c:\local\lib
- copy libmpatrolmt.lib to c:\local\lib
- copy mpatrolmt.dll to a directory in $PATH (or local directory)


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net