Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

STL list gets cleared randomly

0 views
Skip to first unread message

Olumide

unread,
Oct 28, 2009, 1:24:01 AM10/28/09
to
Hello -

I'm currently debugging a method which among other things, adds items
to a list. However, every so often the list size gets set to zero
"midstream". I've taken care not to clear the list, and I've tested
for a bad alloc exception, but there is none. (I'd post the code, but
it would take a lot of space.)

Has anyone ever experienced this sort of error? Barring a problem with
VS .NET 2003 STL implementation, I'm starting to suspect stack
corruption.

Alternatively, I'd appreciate some guidance on how to watch the size
of the list and halt the debugger when it gets resized.

Thanks,

- Olumide

Vladimir Jovic

unread,
Oct 28, 2009, 2:55:05 AM10/28/09
to
Olumide wrote:
> Hello -
>
> I'm currently debugging a method which among other things, adds items
> to a list. However, every so often the list size gets set to zero
> "midstream". I've taken care not to clear the list, and I've tested
> for a bad alloc exception, but there is none. (I'd post the code, but
> it would take a lot of space.)
>

http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.8
By creating the minimal example that demonstrate the problem, you are
likely to find the solution.

> Has anyone ever experienced this sort of error? Barring a problem with
> VS .NET 2003 STL implementation, I'm starting to suspect stack
> corruption.
>

This kind of problems are solvable with valgrind (if the stack
corruption is really the problem).

> Alternatively, I'd appreciate some guidance on how to watch the size
> of the list and halt the debugger when it gets resized.

Go step by step, and see when it change the size.


--
Bolje je ziveti sto godina kao bogatun, nego jedan dan kao siromah!

Juha Nieminen

unread,
Oct 30, 2009, 8:03:01 AM10/30/09
to
Vladimir Jovic wrote:
>> Has anyone ever experienced this sort of error? Barring a problem with
>> VS .NET 2003 STL implementation, I'm starting to suspect stack
>> corruption.
>>
>
> This kind of problems are solvable with valgrind (if the stack
> corruption is really the problem).

As far as I can see, valgrind has not been ported to Windows (nor do I
know of any free alternative for Windows either).

0 new messages