[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:
cl.exe /DARM /D_ARM /DUNDER_CE /DWINCE /D_WIN32_WCE=0x501 /DNDEBUG
/DWIN32_PLATFORM_WFSP /D_WINDOWS /D_ARM_ /DARMV4I /D_UNICODE /DUNICODE
/nologo /W3 /O1 /GR- /MT /GS- /FD /EHsc /fp:fast /I..  /EHs /EHs /EHs
/c /TP cxx\serializer\validating\unsigned-long.cxx
/Focxx\serializer\validating\unsigned-long.obj

While I compile my project with:
/O2 /Os /GL /D "NDEBUG" /D "_WIN32_WCE=0x501" /D "UNDER_CE" /D
"WIN32_PLATFORM_WFSP" /D "WINCE" /D "_WINDOWS" /D "ARM" /D "_ARM_" /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:
SET RUNTIME=armv4i
SET INCLUDE=%VCINSTALLDIR%\CE\ATLMFC\INCLUDE;%VCINSTALLDIR%\CE\INCLUDE;C:\Program
Files\Windows Mobile 5.0 SDK R2\Smartphone\include\armv4i;%INCLUDE%
SET LIB=%VCINSTALLDIR%\CE\ATLMFC\LIB\%RUNTIME%;%VCINSTALLDIR%\CE\LIB\%RUNTIME%;c:\Program
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++
 	XSDETest.exe!std::_Container_base_secure::~_Container_base_secure(void)
Line: 117, Byte Offsets: 0x14	C++
 	XSDETest.exe!std::_String_base::~_String_base(void) Line: 0, Byte
Offsets: 0xffffffff	C++
 	XSDETest.exe!std::_String_val<char,std::allocator<char>
>::~_String_val<char,std::allocator<char> >(void) Line: 0, Byte
Offsets: 0xffffffff	C++
 	XSDETest.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char>
>::~basic_string<char,std::char_traits<char>,std::allocator<char>
>(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	
 	XML_Parse	
 	XML_Parse	
 	XML_Parse	
 	XML_Parse	
 	XML_Parse	
 	XML_ParseBuffer	
 	?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