unit test framework problems

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

unit test framework problems

Niklas Wiberg-3
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<char,std::char_traits<char>,std::allocator<char> >::_Tidy(unsigned char 1) line 592
std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >() line 59 + 17
bytes
boost::filesystem::path::m_path_append(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & {0x0032f9f1 "D:\dev\UnitTest"},
unsigned char (const std::basic_string<char,std::char_traits<char>,std::allocator<char> > &)* 0x0054f9b3 boost::filesystem::native(const
std::basic_string<char,std::char_traits<char>,std::allocator<char> > &)) line 351
boost::filesystem::path::path(const char * 0x0032f988, unsigned char (const std::basic_string<char,std::char_traits<char>,std::allocator<char> > &)*
0x0054f9b3 boost::filesystem::native(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > &)) line 220 + 37 bytes
boost::filesystem::current_path() line 803 + 22 bytes
boost::filesystem::initial_path() line 810 + 28 bytes
init_unit_test_suite(int 1, char * * 0x003b2da0) line 19 + 5 bytes
UNITTEST! boost::unit_test::framework::init(int,char * * const) + 201 bytes
UNITTEST! main + 54 bytes
UNITTEST! mainCRTStartup + 227 bytes
KERNEL32! 7c816d4f()

_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: unit test framework problems

Gennadiy Rozental
> 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



_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: unit test framework problems

Niklas Wiberg-3

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
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: unit test framework problems

Gennadiy Rozental

"Niklas Wiberg" <[hidden email]> wrote in message
news:[hidden email]...
>
> 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



_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users