Boost logo

Boost Testing :

From: Robert Ramey (ramey_at_[hidden])
Date: 2005-09-06 22:56:20


It is vary common in the library to have a base class which is precompiled
in the library or DLL. This is used as a base class and templated classes
are derived from it and defined in the user program. Given the
implementation of the library, this sounds like a very good explanation. I
am very optimistic that reviewing the code with this understanding in mind
will resolve this issue. Thanks a lot.

Robert Ramey

John Maddock wrote:
>> The really annyying this is:
>>
>> a) this used to work perfectly for all the borland DLL tests. It
>> only started to occur after some changes in export.hpp. (and maybe
>> somewhere else).
>
> The only information I can find on the web about this is here:
> http://bdn.borland.com/article/0,1410,18715,00.html. Based upon the
> fact that the application runs to completion before the error, it
> looks like you have a destructor that calls a virtual function? If
> so this can be an error if the derived class has had it's destructor
> called, so the virtual call gets directed to the base class's pure
> virtual function instead. This may only show up in the dll build if
> the exe (and any over-riden functions it contains) gets unloaded
> before the dll, and/or if the objects are destroyed by the dll code.
> I suspect not all compilers will diagnose this in the same way as
> well: it assumes that the derived class's destructor fixes up the
> virtual table to point to the base class's table (which hasn't been
> destroyed yet).
>
> I've also seen some suggestions that this is more likely when using
> dll's because the linker is less able to diagnose these issues then:
> it sees that the destructor makes a virtual function call, but
> because the base class is in a dll, it isn't smart enough to realise
> that the method is abstract, and so ends up linking to a stub
> proceedure rather than a real function.
>
>> b) It only occurs on some of the tests.
>>
>> c) It may be particular to my machine. I've noticed that my borland
>> test failures on my machine don't always occur in the regression
>> test matrix. So it seems there are various versions of borland 5.64
>> out there.
>
> I don't think so, as far as I know there is only one 5.64 *compiler*.
> However, I believe there were a couple of minor fixes to some of the
> platform headers in C++ Builder X, and there are some updated linker
> versions available as well I believe.
>
> If I get a chance I'll run the tests here and see what happens.
>
> John.


Boost-testing list run by mbergal at meta-comm.com