On 05/09/2012 12:39 PM, Sean K wrote:
Hi Rafa

Thank you so much for looking at the problem -- having a second set of
eyes look at a problem is so valuable.

You were right -- The OSG and VPB -- I was using release builds.   But
my own DLL -- I had it in the DEBUG build.

After I changed to RELEASE build, the crash did not happen anymore --
and my DLL was able to successfully build the output OSG file.

Thank you for helping.

Just curious though -- what is the issue behind mixing debug and
release binaries that causes something like this to crash?   I noticed
in the original crash that it was involved in the c++ deconstructor
for strings or some other C++ POJO.   I am thinking about what could
have been implemented in those destructors or runtime libraries that
is confused with either debug or release binaries.

Maybe the function signatures are switched between debug or release
mode?   That seems very dangerous.   Maybe the size of the heap
objects used for strings are different between the release and debug?

Just curious why the mix up for non-debug and debug libraries causes
this kind of crash.


The main source of the issue is the Microsoft C runtime library. The debug version of the CRT and the release version are two separate DLLs and they occupy different areas in memory when loaded. The heap managers are also very different (the debug heap includes a lot of extra data to help debug memory allocation/initialization issues), so if you create an object on the debug heap and later free it from the release heap, you'll have heap corruption.

Details about the issue are here:

http://msdn.microsoft.com/en-us/library/ms235460%28v=vs.80%29.aspx


There are also likely to be countless differences in the code itself (ever seen #ifdef _DEBUG in the header files?)


The topic has been discussed many, many times on this list, too. You can skim through the archives for more info.

--"J"

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to