Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.Test] valgrind complains about invalid reads
From: Paolo Brandoli (paolo.brandoli_at_[hidden])
Date: 2009-03-09 10:00:28


Hello,

The error appears also in 1.38.0 unless I change the test_unit destructor to
virtual.
There is no need for Valgrind to popup the error: a simple gdb execution
(MINGW widh gcc4.3.3) will show the error when the test application
terminates.

Bets regards,
Paolo Brandoli

Christopher Jefferson wrote:
>
>
> On 19 Dec 2008, at 07:23, Gennadiy Rozental wrote:
>
>> Peter Klotz wrote:
>>> Gennadiy Rozental wrote:
>>>> Peter Klotz <peter.klotz <at> aon.at> writes:
>>>>
>>>>> Why not just adding the virtual destructor to make valgrind happy?
>>>>
>>>> Did you try removing virtual from test_suite destructor instead?
>>>>
>>> Yes, just making ~test_suite() non virtual worsens things.
>>> valgrind complains about twice as many "invalid read" errors.
>>
>> [...]
>>
>>> Making ~test_unit() virtual removes all errors. Then even a non
>>> virtual ~test_suite() is no longer a problem.
>>> So the final conclusion would be to remove virtual from
>>> ~test_suite() and add it to the base class destructor ~test_unit().
>>
>> Peter,
>>
>> I am not convinced there is a bug inside the Boost.Test code. As far
>> as I can tell all I am doing is legitimate. Maybe we should report
>> this to the valgrind developers instead?
>>
>
> Can you produce a reduced test case, without any boost headers? I'd be
> happy to have a look at it.
>
> Chris
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>

-- 
View this message in context: http://www.nabble.com/-Boost.Test--valgrind-complains-about-invalid-reads-tp20500154p22410435.html
Sent from the Boost - Users mailing list archive at Nabble.com.

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