[xsde-users] "Hello world" document_pimpl::parse() crash when built in VS 2008

Митя Балахонский dnomaid at gmail.com
Tue Apr 13 04:36:12 EDT 2010

> 1. Use one of the WinCE configuration files in etc\vc-9\ as a base
>   but adjust the values in the "Toolchain" section to match your
>   target. The best way is to open the "Project Properties" dialog
>   for the Win32 Smart Device project you have created and copy
>   the command lines from there. At a minimum, you will want to
>   replace the CPPFLAGS variable values since they are all ARM-
>   specific.

Now cl.exe command line looks like this:
/nologo /W3 /O1 /GR- /MT /GS- /FD /EHsc /fp:fast /I..  /EHs /EHs /EHs
/c /TP cxx\serializer\validating\unsigned-long.cxx

While I compile my project with:
/O2 /Os /GL /D "NDEBUG" /D "_WIN32_WCE=0x501" /D "UNDER_CE" /D
"ARMV4I" /D "_UNICODE" /D "UNICODE" /FD /EHsc /fp:fast /GR- /W3
/nologo /c /Zi /TP
(I omitted some specific defines and output paths)

> 2. Copy the vcvarssd.bat file from the same directory and update it
>   to match your setup. The instructions in this file will guide you
>   for where to look for possible values.

I changed the following lines:
Files\Windows Mobile 5.0 SDK R2\Smartphone\include\armv4i;%INCLUDE%
Files\Windows Mobile 5.0 SDK R2\Smartphone\Lib\%RUNTIME%;%LIB%

> Let us know if this doesn't help.

Now the program crashes, but shows
Unhandled exception at 0x00011c64 in XSDETest.exe: 0xC0000005: Access
violation writing location 0x0003e628.

The xutility file opens and the yellow arrow points to the line
(*_Pnext)->_Mycont = 0;
of the _Container_base_secure::_Orphan_all() function

The call stack is like:
>	XSDETest.exe!std::_Container_base_secure::_Orphan_all(void) Line: 225, Byte Offsets: 0x70	C++
Line: 117, Byte Offsets: 0x14	C++
 	XSDETest.exe!std::_String_base::~_String_base(void) Line: 0, Byte
Offsets: 0xffffffff	C++
>::~_String_val<char,std::allocator<char> >(void) Line: 0, Byte
Offsets: 0xffffffff	C++
>(void) Line: 917, Byte Offsets: 0x28	C++
 	XSDETest.exe!hello_pskel::sequence_0(unsigned long int& state = 0,
unsigned long int& count = 0, xsde::cxx::ro_string& ns = {...},
xsde::cxx::ro_string& n = {...}, bool start = false) Line: 283, Byte
Offsets: 0x1a8	C++
 	XSDETest.exe!hello_pskel::_end_element_impl(xsde::cxx::ro_string& ns
= {...}, xsde::cxx::ro_string& n = {...}) Line: 202, Byte Offsets:
0xfc	C++
 	?_end_element at complex_content@validating at parser@cxx at xsde@@UAAXABUro_string at 45@0 at Z
 	?end_element_ at document_pimpl@expat at parser@cxx at xsde@@IAAXPBD at Z	
 	?parse at document_pimpl@expat at parser@cxx at xsde@@QAAXPBXI_N at Z	
 	XSDETest.exe!main(int argc = -2116561702, wchar_t** argv =
0x00000000) Line: 57, Byte Offsets: 0x154	C++

Best regards,
   Dmitry Balakhonsky

More information about the xsde-users mailing list