Boost C++ Libraries: Ticket #1276: spirit problem with _GLIBCXX_DEBUG https://svn.boost.org/trac10/ticket/1276 <p> hi all, </p> <p> when compiling the xml parser to boost::property_tree with gcc and defining _GLIBCXX_DEBUG to enable stl debugging, my applications aborts with the following message: </p> <pre class="wiki">/usr/include/c++/4.2/debug/safe_iterator.h:131:error: attempt to copy- construct an iterator from a singular iterator. Objects involved in the operation: iterator "this" @ 0x0xbfe46690 { type = N11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPKcNSt6__norm6vectorIcSaIcEEEEENSt7__debug6vectorIcS7_EEEE (constant iterator); state = singular; } iterator "other" @ 0x0xbfe467e0 { type = N11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPKcNSt6__norm6vectorIcSaIcEEEEENSt7__debug6vectorIcS7_EEEE (constant iterator); state = singular; } </pre><p> the relevant part of the backtrace is: </p> <pre class="wiki">&gt; 0 Unknown PC=0xffffe410, FP=0xbfe4626c 1 abort PC=0xb7ddc17c, FP=0xbfe46398 [/lib/i686/cmov/ libc.so.6] 2 _ZNK11__gnu_debug16_Error_formatter8_M_errorEv PC=0xb773c781, FP=0xbfe46458 [/usr/lib/libstdc++.so.6] 3 __gnu_debug::_Safe_iterator&lt;__gnu_cxx::__normal_iterator&lt;const char*,std::__norm::vector&lt;char,std::allocator&lt;char&gt; &gt; &gt;,std::__debug::vector&lt;char,std::allocator&lt;char&gt; &gt; &gt;::_Safe_iterator PC=0xb5f10d59, FP=0xbfe465c8 [/usr/include/c++/4.2/debug/ safe_iterator.h#128] 4 boost::iterator_adaptor&lt;boost::spirit::position_iterator&lt;__gnu_debug::_Safe_iterator&lt;__gnu_cxx::__normal_iterator&lt;const char*,std::__norm::vector&lt;char,std::allocator&lt;char&gt; &gt; &gt;,std::__debug::vector&lt;char,std::allocator&lt;char&gt; &gt; &gt;,boost::spirit::file_position_base&lt;std::string&gt;,boost::spirit::nil_t&gt;,__gnu_debug::_Safe_iterator&lt;__gnu_cxx::__normal_iterator&lt;const char*,std::__norm::vector&lt;char,std::allocator&lt;char&gt; &gt; &gt;,std::__debug::vector&lt;char,std::allocator&lt;char&gt; &gt; &gt;,const char,boost::use_default,boost::use_default,boost::use_default&gt;::not-in- charge iterator_adaptor PC=0xb5f10dbc, FP=0xbfe465e8 [/usr/include/boost/ iterator/iterator_adaptor.hpp#277] 5 boost::spirit::position_iterator&lt;__gnu_debug::_Safe_iterator&lt;__gnu_cxx::__normal_iterator&lt;const char*,std::__norm::vector&lt;char,std::allocator&lt;char&gt; &gt; &gt;,std::__debug::vector&lt;char,std::allocator&lt;char&gt; &gt; &gt;,boost::spirit::file_position_base&lt;std::string&gt;,boost::spirit::nil_t&gt;::position_iterator PC=0xb5f2fa36, FP=0xbfe46618 [/usr/include/boost/spirit/iterator/ position_iterator.hpp#217] 6 boost::spirit::scanner&lt;boost::spirit::position_iterator&lt;__gnu_debug::_Safe_iterator&lt;__gnu_cxx::__normal_iterator&lt;const char*,std::__norm::vector&lt;char,std::allocator&lt;char&gt; &gt; &gt;,std::__debug::vector&lt;char,std::allocator&lt;char&gt; &gt; &gt;,boost::spirit::file_position_base&lt;std::string&gt;,boost::spirit::nil_t&gt;,boost::spirit::scanner_policies&lt;boost::spirit::iteration_policy,boost::spirit::match_policy,boost::spirit::action_policy&gt; &gt;::scanner PC=0xb5f2fafc, FP=0xbfe46648 [/usr/include/boost/spirit/core/ scanner/scanner.hpp#231] 7 boost::spirit::parse&lt;boost::spirit::position_iterator&lt;__gnu_debug::_Safe_iterator&lt;__gnu_cxx::__normal_iterator&lt;const char*,std::__norm::vector&lt;char,std::allocator&lt;char&gt; &gt; &gt;,std::__debug::vector&lt;char,std::allocator&lt;char&gt; &gt; &gt;,boost::spirit::file_position_base&lt;std::string&gt;,boost::spirit::nil_t&gt;,boost::property_tree::xml_parser::xml_grammar&lt;boost::property_tree::basic_ptree&lt;std::less&lt;std::string&gt;,std::string,boost::property_tree::basic_path&lt;std::string&gt;,std::string,boost::property_tree::translator&gt; &gt; &gt; PC=0xb5f5d76e, FP=0xbfe46718 [/usr/include/boost/spirit/core/impl/ parser.ipp#27] 8 _ZN5boost13property_tree10xml_parser17read_xml_internalINS0_11basic_ptreeISt4lessISsESsNS0_10basic_pathISsEESsNS0_10translatorEEEEEvRSt13basic_istreamINT_8key_type10value_typeESt11char_traitsISD_EERSB_iRKSs PC=0xb5f635fa, FP=0xbfe46948 [/home/tim/workspace/nova/libs/property_tree/ boost/property_tree/detail/xml_parser_read_spirit.hpp#721] 9 boost::property_tree::xml_parser::read_xml&lt;boost::property_tree::basic_ptree&lt;std::less&lt;std::string&gt;,std::string,boost::property_tree::basic_path&lt;std::string&gt;,std::string,boost::property_tree::translator&gt; &gt; PC=0xb5f63a58, FP=0xbfe46ab8 [/home/tim/workspace/nova/libs/ property_tree/boost/property_tree/xml_parser.hpp#58] </pre><p> joel de guzman stated, that it seems to be a problem with spirit: <a class="ext-link" href="http://thread.gmane.org/gmane.comp.lib.boost.devel/165261/focus=165286"><span class="icon">​</span>http://thread.gmane.org/gmane.comp.lib.boost.devel/165261/focus=165286</a> </p> <p> best, tim </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1276 Trac 1.4.3 Joel de Guzman Wed, 28 Nov 2007 17:30:59 GMT <link>https://svn.boost.org/trac10/ticket/1276#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1276#comment:1</guid> <description> <p> Hi Tim, I'm not sure how to reproduce this. What cpp file should I be running? </p> </description> <category>Ticket</category> </item> <item> <author>tim@…</author> <pubDate>Wed, 28 Nov 2007 18:03:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1276#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1276#comment:2</guid> <description> <p> i had this issue, within my application ... not sure, maybe it can be reproduced with the testsuite of boost::property_tree? </p> </description> <category>Ticket</category> </item> <item> <author>tim@…</author> <pubDate>Wed, 28 Nov 2007 18:11:19 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1276#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1276#comment:3</guid> <description> <p> yes test_xml_parser_spirit.cpp triggers this error: </p> <pre class="wiki">cd boost/libs/property_tree/test g++ -I ../../.. -D_GLIBCXX_DEBUG test_xml_parser_spirit.cpp ./a.out (progress) Starting generic parser test with test file "testok1.xml" /usr/include/c++/4.2/debug/safe_iterator.h:131:error: attempt to copy- construct an iterator from a singular iterator. Objects involved in the operation: iterator "this" @ 0x0xbf86c6b4 { type = N11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPKcNSt6__norm6vectorIcSaIcEEEEENSt7__debug6vectorIcS7_EEEE (constant iterator); state = singular; } iterator "other" @ 0x0xbf86c7f4 { type = N11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPKcNSt6__norm6vectorIcSaIcEEEEENSt7__debug6vectorIcS7_EEEE (constant iterator); state = singular; } **** no errors detected </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Thu, 02 Dec 2010 02:49:09 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/1276#comment:4 https://svn.boost.org/trac10/ticket/1276#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> Ticket Vicente Botet <vicente.botet@…> Fri, 10 Dec 2010 18:58:44 GMT <link>https://svn.boost.org/trac10/ticket/1276#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1276#comment:5</guid> <description> <p> Could you clarify why you don't want to fix it? </p> </description> <category>Ticket</category> </item> </channel> </rss>