Subject: [Boost-bugs] [Boost C++ Libraries] #10194: basic_xml_grammar<wchar_t> parses class_id failed
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-07-14 16:02:00
#10194: basic_xml_grammar<wchar_t> parses class_id failed
------------------------------------+------------------------------
Reporter: Andrew Xu <xulei.js@â¦> | Type: Bugs
Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.54.0
Severity: Problem | Keywords:
------------------------------------+------------------------------
I found this issue when I used xml wserialization to save config in
polymorphic case. After debugging, I found basic_xml_grammar<wchar_t>
failed to parse "class_id" under some conditions. There are some info for
this issue:
1. Compile with NDEBUG, without NDEBUG no this issue.
2. basic_xml_grammar<char> works fine.
3. Compile with GCC (when compile with VS2010, no this issue)
Detail of GCC:
gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-
bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-
shared --enable-threads=posix --enable-checking=release --with-system-zlib
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-
object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-
java-awt=gtk --disable-dssi --with-java-
home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile
--enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-
ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-
tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
I trimmed the test code:
#include <boost/archive/impl/basic_xml_grammar.hpp>
#include <fstream>
#include <iostream>
using namespace boost::archive;
int main()
{
std::wifstream ifs("./dashboard.xml");
if (ifs) {
basic_xml_grammar<wchar_t> xmlGrammer;
xmlGrammer.parse_start_tag(ifs);
std::wcout << "rv.class_id=" << xmlGrammer.rv.class_id <<
std::endl;
}
else {
std::cout << "File doesn't exist." << std::endl;
}
return 0;
}
and the dashboard.xml is very simple with only one line:
<item class_id="4" class_name="ComponentDataChart" tracking_level="1"
version="4" object_id="_3">
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10194> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC