I have a application compiled in Visual studio 2008,which runs fine in debug build. In release build , the application crashes when std::wstring assignment is done or when shared pointer is accessed. Any idea why this happens in release build. crash at : eg: m_name = name; //m_name and name are of type std::wstring
views:
30answers:
2
Q:
Visual studio 2008 release build : application crashes on basic string or basic pointer operations
A:
Your problem is probably a memory corruption caused by some other part of your program. Double check that your bounds checks are correct everywhere, you can also use specialized tools like Memory Validator or Bounds Checker.
dark_charlie
2010-08-26 07:31:32
+1
A:
In debug mode, some compilers will set values of pointers to default values (like null) for example. But in release mode the value of the pointer will be whatever is on the stack at that location and will be pointing to an invalid object thus resulting in a crash.
David
2010-08-26 10:31:41
Heisenbug : http://en.wikipedia.org/wiki/Unusual_software_bug
Drahakar
2010-08-26 10:41:21