Strange bug in Release mode

I am using VS2012. I have a bug in my code that i don't know how to overcome as it appears in bizarre situation. It works fine in Debug but crashes in Release mode.

I have a class with couple of vectors and some pointers:
1
2
3
4
5
6
7
8
9
10
11
12
class Foo
{
private:    
    Bla*    pBla; 	 
    std::vector<shared_ptr<Node>> vBar1;	
    std::vector<shared_ptr<Node>> vBar2;	 
    std::vector<shared_ptr<Node>> vBar3;	
    //std::vector<shared_ptr<Node>> vBar4;
... more data
public:
...
};

When i introduced one more vector (vBar4) to this class it crashes my app even if don't use it anywhere, if i comment it then everything works.
WTF is going on?

Thank you for your time.
WTF is going on?

Undefined behavior is going on. In particular memory corruption can cause strange problems in unrelated parts of code.
Any tips how to debug it in Release mode?
You may want to investigate how and where you actually allocate memory for your pointer.
Any tips how to debug it in Release mode?

You just need to enable debug symbols. In most cases, debugging will still be possible, even with optimizations enabled.
"Clean" then "Rebuild" and now it works.
Topic archived. No new replies allowed.