|
From: Nicholas N. <nj...@ca...> - 2004-07-13 13:29:56
|
On Mon, 12 Jul 2004 fa...@ca... wrote:
> Is this a known error in valgrind or the gnu STL, or (more likely) am I
> doing something stupid?
>
> A simple test program:
>
> #include <vector>
> #include <algorithm>
> #include <functional>
> #include <iostream>
>
> int main(int argc, char* argv[])
> {
> std::vector<int> data;
> for (int i=0;i<100;i++) data.push_back(i%7);
> stable_sort( data.begin(), data.end() );
> std::cout << data[50] << std::endl;
> }
>
>
> Results in the error:
>
> ==27651== Mismatched free() / delete / delete []
> ==27651== at 0x3C01E87B: free (vg_replace_malloc.c:127)
> ==27651== by 0x3C0C78D0: operator delete(void*, std::nothrow_t
> const&) (del_opnt.cc:39)
Looks like a Valgrind bug. It's not catching replacing delete(nothrow)
with its own version.
To fix this requires knowing what the mangled name of delete(nothrow) is,
but I don't know how to work this out... the one for new(nothrow) is
_ZnwjRKSt9nothrow_t... maybe someone else can enlighten me.
N
|