map behaviour in Release Build 
Author Message
 map behaviour in Release Build

When i use an Map in Debug mode as:
typedef map<D3DRENDERSTATETYPE, st> RenderSelValueMap;
typedef pair<D3DRENDERSTATETYPE, st> RenderSelValuePair;

RenderSelValueMap m_renderselvaluemap;

and then i iterate through same map in some other function
as:
1) map<D3DRENDERSTATETYPE , st>::iterator itervalue;

2) itervalue = m_renderselvaluemap.find(findstring);

In above mention statements "m_renderselvaluemap" is
member variable of class it is conatined in. It called
filled in some other function & is read in statement
no '2'.

Now the problem arises in ReleaseBuild where the value
in "m_renderselvaluemap" gets corrupted as soon as code
execution passes statement '2'. But the same code works in
Debug build.

Is there has to be some kind of initialization that
release build id expecting??

I am building Release build with "Win32 Unicode Release
MinDependency" settings.



Sat, 17 Dec 2005 16:55:04 GMT  
 map behaviour in Release Build

Quote:
> Now the problem arises in ReleaseBuild where the value
> in "m_renderselvaluemap" gets corrupted as soon as code
> execution passes statement '2'. But the same code works in
> Debug build.

> Is there has to be some kind of initialization that
> release build id expecting??

> I am building Release build with "Win32 Unicode Release
> MinDependency" settings.

If there's a difference in behaviour between the test and the release
builds of the same app, that's almost allways a source-bug. With the
information you've provided it's impossible to tell, where the problem lies
but it might be in a completely different part of your code. What you've
described pretty much looks like a memory corruption caused by a stale
pointer or a write over the bounds of a struct/string/object. There are
differences between the debug and release builds both in laying out memory
and initializing it.

--
Andras Tantos, Visual C++ Team
This posting is provided AS IS with no warranties, and confers no rights.



Sat, 24 Dec 2005 02:07:49 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. _msize behaviour different in release and debug builds

2. Problem with STL Maps in Release Builds exported from DLL's

3. Debug build breaks, Release build ok

4. Debug Build vs. Release Build

5. Debug Build works Release build doesn't?

6. Protection Violation in Release Build but not in Debug Build

7. Debug build works correctly but release build doesnt (sometimes)

8. Debug build works, release build crashes!

9. Error in Release build but not Debug build

10. Message Handler on Release build and debug build

11. U1077 MSVC 4.0 Release Build with NT 4.0 Check Build 1381

12. VC6 Debug Build Works Fine - but Release Build Gives Error

 

 
Powered by phpBB® Forum Software