Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-05-10 12:48:44


"Jonathan Wakely" <cow_at_[hidden]> wrote in message
news:20050506165617.GA27267_at_compsoc.man.ac.uk...
| On Thu, May 05, 2005 at 09:13:07PM +0200, Thorsten Ottosen wrote:

| I've not found a reduced test case yet, but will apply the fix to GCC
| soon. It seems to be triggered by a "using namespace std;" before
| including <vector>.
|
| In the meantime, I also tried to debug this failure:
|
|
http://www.redi.uklinux.net/src/boost/status/cs-Linux-links.html#ptr_container-ptr_list-gcc-prerelease
|
| It looks like a double-delete on a Base object, the second time it comes
| to delete it the object's vtable is invalid, so trying to run the
| derived dtor causes a segfault.
|
| I see this with GCC4 on both x86_64 Linux and i386 FreeBSD.
|
| I modified ptr_list.cpp to add a static int Base::counter, initialised
| to zero, then added this to the ctors:
| std::cerr << '+' << this << '\t' << ++counter << endl;
| and made the dtor non-virtual (to prevent the vtable lookup) and added
| this in the dtor body:
| std::cerr << '-' << this << '\t' << --counter << endl;
|
| This produced:
|
| +0x80f40a0 1
| +0x80f4120 2
| +0x80f4160 3
| +0x80f41a0 4
| -0x80f40a0 3
| +0x80f40a0 4
| -0x80f41a0 3
| +0x80f4140 4
| +0x80f41a0 5
| -0x80f41a0 4
| +0x80f41a0 5
| +0x80f4220 6
| +0x80f4260 7
| +0x80f42a0 8
| +0x80f42e0 9
| +0x80f4320 10
| -0x80f40a0 9
| -0x80f4160 8
| -0x80f4260 7
| -0x80f42a0 6
| -0x80f42e0 5
| -0x80f4320 4
| -0x80f40a0 3
|
| Notice how the last address is shown with more '-' than '+'
|
| That was as far as I got last night, I've not had time to debug any
| further.
| This happens when clear() is called on line 93 of sequence_test_data.hpp

why is sequence_test_data included in the test for ptr_set?

...it should be associative_test-data.hpp

| I'll keep looking into it when I get a chance if you don't have any
| ideas what's going on.

I don't have any idea. :-(

It would be gerat if you could nail down this error!

-Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk