2

I am using boost serialization with xml files with a C++ program. When I test my program in debug mode, it is working fine. Then I try with the exact same file in release mode, but my program fails when loading the files. I even tried to generate the xml files with my program in release mode, load them back, and it crashes as well.

The call stack shows this:

packs_ui_main.exe!boost::archive::basic_xml_grammar<char>::parse_start_tag(std::basic_istream<char,std::char_traits<char> > & is={...})  Line 219   C++

The actual bug is further but I have no debug information deeper in the call stack. I don't understand what kind of settings could be different between release and debug could explain this crash.

EDIT 1

Here are the preprocessor definitions I use in debug:

WIN32;_CONSOLE;_DEBUG;__WXMSW__;__WXDEBUG__;_WINDOWS;NOPCH;_USE_32BIT_TIME_T;_CRT_SECURE_NO_WARNINGS

Here are the preprocessor definitions I use in release:

WIN32;NDEBUG;_WINDOWS;_CONSOLE;__WXMSW__;NOPCH;_USE_32BIT_TIME_T;_CRT_SECURE_NO_WARNINGS

Some of them come from wxWidgets

EDIT 2

I have noticed that when I save string in an XML file, they show differently between my release and debug configuraction. It looks as if the release version uses different encoding.

For example "title" shows up as "X�~T" Other characters like spaces totally change the order of the string and insert special characters that I can not copy-paste (probably \0)

I have made sure that both my configurations are using multi byte character set.

1
  • 1
    C++ doesn't have the concept of "debug mode" or "release mode". It might help to add your compiler and the flags that are different. Commented Jul 28, 2010 at 14:05

2 Answers 2

2

In 100% of my experence, when something succeeds in the debugger, but fails out of the debugger, you've overrun a function local array.

Sign up to request clarification or add additional context in comments.

Comments

1

The issue was due to the fact that I was compiling using

Multi-threaded Debug DLL (/MDd)

instead of

Multi-threaded DLL (/MD)

in release mode.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.