unit test framework problems

Hi,
I'm having problems with the unit test framework when I try to run it in release mode. My compiler is VC++ 6 sp6.
The unit test executable I'm building is "Using MFC as a shared DLL" and is set to use the "Multithreaded DLL" runtime library.
The test subject code that is linked to this app is built with the same settings.
I'm linking with libboost_unit_test_framework-vc6-mt-1_33.lib.
The problem is that when the unit test starts to execute it fails with an access violation.
In debug build it works fine.
I enabled some debug info in the release build and found that what seems to be happening is a deallocation of "invalid" heap memory, which I'm
guessing could be a result of different runtime libs being used.
The stack trace at the point of the crash is included below.
Has anyone had the same kind of problem and perhaps found a solution?
Best regards,
Niklas Wiberg
NTDLL! 7c901230()
NTDLL! 7c96cd80()
NTDLL! 7c960af8()
KERNEL32! 7c85e7af()
_CrtIsValidHeapPointer(const void * 0x003b2418) line 1697
_free_dbg_lk(void * 0x003b2418, int 1) line 1044 + 9 bytes
_free_dbg(void * 0x003b2418, int 1) line 1001 + 13 bytes
free(void * 0x003b2418) line 956 + 11 bytes
operator delete(void * 0x003b2418) line 7 + 10 bytes
std::allocator<char>::deallocate(void * 0x003b2418, unsigned int 33) line 64 + 16 bytes
std::basic_string

I'm having problems with the unit test framework when I try to run it in release mode. My compiler is VC++ 6 sp6. The unit test executable I'm building is "Using MFC as a shared DLL" and is set to use the "Multithreaded DLL" runtime library. The test subject code that is linked to this app is built with the same settings.
I'm linking with libboost_unit_test_framework-vc6-mt-1_33.lib.
The problem is that when the unit test starts to execute it fails with an access violation. In debug build it works fine. I enabled some debug info in the release build and found that what seems to be happening is a deallocation of "invalid" heap memory, which I'm guessing could be a result of different runtime libs being used. The stack trace at the point of the crash is included below.
From a trace stack it unclear who is responsible for the crash. It could be UTF or it could be Boost.Filesystem library. I wouldn't be abe to debug this (first of all because it's release build and second I do not have vc6 anymore). Why cant you use debug build of the framework?
Gennadiy

Gennadiy Rozental wrote:
anymore). Why cant you use debug build of the framework?
I do use the debug build to test the debug build of my code without any problems, but I also want to test the release build of my code. I will soon switch to VC++ 8, so I won't investigate this further until after that. I'll try to pursue it if the problem remains... Just wanted to check if someone has the same problem or could spot any possible mistake on my part. Thanks, --Niklas Wiberg

"Niklas Wiberg"
Gennadiy Rozental wrote:
anymore). Why cant you use debug build of the framework?
I do use the debug build to test the debug build of my code without any problems, but I also want to test the release build of my code.
I was using debug builds of test framework to test release versions of software. Just link with proper C Runtime version. Gennadiy
participants (2)
-
Gennadiy Rozental
-
Niklas Wiberg