Menu

#101 Crash on TestCaller construction

-- deleted --
open
nobody
5
2003-10-17
2003-10-17
No

Under VC7 all runs fine if I use cppunitd.lib static library.
However, if I use the cppunitd_dll.dll/.lib I get an
unhandled exception during the construction of the
TestCaller object.

SensorTest is my test class...
I'm using the HelperMacros. If I do a stack trace, I see
CppUnit::TestSuiteFactory() calls
SensorTest::suite() which calls
SensorTest::addTestsToSuite() which calls
CppUnit::TestCaller constructor

This constructor generates an exception down in the
string allocation/deallocation code, specifically in:

_CrtIsValidHeapPointer(const void * pUserData)

This function is used to make sure the pointer is valid
AND is from the same code module. The function that is
actually throwing appears to be in the NTDLL inside
HeapValidate().

One of the Windows requirements is that if you allocate
memory in one code module(application for example),
you can't deallocate it from another module (from inside
a loaded DLL for example).

Since this all works when I do static CPPUnitd.lib, I'm
guessing that something is getting allocated in the main
application code, and that CPPUnitd_dll.dll is attempting
to dispose of that object - this isn't kosher.

Does anyone have a fix for this problem? Has anyone
else SEEN this problem?

Discussion

  • Abdessattar Sassi

    Logged In: YES
    user_id=271508

    I confirm the same problem that started to appear only while
    using MSVC 7.1 with Visual Studio .Net 2003

     
  • Abdessattar Sassi

    Logged In: YES
    user_id=271508

    I confirm the same problem that started to appear only while
    using MSVC 7.1 with Visual Studio .Net 2003

     
  • Baptiste Lepilleur

    Logged In: YES
    user_id=196852

    Could you provide more detail (a single file sample). I'm
    building cppunit on both VC6 & VC7.1 and running all tests
    without issues, so you're doing something I'm not doing and I
    don't know what.

    Which version of CppUnit were you using ?
    Baptiste.

     
  • MG

    MG - 2004-09-02

    Logged In: YES
    user_id=576671

    Grettings

    I have the same problem with Borland 5.5 free compiler!
    Everything was going ok, one day I added a new unit to the
    testrunner and then AccessViolation within the execution of
    the HelperMacros!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.