[wave] cw-8.3 segfault..

Hartmut, Don't know is this will help at all.. But this is the stack trace for the crash for testwave built with CW-8.3: ==========
testwave.exe!boost::spirit::multi_pass_policies::buf_id_check::check() const(buf_id_check * this=0xcccccccc) Line 195 + 0xb C++ testwave.exe! ?? ?? :: ?? ::operator*(multi_pass * this=0x0012eb0c) Line 1005 C++ testwave.exe!?get@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_match_po(iteration_policy * this=0x0012eb40, scanner & scan={...}) Line 50 + 0xb C++ testwave.exe! ?? ?? :: ?? ::operator*(scanner * this=0xcccccccc) Line 251 + 0xb C++ testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_match_(char_parser * this=0xcccccccc, scanner & scan={...}) Line 50 C++ testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_match_(kleene_star * this=0xcccccccc, scanner & scan={...}) Line 58 + 0x19 C++ testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_match_(sequence * this=0xcccccccc, scanner & scan={...}) Line 54 + 0x16 C++ testwave.exe! ?? ?? :: ?? ::do_parse_virtual(concrete_parser * this=0x0012ed30, scanner & scan={...}) Line 233 + 0x11 C++ testwave.exe!?parse_main@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_m(rule_base * this=0x00138078, scanner & scan={...}) Line 189 + 0x19 C++ testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_match_(rule_base * this=0xcccccccc, scanner & scan={...}) Line 172 + 0x48 C++ testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_match_(optional * this=0xcccccccc, scanner & scan={...}) Line 54 + 0x16 C++ testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_match_(sequence * this=0xcccccccc, scanner & scan={...}) Line 54 + 0x16 C++ testwave.exe!?do_parse_virtual@?$concrete_parser@U?$sequence@U?$sequence@U?$alternative@U?$alternative@U?$chlit@W4token_id@wave@boost@@@spirit@boost@@U?$pattern_and@W4token_category@wave@boost@@@util@wave@3@@spirit@boost@@U?$pattern_and@H@util@wave@3@@spirit@boost@@U?(concrete_parser * this=0x0012eebc, scanner & scan={...}) Line 233 + 0x11 C++ testwave.exe!?parse_main@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_m(rule_base * this=0x00138070, scanner & scan={...}) Line 189 + 0x19 C++ testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_match_(rule_base * this=0xcccccccc, scanner & scan={...}) Line 172 + 0x48 C++ testwave.exe!?do_@?$@V?$tree_match@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@V?$node_val_data_factory@Unil_t@spirit@boost@@@spirit@4@Unil_t@(tree_match & result={...}, definition & def={...}, scanner & scan={...}) Line 262 + 0x16 C++ testwave.exe!?grammar_parser_parse@?$@$0A@Upredefined_macros_grammar@grammars@wave@boost@@U?$parser_context@Unil_t@spirit@boost@@@spirit@4@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave(grammar * self=0x0012f058, scanner & scan={...}) Line 281 + 0xf C++ testwave.exe!?parse_main@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_m(grammar * this=0x0012efec, scanner & scan={...}) Line 55 + 0x1f C++ testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_match_(grammar * this=0xcccccccc, scanner & scan={...}) Line 63 + 0x48 C++ testwave.exe!?pt_parse@?$@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@Upredefined_macros_grammar@grammars@34@@spirit@4@YA?AU?$tree_parse_info@(lex_iterator & first_={...}, lex_iterator & last={...}, parser & parser={...}) Line 229 C++ testwave.exe!boost::wave::grammars::predefined_macros_grammar_gen<class boost::wave::cpplexer::lex_iterator<class boost::wave::cpplexer::lex_token<struct boost::wave::util::file_position<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > >
::parse_predefined_macro( ?? )(lex_iterator & first={...}, lex_iterator & last={...}) Line 153 + 0x13 C++
testwave.exe!?add_macro_definition@?$@V?$context@V?$__wrap_iterator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PB$$CBD@std@@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@(context & ctx=, basic_string & macrostring=, bool is_predefined=, language_support language=) Line 154 + 0x4a C++ ========== All those this=0xcccccccc, is CodeWarrior's way of saying one has a refenrence to a deleted object. As that's the value it clears memory to when it deletes. -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - Grafik/jabber.org

Hartmut Kaiser wrote:
Rene,
Don't know is this will help at all.. But this is the stack trace for the crash for testwave built with CW-8.3:
Thanks a lot! And yes, I think it helped. Could you please send me a stack backtrace again if it still crashes?
Still crashes... ==========
testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_match_(kleene_star * this=0xcccccccc, scanner & scan={...}) Line 57 + 0x3 C++ testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_match_(sequence * this=0xcccccccc, scanner & scan={...}) Line 54 + 0x16 C++ testwave.exe!?parse_main@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_m(rule_base * this=0x00138078, scanner & scan={...}) Line 189 + 0x19 C++ testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_match_(rule_base * this=0xcccccccc, scanner & scan={...}) Line 172 + 0x48 C++ testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_match_(optional * this=0xcccccccc, scanner & scan={...}) Line 54 + 0x16 C++ testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_match_(sequence * this=0xcccccccc, scanner & scan={...}) Line 54 + 0x16 C++ testwave.exe!?do_parse_virtual@?$concrete_parser@U?$sequence@U?$sequence@U?$alternative@U?$alternative@U?$chlit@W4token_id@wave@boost@@@spirit@boost@@U?$pattern_and@W4token_category@wave@boost@@@util@wave@3@@spirit@boost@@U?$pattern_and@H@util@wave@3@@spirit@boost@@U?(concrete_parser * this=0x0012ee9c, scanner & scan={...}) Line 233 + 0x11 C++ testwave.exe!?parse_main@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_m(rule_base * this=0x00138070, scanner & scan={...}) Line 189 + 0x19 C++ testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_match_(rule_base * this=0xcccccccc, scanner & scan={...}) Line 172 + 0x48 C++ testwave.exe!?do_@?$@V?$tree_match@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@V?$node_val_data_factory@Unil_t@spirit@boost@@@spirit@4@Unil_t@(tree_match & result={...}, definition & def={...}, scanner & scan={...}) Line 262 + 0x16 C++ testwave.exe!?grammar_parser_parse@?$@$0A@Upredefined_macros_grammar@grammars@wave@boost@@U?$parser_context@Unil_t@spirit@boost@@@spirit@4@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave(grammar * self=0x0012f038, scanner & scan={...}) Line 281 + 0xf C++ testwave.exe!?parse_main@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_m(grammar * this=0x0012efcc, scanner & scan={...}) Line 55 + 0x1f C++ testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit@boost@@U?$pt_match_(grammar * this=0xcccccccc, scanner & scan={...}) Line 63 + 0x48 C++ testwave.exe!?pt_parse@?$@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wave@boost@@Upredefined_macros_grammar@grammars@34@@spirit@4@YA?AU?$tree_parse_info@(lex_iterator & first_={...}, lex_iterator & last={...}, parser & parser={...}) Line 229 C++ testwave.exe!boost::wave::grammars::predefined_macros_grammar_gen<class boost::wave::cpplexer::lex_iterator<class boost::wave::cpplexer::lex_token<struct boost::wave::util::file_position<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > >
::parse_predefined_macro( ?? )(lex_iterator & first={...}, lex_iterator & last={...}) Line 153 + 0x12 C++
testwave.exe!?add_macro_definition@?$@V?$context@V?$__wrap_iterator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PB$$CBD@std@@V?$lex_iterator@V?$lex_token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@util@wave@boost@(context & ctx=, basic_string & macrostring=, bool is_predefined=, language_support language=) Line 154 + 0x4a C++ ========== -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - Grafik/jabber.org

Rene Rivera wrote:
Don't know is this will help at all.. But this is the stack trace for the crash for testwave built with CW-8.3:
Thanks a lot! And yes, I think it helped. Could you please send me a stack backtrace again if it still crashes?
Still crashes...
This I don't understand anymore. The code in question is: some_spirit_grammar g; boost::spirit::pt_parse(it, end, g); the programm crashes inside pt_parse because of g == 0xcccccccc (destroyed object), where pt_parse takes 'g' by const reference. Initially 'g' was defined as a function local static instance, which I've removed now because I had the suspicion CW8.x couldn't handle that correctly. Any clues? Regards Hartmut
==========
testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token @U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$al locator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpp lexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit @boost@@U?$pt_match_(kleene_star * this=0xcccccccc, scanner & scan={...}) Line 57 + 0x3 C++
testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token @U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$al locator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpp lexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit @boost@@U?$pt_match_(sequence * this=0xcccccccc, scanner & scan={...}) Line 54 + 0x16 C++
testwave.exe!?parse_main@?$@V?$scanner@V?$lex_iterator@V?$lex_ token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@ V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@ @@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@s pirit@boost@@U?$pt_m(rule_base * this=0x00138078, scanner & scan={...}) Line 189 + 0x19 C++
testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token @U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$al locator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpp lexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit @boost@@U?$pt_match_(rule_base * this=0xcccccccc, scanner & scan={...}) Line 172 + 0x48 C++
testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token @U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$al locator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpp lexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit @boost@@U?$pt_match_(optional * this=0xcccccccc, scanner & scan={...}) Line 54 + 0x16 C++
testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token @U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$al locator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpp lexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit @boost@@U?$pt_match_(sequence * this=0xcccccccc, scanner & scan={...}) Line 54 + 0x16 C++
testwave.exe!?do_parse_virtual@?$concrete_parser@U?$sequence@U ?$sequence@U?$alternative@U?$alternative@U?$chlit@W4token_id@w ave@boost@@@spirit@boost@@U?$pattern_and@W4token_category@wave @boost@@@util@wave@3@@spirit@boost@@U?$pattern_and@H@util@wave @3@@spirit@boost@@U?(concrete_parser * this=0x0012ee9c, scanner & scan={...}) Line 233 + 0x11 C++
testwave.exe!?parse_main@?$@V?$scanner@V?$lex_iterator@V?$lex_ token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@ V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@ @@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@s pirit@boost@@U?$pt_m(rule_base * this=0x00138070, scanner & scan={...}) Line 189 + 0x19 C++
testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token @U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$al locator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpp lexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit @boost@@U?$pt_match_(rule_base * this=0xcccccccc, scanner & scan={...}) Line 172 + 0x48 C++
testwave.exe!?do_@?$@V?$tree_match@V?$lex_iterator@V?$lex_toke n@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$a llocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cp plexer@wave@boost@@V?$node_val_data_factory@Unil_t@spirit@boos t@@@spirit@4@Unil_t@(tree_match & result={...}, definition & def={...}, scanner & scan={...}) Line 262 + 0x16 C++
testwave.exe!?grammar_parser_parse@?$@$0A@Upredefined_macros_g rammar@grammars@wave@boost@@U?$parser_context@Unil_t@spirit@bo ost@@@spirit@4@V?$scanner@V?$lex_iterator@V?$lex_token@U?$file _position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@ D@2@@std@@@util@wave(grammar * self=0x0012f038, scanner & scan={...}) Line 281 + 0xf C++
testwave.exe!?parse_main@?$@V?$scanner@V?$lex_iterator@V?$lex_ token@U?$file_position@V?$basic_string@DU?$char_traits@D@std@@ V?$allocator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@ @@cpplexer@wave@boost@@U?$scanner_policies@Uiteration_policy@s pirit@boost@@U?$pt_m(grammar * this=0x0012efcc, scanner & scan={...}) Line 55 + 0x1f C++
testwave.exe!?parse@?$@V?$scanner@V?$lex_iterator@V?$lex_token @U?$file_position@V?$basic_string@DU?$char_traits@D@std@@V?$al locator@D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpp lexer@wave@boost@@U?$scanner_policies@Uiteration_policy@spirit @boost@@U?$pt_match_(grammar * this=0xcccccccc, scanner & scan={...}) Line 63 + 0x48 C++
testwave.exe!?pt_parse@?$@V?$lex_iterator@V?$lex_token@U?$file _position@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@ D@2@@std@@@util@wave@boost@@@cpplexer@wave@boost@@@cpplexer@wa ve@boost@@Upredefined_macros_grammar@grammars@34@@spirit@4@YA? AU?$tree_parse_info@(lex_iterator & first_={...}, lex_iterator & last={...}, parser & parser={...}) Line 229 C++
testwave.exe!boost::wave::grammars::predefined_macros_grammar_ gen<class boost::wave::cpplexer::lex_iterator<class boost::wave::cpplexer::lex_token<struct boost::wave::util::file_position<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > >::parse_predefined_macro( ?? )(lex_iterator & first={...}, lex_iterator & last={...}) Line 153 + 0x12 C++
testwave.exe!?add_macro_definition@?$@V?$context@V?$__wrap_ite rator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@ @std@@PB$$CBD@std@@V?$lex_iterator@V?$lex_token@U?$file_positi on@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@st d@@@util@wave@boost@(context & ctx=, basic_string & macrostring=, bool is_predefined=, language_support language=) Line 154 + 0x4a C++ ==========
-- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - Grafik/jabber.org
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Hartmut Kaiser <hartmut.kaiser@gmail.com> writes:
This I don't understand anymore. The code in question is:
some_spirit_grammar g; boost::spirit::pt_parse(it, end, g);
the programm crashes inside pt_parse because of g == 0xcccccccc (destroyed object), where pt_parse takes 'g' by const reference. Initially 'g' was defined as a function local static instance, which I've removed now because I had the suspicion CW8.x couldn't handle that correctly.
Any clues? Regards Hartmut
Are you running into the CW 8.3 "CRTP bug" where casting to a derived class reference can induce a copy? -- Dave Abrahams Boost Consulting www.boost-consulting.com

David Abrahams wrote:
This I don't understand anymore. The code in question is:
some_spirit_grammar g; boost::spirit::pt_parse(it, end, g);
the programm crashes inside pt_parse because of g == 0xcccccccc (destroyed object), where pt_parse takes 'g' by const reference. Initially 'g' was defined as a function local static instance, which I've removed now because I had the suspicion CW8.x couldn't handle that correctly.
Any clues? Regards Hartmut
Are you running into the CW 8.3 "CRTP bug" where casting to a derived class reference can induce a copy?
That's possible, since Spirit passes the parser<> base class around and casts it to the correct derived class (type supplied through CRTP) when needed. Is there a known workaround? OTOH all the Spirit tests should fail if this assumption is correct. Regards Hartmut

Hartmut Kaiser <hartmut.kaiser@gmail.com> writes:
David Abrahams wrote:
This I don't understand anymore. The code in question is:
some_spirit_grammar g; boost::spirit::pt_parse(it, end, g);
the programm crashes inside pt_parse because of g == 0xcccccccc (destroyed object), where pt_parse takes 'g' by const reference. Initially 'g' was defined as a function local static instance, which I've removed now because I had the suspicion CW8.x couldn't handle that correctly.
Any clues? Regards Hartmut
Are you running into the CW 8.3 "CRTP bug" where casting to a derived class reference can induce a copy?
That's possible, since Spirit passes the parser<> base class around and casts it to the correct derived class (type supplied through CRTP) when needed. Is there a known workaround?
Yes, use *static_cast<Derived*>(this) instead of static_cast<Derived&>(*this)
OTOH all the Spirit tests should fail if this assumption is correct.
I wouldn't count on it. Temporaries can be deceptive. The memory may remain valid after destruction. -- Dave Abrahams Boost Consulting www.boost-consulting.com

David Abrahams wrote:
This I don't understand anymore. The code in question is:
some_spirit_grammar g; boost::spirit::pt_parse(it, end, g);
the programm crashes inside pt_parse because of g == 0xcccccccc (destroyed object), where pt_parse takes 'g' by const reference. Initially 'g' was defined as a function local static instance, which I've removed now because I had the suspicion CW8.x couldn't handle that correctly.
Any clues? Regards Hartmut
Are you running into the CW 8.3 "CRTP bug" where casting to a derived class reference can induce a copy?
That's possible, since Spirit passes the parser<> base class around and casts it to the correct derived class (type supplied through CRTP) when needed. Is there a known workaround?
Yes, use
*static_cast<Derived*>(this)
instead of
static_cast<Derived&>(*this)
Spirit does it this way (*static_cast<Derived*>(this)) and Wave simply relies on Spirit. Seems that it's not the CRTP bug then. *sigh*
OTOH all the Spirit tests should fail if this assumption is correct.
I wouldn't count on it. Temporaries can be deceptive. The memory may remain valid after destruction.
Agreed. Regards Hartmut
participants (3)
-
David Abrahams
-
Hartmut Kaiser
-
Rene Rivera