On entering new.cpp last is:
(gdb) print *last
$1 = {prev_ = 0x77f81008, next_ = 0x0, ptr_ = 0x77f00020, size_ =
524296,
id_ = 95, self_ = 0x77f00008}
(gdb)
After 439 memset (ptr, -1, block_size); inside _new, last is:
$12 = {prev_ = 0xffffffff, next_ = 0xffffffff, ptr_ = 0xffffffff,
size_ = 4294967295, id_ = 4294967295, self_ = 0xffffffff}
Somehow the memset on ptr is messing with last.
-----Original Message-----
From: Martin Sebor [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 25, 2006 1:18 PM
To: [email protected]
Subject: Re: problem in temp_buffer
Nicole Willson wrote:
> Actually the message is the header guard corruption message. For some
> reason hdr->self_ is 0xffffffff on the second time through the for
loop.
That's definitely not right. I would suggest setting a breakpoint on the
variable to see when it changes from the valid value first set in
operator_new.
Martin
>
>
> -----Original Message-----
> From: Martin Sebor [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 25, 2006 12:45 PM
> To: [email protected]
> Subject: Re: problem in temp_buffer
>
> Nicole Willson wrote:
>
>>The stack trace is:
>>#0 0x0feb0ca8 in raise () from /lib/tls/libc.so.6
>>#1 0x0feb26c4 in abort () from /lib/tls/libc.so.6
>>#2 0x1000eaa4 in find_block (ptr=0x77e00d48, check_heap=true,
>>caller=0x0)
>> at ../new.cpp:142
>
>
> This looks like it's coming from the heap debugging library and could
> be caused by a corrupted header guard (see below). Is there any error
> message? (If not, you might need to flush stderr in the function to
> see it).
>
> $ svn cat
> http://svn.apache.org/repos/asf/incubator/stdcxx/trunk/tests/src/new.c
> pp
>
> | cat -n | head -150 | tail -15
> 136
> 137 if (check_heap) {
> 138 // check the lead guard
> 139 if (hdr->self_ != hdr) {
> 140 rw_error (0, 0, __LINE__,
> 141 "%s:%d: header guard corruption at
> %#p: "
> 142 "expected %#p, got %#p",
> 143 hdr->ptr_, (const void*)hdr,
> hdr->self_);
> 144 abort ();
> 145 }
> 146
> 147 // check that the stored pointer has the expected
> value
> 148 if (hdr->ptr_ != hdr + 1) {
> 149 rw_error (0, 0, __LINE__,
> 150 "%s:%d: block address mismatch: "
>
> Martin