Opened 15 years ago

Closed 12 years ago

Last modified 12 years ago

#1276 closed Bugs (wontfix)

spirit problem with _GLIBCXX_DEBUG

Reported by: tim@… Owned by: Joel de Guzman
Milestone: To Be Determined Component: spirit
Version: Boost 1.34.1 Severity: Problem
Keywords: Cc: tim@…

Description

hi all,

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:

/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;
}

the relevant part of the backtrace is:

>  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<__gnu_cxx::__normal_iterator<const
char*,std::__norm::vector<char,std::allocator<char> >
>,std::__debug::vector<char,std::allocator<char> > >::_Safe_iterator
PC=0xb5f10d59, FP=0xbfe465c8 [/usr/include/c++/4.2/debug/
safe_iterator.h#128]
   4
boost::iterator_adaptor<boost::spirit::position_iterator<__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<const
char*,std::__norm::vector<char,std::allocator<char> >
>,std::__debug::vector<char,std::allocator<char> >
>,boost::spirit::file_position_base<std::string>,boost::spirit::nil_t>,__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<const
char*,std::__norm::vector<char,std::allocator<char> >
>,std::__debug::vector<char,std::allocator<char> > >,const
char,boost::use_default,boost::use_default,boost::use_default>::not-in-
charge iterator_adaptor PC=0xb5f10dbc, FP=0xbfe465e8 [/usr/include/boost/
iterator/iterator_adaptor.hpp#277]
   5
boost::spirit::position_iterator<__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<const
char*,std::__norm::vector<char,std::allocator<char> >
>,std::__debug::vector<char,std::allocator<char> >
>,boost::spirit::file_position_base<std::string>,boost::spirit::nil_t>::position_iterator
PC=0xb5f2fa36, FP=0xbfe46618 [/usr/include/boost/spirit/iterator/
position_iterator.hpp#217]
   6
boost::spirit::scanner<boost::spirit::position_iterator<__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<const
char*,std::__norm::vector<char,std::allocator<char> >
>,std::__debug::vector<char,std::allocator<char> >
>,boost::spirit::file_position_base<std::string>,boost::spirit::nil_t>,boost::spirit::scanner_policies<boost::spirit::iteration_policy,boost::spirit::match_policy,boost::spirit::action_policy>
>::scanner PC=0xb5f2fafc, FP=0xbfe46648 [/usr/include/boost/spirit/core/
scanner/scanner.hpp#231]
   7
boost::spirit::parse<boost::spirit::position_iterator<__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<const
char*,std::__norm::vector<char,std::allocator<char> >
>,std::__debug::vector<char,std::allocator<char> >
>,boost::spirit::file_position_base<std::string>,boost::spirit::nil_t>,boost::property_tree::xml_parser::xml_grammar<boost::property_tree::basic_ptree<std::less<std::string>,std::string,boost::property_tree::basic_path<std::string>,std::string,boost::property_tree::translator>
> > 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<boost::property_tree::basic_ptree<std::less<std::string>,std::string,boost::property_tree::basic_path<std::string>,std::string,boost::property_tree::translator>
> PC=0xb5f63a58, FP=0xbfe46ab8 [/home/tim/workspace/nova/libs/
property_tree/boost/property_tree/xml_parser.hpp#58]

joel de guzman stated, that it seems to be a problem with spirit: http://thread.gmane.org/gmane.comp.lib.boost.devel/165261/focus=165286

best, tim

Change History (5)

comment:1 by Joel de Guzman, 15 years ago

Hi Tim, I'm not sure how to reproduce this. What cpp file should I be running?

comment:2 by tim@…, 15 years ago

i had this issue, within my application ... not sure, maybe it can be reproduced with the testsuite of boost::property_tree?

comment:3 by tim@…, 15 years ago

yes test_xml_parser_spirit.cpp triggers this error:

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

comment:4 by Joel de Guzman, 12 years ago

Resolution: wontfix
Status: newclosed

comment:5 by Vicente Botet <vicente.botet@…>, 12 years ago

Could you clarify why you don't want to fix it?

Note: See TracTickets for help on using tickets.