Boost logo

Boost :

From: Jonathan Wakely (cow_at_[hidden])
Date: 2005-05-06 11:56:17


On Thu, May 05, 2005 at 09:13:07PM +0200, Thorsten Ottosen wrote:

> "Jonathan Wakely" <cow_at_[hidden]> wrote in message
> | Now I've had time to look at it I've found a bug in libstdc++'s debug
> | mode where std::iterator is unqualified and so not found when
> | vector<bool> is not in std.
> |
> | I'll fix it in GCC a.s.a.p.
>
> Thanks! :-)

Hi,

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

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

jon

-- 
VOTE, v.  The instrument and symbol of a free man's power to make
a fool of himself and a wreck of his country.
	- Ambrose Bierce, 'The Devil's Dictionary'

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