[xsd-users] Problem in translating schema to C++ (following parser guide)

Pedro pmonteirorocha at sapo.pt
Sun Jul 4 18:54:05 EDT 2010


On 04-07-2010 21:06, Boris Kolpackov wrote:
> Hi Pedro,
>
> Pedro<pmonteirorocha at sapo.pt>  writes:
>
>    
>> Used the package from the Ubuntu repository, and then switched to the
>> xsd package from codesynthesis.com. Same error, nothing changed.
>>      
> Ok, this gets even stranger. The xsd binary in the package from our
> website is statically linked to everything except libc. So this has
> nothing to do with libstdc++. Can you send me the stack trace of
> the crash (using  xsd from codesynthesis.com) by doing the following:
>
> $ ulimit -c unlimit
> $ path/to/xsd  # trigger the crash; this should produce core
> $ gdb path/to/xsd core
>
> Once the gdb prompt appears, type 'bt' and copy the stack trace
> to an email.
>
> Boris
>    
Hmm, the gdb command does not accept arguments into the executable that 
we are trying to execute, so I did it in a diferent way. I searched 
arround and I think I did everything correctly. The steps and results 
are shown below:

pedro at Ubt-Pedro:~/Transferências/xsd-3.3.0-i686-linux-gnu/bin$ gdb ./xsd
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Lendo símbolos de 
/home/pedro/Transferências/xsd-3.3.0-i686-linux-gnu/bin/xsd...concluído.
(gdb) run cxx-parser --xml-parser expat hello.xsd
Starting program: 
/home/pedro/Transferências/xsd-3.3.0-i686-linux-gnu/bin/xsd cxx-parser 
--xml-parser expat hello.xsd
terminate called after throwing an instance of 'std::length_error'
   what():  basic_string::resize

Program received signal SIGABRT, Aborted.
0x0012d422 in __kernel_vsyscall ()
(gdb) bt
#0  0x0012d422 in __kernel_vsyscall ()
#1  0x00198651 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0x0019ba82 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0x085b3591 in __gnu_cxx::__verbose_terminate_handler ()
     at ../../../../src/gcc-3.4.4/libstdc++-v3/libsupc++/vterminate.cc:96
#4  0x085b1365 in __cxxabiv1::__terminate (
     handler=0x85b3490 <__gnu_cxx::__verbose_terminate_handler()>)
     at ../../../../src/gcc-3.4.4/libstdc++-v3/libsupc++/eh_terminate.cc:43
#5  0x085b13a2 in std::terminate ()
     at ../../../../src/gcc-3.4.4/libstdc++-v3/libsupc++/eh_terminate.cc:53
#6  0x085b1522 in __cxa_throw (obj=0x89b4710, tinfo=0x0, dest=0)
     at ../../../../src/gcc-3.4.4/libstdc++-v3/libsupc++/eh_throw.cc:80
#7  0x0856109d in std::__throw_length_error (__s=0x0)
     at 
/home/boris/build/gcc/gcc-3.4.4-i686-linux-gnu/i686-unknown-linux-gnu/libstdc++-v3/include/ext/new_allocator.h:69
#8  0x085ac9cc in std::basic_string<wchar_t, std::char_traits<wchar_t>, 
std::allocator<wchar_t> >::resize (this=0xbfffda70, __n=4294967295, 
__c=0 L'\000')
     at 
/home/boris/build/gcc/gcc-3.4.4-i686-linux-gnu/i686-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:576
#9  0x0831d553 in XSDFrontend::Parser::Impl::dom(boost::filesystem::path 
const&, bool) ()
#10 0x0833a4a7 in 
XSDFrontend::Parser::Impl::parse(boost::filesystem::path const&) ()
#11 0x0833bb0d in XSDFrontend::Parser::parse(boost::filesystem::path 
const&) ()
---Type <return> to continue, or q <return> to quit---
#12 0x08053ffc in main ()
(gdb)


I did a second try, to include the core file generated before:

pedro at Ubt-Pedro:~/Transferências/xsd-3.3.0-i686-linux-gnu/bin$ gdb ./xsd
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Lendo símbolos de 
/home/pedro/Transferências/xsd-3.3.0-i686-linux-gnu/bin/xsd...concluído.
(gdb) run cxx-parser --xml-parser expat hello.xsd core
Starting program: 
/home/pedro/Transferências/xsd-3.3.0-i686-linux-gnu/bin/xsd cxx-parser 
--xml-parser expat hello.xsd core
terminate called after throwing an instance of 'std::length_error'
   what():  basic_string::resize

Program received signal SIGABRT, Aborted.
0x0012d422 in __kernel_vsyscall ()
(gdb) bt
#0  0x0012d422 in __kernel_vsyscall ()
#1  0x00198651 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0x0019ba82 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0x085b3591 in __gnu_cxx::__verbose_terminate_handler ()
     at ../../../../src/gcc-3.4.4/libstdc++-v3/libsupc++/vterminate.cc:96
#4  0x085b1365 in __cxxabiv1::__terminate (
     handler=0x85b3490 <__gnu_cxx::__verbose_terminate_handler()>)
     at ../../../../src/gcc-3.4.4/libstdc++-v3/libsupc++/eh_terminate.cc:43
#5  0x085b13a2 in std::terminate ()
     at ../../../../src/gcc-3.4.4/libstdc++-v3/libsupc++/eh_terminate.cc:53
#6  0x085b1522 in __cxa_throw (obj=0x89b4740, tinfo=0x0, dest=0)
     at ../../../../src/gcc-3.4.4/libstdc++-v3/libsupc++/eh_throw.cc:80
#7  0x0856109d in std::__throw_length_error (__s=0x0)
     at 
/home/boris/build/gcc/gcc-3.4.4-i686-linux-gnu/i686-unknown-linux-gnu/libstdc++-v3/include/ext/new_allocator.h:69
#8  0x085ac9cc in std::basic_string<wchar_t, std::char_traits<wchar_t>, 
std::allocator<wchar_t> >::resize (this=0xbfffda70, __n=4294967295, 
__c=0 L'\000')
     at 
/home/boris/build/gcc/gcc-3.4.4-i686-linux-gnu/i686-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:576
#9  0x0831d553 in XSDFrontend::Parser::Impl::dom(boost::filesystem::path 
const&, bool) ()
#10 0x0833a4a7 in 
XSDFrontend::Parser::Impl::parse(boost::filesystem::path const&) ()
---Type <return> to continue, or q <return> to quit---
#11 0x0833bb0d in XSDFrontend::Parser::parse(boost::filesystem::path 
const&) ()
#12 0x08053ffc in main ()
(gdb)

I hope this gives some clue to what's happening, and that every thing 
was done correctly.
Thank you for your support.

Pedro Rocha.







More information about the xsd-users mailing list