Open mingodad opened 1 year ago
After replacing all auto g =
by auto &g =
and Grammar g =
by Grammar &g =
in test3.cc
no more segfaults but some tests fail:
==25818== Memcheck, a memory error detector
==25818== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==25818== Using Valgrind-3.21.0 and LibVEX; rerun with -h for copyright info
==25818== Command: ./test-main
==25818==
Running main() from /home/mingo/dev/c/A_grammars/cpp-peglib-last/build/_deps/googletest-src/googletest/src/gtest_main.cc
[==========] Running 169 tests from 17 test suites.
[----------] Global test environment set-up.
[----------] 64 tests from GeneralTest
[ RUN ] GeneralTest.Simple_syntax_test_with_unicode
[ OK ] GeneralTest.Simple_syntax_test_with_unicode (1054 ms)
[ RUN ] GeneralTest.Simple_syntax_test
[ OK ] GeneralTest.Simple_syntax_test (29 ms)
[ RUN ] GeneralTest.Empty_syntax_test
[ OK ] GeneralTest.Empty_syntax_test (4 ms)
[ RUN ] GeneralTest.Start_rule_with_ignore_operator_test
[ OK ] GeneralTest.Start_rule_with_ignore_operator_test (29 ms)
[ RUN ] GeneralTest.Invalid_UTF8_text_test
[ OK ] GeneralTest.Invalid_UTF8_text_test (15 ms)
[ RUN ] GeneralTest.Backslash_escape_sequence_test
[ OK ] GeneralTest.Backslash_escape_sequence_test (28 ms)
[ RUN ] GeneralTest.Invalid_escape_sequence_test
[ OK ] GeneralTest.Invalid_escape_sequence_test (29 ms)
[ RUN ] GeneralTest.Action_taking_non_const_Semantic_Values_parameter
[ OK ] GeneralTest.Action_taking_non_const_Semantic_Values_parameter (80 ms)
[ RUN ] GeneralTest.String_capture_test
[ OK ] GeneralTest.String_capture_test (138 ms)
[ RUN ] GeneralTest.String_capture_test2
[ OK ] GeneralTest.String_capture_test2 (23 ms)
[ RUN ] GeneralTest.String_capture_test3
[ OK ] GeneralTest.String_capture_test3 (97 ms)
[ RUN ] GeneralTest.Cyclic_grammer_test
[ OK ] GeneralTest.Cyclic_grammer_test (7 ms)
[ RUN ] GeneralTest.Visit_test
[ OK ] GeneralTest.Visit_test (7 ms)
[ RUN ] GeneralTest.Token_check_test
[ OK ] GeneralTest.Token_check_test (260 ms)
[ RUN ] GeneralTest.Lambda_action_test
[ OK ] GeneralTest.Lambda_action_test (42 ms)
[ RUN ] GeneralTest.enter_leave_handlers_test
[ OK ] GeneralTest.enter_leave_handlers_test (139 ms)
[ RUN ] GeneralTest.WHITESPACE_test
[ OK ] GeneralTest.WHITESPACE_test (173 ms)
[ RUN ] GeneralTest.WHITESPACE_test2
[ OK ] GeneralTest.WHITESPACE_test2 (149 ms)
[ RUN ] GeneralTest.WHITESPACE_test3
[ OK ] GeneralTest.WHITESPACE_test3 (152 ms)
[ RUN ] GeneralTest.WHITESPACE_test4
[ OK ] GeneralTest.WHITESPACE_test4 (144 ms)
[ RUN ] GeneralTest.Word_expression_test
[ OK ] GeneralTest.Word_expression_test (100 ms)
[ RUN ] GeneralTest.Word_expression_test_PrioritizedChoice
[ OK ] GeneralTest.Word_expression_test_PrioritizedChoice (102 ms)
[ RUN ] GeneralTest.Word_expression_test_Dictionary
[ OK ] GeneralTest.Word_expression_test_Dictionary (137 ms)
[ RUN ] GeneralTest.Skip_token_test
[ OK ] GeneralTest.Skip_token_test (82 ms)
[ RUN ] GeneralTest.Skip_token_test2
[ OK ] GeneralTest.Skip_token_test2 (88 ms)
[ RUN ] GeneralTest.Custom_AST_test
[ OK ] GeneralTest.Custom_AST_test (129 ms)
[ RUN ] GeneralTest.Backtracking_test
[ OK ] GeneralTest.Backtracking_test (121 ms)
[ RUN ] GeneralTest.Backtracking_with_AST
[ OK ] GeneralTest.Backtracking_with_AST (127 ms)
[ RUN ] GeneralTest.Octal_Hex_Unicode_value_test
[ OK ] GeneralTest.Octal_Hex_Unicode_value_test (27 ms)
[ RUN ] GeneralTest.Ignore_case_literal_test
[ OK ] GeneralTest.Ignore_case_literal_test (93 ms)
[ RUN ] GeneralTest.Ignore_case_character_class_test
[ OK ] GeneralTest.Ignore_case_character_class_test (23 ms)
[ RUN ] GeneralTest.Ignore_case_negate_character_class_test
[ OK ] GeneralTest.Ignore_case_negate_character_class_test (19 ms)
[ RUN ] GeneralTest.mutable_lambda_test
[ OK ] GeneralTest.mutable_lambda_test (43 ms)
[ RUN ] GeneralTest.Simple_calculator_test
[ OK ] GeneralTest.Simple_calculator_test (171 ms)
[ RUN ] GeneralTest.Simple_calculator_with_recovery_test
[ OK ] GeneralTest.Simple_calculator_with_recovery_test (291 ms)
[ RUN ] GeneralTest.Calculator_test
[ OK ] GeneralTest.Calculator_test (44 ms)
[ RUN ] GeneralTest.Calculator_test2
[ OK ] GeneralTest.Calculator_test2 (238 ms)
[ RUN ] GeneralTest.Calculator_test3
[ OK ] GeneralTest.Calculator_test3 (221 ms)
[ RUN ] GeneralTest.Calculator_test_with_AST
[ OK ] GeneralTest.Calculator_test_with_AST (297 ms)
[ RUN ] GeneralTest.Calculator_test_with_combinators_and_AST
[ OK ] GeneralTest.Calculator_test_with_combinators_and_AST (28 ms)
[ RUN ] GeneralTest.Ignore_semantic_value_test
[ OK ] GeneralTest.Ignore_semantic_value_test (86 ms)
[ RUN ] GeneralTest.Ignore_semantic_value_of_or_predicate_test
[ OK ] GeneralTest.Ignore_semantic_value_of_or_predicate_test (134 ms)
[ RUN ] GeneralTest.Ignore_semantic_value_of_and_predicate_test
[ OK ] GeneralTest.Ignore_semantic_value_of_and_predicate_test (124 ms)
[ RUN ] GeneralTest.Literal_token_on_AST_test1
[ OK ] GeneralTest.Literal_token_on_AST_test1 (75 ms)
[ RUN ] GeneralTest.Literal_token_on_AST_test2
[ OK ] GeneralTest.Literal_token_on_AST_test2 (109 ms)
[ RUN ] GeneralTest.Literal_token_on_AST_test3
[ OK ] GeneralTest.Literal_token_on_AST_test3 (111 ms)
[ RUN ] GeneralTest.Literal_token_on_AST_test4
[ OK ] GeneralTest.Literal_token_on_AST_test4 (123 ms)
[ RUN ] GeneralTest.Missing_missing_definitions_test
[ OK ] GeneralTest.Missing_missing_definitions_test (47 ms)
[ RUN ] GeneralTest.Definition_duplicates_test
[ OK ] GeneralTest.Definition_duplicates_test (39 ms)
[ RUN ] GeneralTest.Semantic_values_test
[ OK ] GeneralTest.Semantic_values_test (110 ms)
[ RUN ] GeneralTest.Ordered_choice_count
[ OK ] GeneralTest.Ordered_choice_count (32 ms)
[ RUN ] GeneralTest.Ordered_choice_count_2
[ OK ] GeneralTest.Ordered_choice_count_2 (35 ms)
[ RUN ] GeneralTest.Semantic_value_tag
[ OK ] GeneralTest.Semantic_value_tag (85 ms)
[ RUN ] GeneralTest.Negated_Class_test
[ OK ] GeneralTest.Negated_Class_test (28 ms)
[ RUN ] GeneralTest.token_to_number_float_test
[ OK ] GeneralTest.token_to_number_float_test (40 ms)
[ RUN ] GeneralTest.ParentReferencesShouldNotBeExpired
[ OK ] GeneralTest.ParentReferencesShouldNotBeExpired (72 ms)
[ RUN ] GeneralTest.EndOfInputTest
[ OK ] GeneralTest.EndOfInputTest (42 ms)
[ RUN ] GeneralTest.DefaultEndOfInputTest
[ OK ] GeneralTest.DefaultEndOfInputTest (38 ms)
[ RUN ] GeneralTest.DisableEndOfInputCheckTest
[ OK ] GeneralTest.DisableEndOfInputCheckTest (37 ms)
[ RUN ] GeneralTest.InvalidCutOperator
[ OK ] GeneralTest.InvalidCutOperator (37 ms)
[ RUN ] GeneralTest.HeuristicErrorTokenTest
[ OK ] GeneralTest.HeuristicErrorTokenTest (155 ms)
[ RUN ] GeneralTest.LiteralContentInAST
[ OK ] GeneralTest.LiteralContentInAST (1510 ms)
[ RUN ] GeneralTest.ChoiceWithWhitespace
[ OK ] GeneralTest.ChoiceWithWhitespace (72 ms)
[ RUN ] GeneralTest.PassingContextAndOutputParameter
[ OK ] GeneralTest.PassingContextAndOutputParameter (45 ms)
[----------] 64 tests from GeneralTest (8186 ms total)
[----------] 7 tests from TokenBoundaryTest
[ RUN ] TokenBoundaryTest.Token_boundary_1
[ OK ] TokenBoundaryTest.Token_boundary_1 (68 ms)
[ RUN ] TokenBoundaryTest.Token_boundary_2
[ OK ] TokenBoundaryTest.Token_boundary_2 (72 ms)
[ RUN ] TokenBoundaryTest.Token_boundary_3
[ OK ] TokenBoundaryTest.Token_boundary_3 (85 ms)
[ RUN ] TokenBoundaryTest.Token_boundary_4
[ OK ] TokenBoundaryTest.Token_boundary_4 (86 ms)
[ RUN ] TokenBoundaryTest.Token_boundary_5
[ OK ] TokenBoundaryTest.Token_boundary_5 (98 ms)
[ RUN ] TokenBoundaryTest.Token_boundary_6
[ OK ] TokenBoundaryTest.Token_boundary_6 (118 ms)
[ RUN ] TokenBoundaryTest.Token_boundary_7
[ OK ] TokenBoundaryTest.Token_boundary_7 (129 ms)
[----------] 7 tests from TokenBoundaryTest (661 ms total)
[----------] 16 tests from InfiniteLoopTest
[ RUN ] InfiniteLoopTest.Infinite_loop_1
[ OK ] InfiniteLoopTest.Infinite_loop_1 (59 ms)
[ RUN ] InfiniteLoopTest.Infinite_loop_2
[ OK ] InfiniteLoopTest.Infinite_loop_2 (56 ms)
[ RUN ] InfiniteLoopTest.Infinite_loop_3
[ OK ] InfiniteLoopTest.Infinite_loop_3 (59 ms)
[ RUN ] InfiniteLoopTest.Infinite_loop_4
[ OK ] InfiniteLoopTest.Infinite_loop_4 (60 ms)
[ RUN ] InfiniteLoopTest.Infinite_loop_5
[ OK ] InfiniteLoopTest.Infinite_loop_5 (94 ms)
[ RUN ] InfiniteLoopTest.Infinite_loop_6
[ OK ] InfiniteLoopTest.Infinite_loop_6 (15 ms)
[ RUN ] InfiniteLoopTest.Infinite_loop_7
[ OK ] InfiniteLoopTest.Infinite_loop_7 (26 ms)
[ RUN ] InfiniteLoopTest.Infinite_loop_8
[ OK ] InfiniteLoopTest.Infinite_loop_8 (26 ms)
[ RUN ] InfiniteLoopTest.Infinite_loop_9
[ OK ] InfiniteLoopTest.Infinite_loop_9 (33 ms)
[ RUN ] InfiniteLoopTest.Not_infinite_1
[ OK ] InfiniteLoopTest.Not_infinite_1 (88 ms)
[ RUN ] InfiniteLoopTest.Not_infinite_2
[ OK ] InfiniteLoopTest.Not_infinite_2 (97 ms)
[ RUN ] InfiniteLoopTest.Not_infinite_3
[ OK ] InfiniteLoopTest.Not_infinite_3 (237 ms)
[ RUN ] InfiniteLoopTest.whitespace
[ OK ] InfiniteLoopTest.whitespace (47 ms)
[ RUN ] InfiniteLoopTest.word
[ OK ] InfiniteLoopTest.word (59 ms)
[ RUN ] InfiniteLoopTest.in_sequence
[ OK ] InfiniteLoopTest.in_sequence (41 ms)
[ RUN ] InfiniteLoopTest.in_prioritized_choice
[ OK ] InfiniteLoopTest.in_prioritized_choice (48 ms)
[----------] 16 tests from InfiniteLoopTest (1048 ms total)
[----------] 6 tests from PrecedenceTest
[ RUN ] PrecedenceTest.Precedence_climbing
[ OK ] PrecedenceTest.Precedence_climbing (314 ms)
[ RUN ] PrecedenceTest.Precedence_climbing_with_literal_operator
[ OK ] PrecedenceTest.Precedence_climbing_with_literal_operator (318 ms)
[ RUN ] PrecedenceTest.Precedence_climbing_with_macro
[ OK ] PrecedenceTest.Precedence_climbing_with_macro (272 ms)
[ RUN ] PrecedenceTest.Precedence_climbing_error1
[ OK ] PrecedenceTest.Precedence_climbing_error1 (297 ms)
[ RUN ] PrecedenceTest.Precedence_climbing_error2
[ OK ] PrecedenceTest.Precedence_climbing_error2 (268 ms)
[ RUN ] PrecedenceTest.Precedence_climbing_error3
[ OK ] PrecedenceTest.Precedence_climbing_error3 (248 ms)
[----------] 6 tests from PrecedenceTest (1717 ms total)
[----------] 3 tests from PackratTest
[ RUN ] PackratTest.Packrat_parser_test_with_whitespace
[ OK ] PackratTest.Packrat_parser_test_with_whitespace (61 ms)
[ RUN ] PackratTest.Packrat_parser_test_with_macro
[ OK ] PackratTest.Packrat_parser_test_with_macro (316 ms)
[ RUN ] PackratTest.Packrat_parser_test_with_precedence_expression_parser
[ OK ] PackratTest.Packrat_parser_test_with_precedence_expression_parser (139 ms)
[----------] 3 tests from PackratTest (516 ms total)
[----------] 8 tests from BackreferenceTest
[ RUN ] BackreferenceTest.Backreference_test
[ OK ] BackreferenceTest.Backreference_test (211 ms)
[ RUN ] BackreferenceTest.Undefined_backreference_test
[ OK ] BackreferenceTest.Undefined_backreference_test (21 ms)
[ RUN ] BackreferenceTest.Invalid_backreference_test
[ OK ] BackreferenceTest.Invalid_backreference_test (144 ms)
[ RUN ] BackreferenceTest.Nested_capture_test
[ OK ] BackreferenceTest.Nested_capture_test (255 ms)
[ RUN ] BackreferenceTest.Backreference_with_Prioritized_Choice_test
[ OK ] BackreferenceTest.Backreference_with_Prioritized_Choice_test (263 ms)
[ RUN ] BackreferenceTest.Backreference_with_Zero_or_More_test
[ OK ] BackreferenceTest.Backreference_with_Zero_or_More_test (268 ms)
[ RUN ] BackreferenceTest.Backreference_with_One_or_More_test
[ OK ] BackreferenceTest.Backreference_with_One_or_More_test (260 ms)
[ RUN ] BackreferenceTest.Backreference_with_Option_test
[ OK ] BackreferenceTest.Backreference_with_Option_test (274 ms)
[----------] 8 tests from BackreferenceTest (1696 ms total)
[----------] 5 tests from RepetitionTest
[ RUN ] RepetitionTest.Repetition_0
[ OK ] RepetitionTest.Repetition_0 (78 ms)
[ RUN ] RepetitionTest.Repetition_2_4
[ OK ] RepetitionTest.Repetition_2_4 (44 ms)
[ RUN ] RepetitionTest.Repetition_2_1
[ OK ] RepetitionTest.Repetition_2_1 (43 ms)
[ RUN ] RepetitionTest.Repetition_2
[ OK ] RepetitionTest.Repetition_2 (46 ms)
[ RUN ] RepetitionTest.Repetition__2
[ OK ] RepetitionTest.Repetition__2 (46 ms)
[----------] 5 tests from RepetitionTest (257 ms total)
[----------] 24 tests from LeftRecursiveTest
[ RUN ] LeftRecursiveTest.Left_recursive_test
[ OK ] LeftRecursiveTest.Left_recursive_test (39 ms)
[ RUN ] LeftRecursiveTest.Left_recursive_with_option_test
[ OK ] LeftRecursiveTest.Left_recursive_with_option_test (43 ms)
[ RUN ] LeftRecursiveTest.Left_recursive_with_zom_test
[ OK ] LeftRecursiveTest.Left_recursive_with_zom_test (20 ms)
[ RUN ] LeftRecursiveTest.Left_recursive_with_a_ZOM_content_rule
[ OK ] LeftRecursiveTest.Left_recursive_with_a_ZOM_content_rule (41 ms)
[ RUN ] LeftRecursiveTest.Left_recursive_with_empty_string_test
[ OK ] LeftRecursiveTest.Left_recursive_with_empty_string_test (17 ms)
[ RUN ] LeftRecursiveTest.PEG_Definition
unknown file: Failure
C++ exception with description "bad any_cast" thrown in the test body.
[ FAILED ] LeftRecursiveTest.PEG_Definition (37 ms)
[ RUN ] LeftRecursiveTest.PEG_Expression
unknown file: Failure
C++ exception with description "bad any_cast" thrown in the test body.
[ FAILED ] LeftRecursiveTest.PEG_Expression (13 ms)
[ RUN ] LeftRecursiveTest.PEG_Sequence
unknown file: Failure
C++ exception with description "bad any_cast" thrown in the test body.
[ FAILED ] LeftRecursiveTest.PEG_Sequence (9 ms)
[ RUN ] LeftRecursiveTest.PEG_Prefix
unknown file: Failure
C++ exception with description "bad any_cast" thrown in the test body.
[ FAILED ] LeftRecursiveTest.PEG_Prefix (8 ms)
[ RUN ] LeftRecursiveTest.PEG_Suffix
unknown file: Failure
C++ exception with description "bad any_cast" thrown in the test body.
[ FAILED ] LeftRecursiveTest.PEG_Suffix (10 ms)
[ RUN ] LeftRecursiveTest.PEG_Primary
unknown file: Failure
C++ exception with description "bad any_cast" thrown in the test body.
[ FAILED ] LeftRecursiveTest.PEG_Primary (14 ms)
[ RUN ] LeftRecursiveTest.PEG_Identifier
[ OK ] LeftRecursiveTest.PEG_Identifier (15 ms)
[ RUN ] LeftRecursiveTest.PEG_IdentStart
[ OK ] LeftRecursiveTest.PEG_IdentStart (8 ms)
[ RUN ] LeftRecursiveTest.PEG_IdentRest
[ OK ] LeftRecursiveTest.PEG_IdentRest (8 ms)
[ RUN ] LeftRecursiveTest.PEG_Literal
[ OK ] LeftRecursiveTest.PEG_Literal (48 ms)
[ RUN ] LeftRecursiveTest.PEG_Class
[ OK ] LeftRecursiveTest.PEG_Class (47 ms)
[ RUN ] LeftRecursiveTest.PEG_Negated_Class
[ OK ] LeftRecursiveTest.PEG_Negated_Class (47 ms)
[ RUN ] LeftRecursiveTest.PEG_Range
[ OK ] LeftRecursiveTest.PEG_Range (12 ms)
[ RUN ] LeftRecursiveTest.PEG_Char
[ OK ] LeftRecursiveTest.PEG_Char (69 ms)
[ RUN ] LeftRecursiveTest.PEG_Operators
[ OK ] LeftRecursiveTest.PEG_Operators (22 ms)
[ RUN ] LeftRecursiveTest.PEG_Comment
[ OK ] LeftRecursiveTest.PEG_Comment (7 ms)
[ RUN ] LeftRecursiveTest.PEG_Space
[ OK ] LeftRecursiveTest.PEG_Space (7 ms)
[ RUN ] LeftRecursiveTest.PEG_EndOfLine
[ OK ] LeftRecursiveTest.PEG_EndOfLine (7 ms)
[ RUN ] LeftRecursiveTest.PEG_EndOfFile
[ OK ] LeftRecursiveTest.PEG_EndOfFile (3 ms)
[----------] 24 tests from LeftRecursiveTest (557 ms total)
[----------] 1 test from UserRuleTest
[ RUN ] UserRuleTest.User_defined_rule_test
[ OK ] UserRuleTest.User_defined_rule_test (82 ms)
[----------] 1 test from UserRuleTest (82 ms total)
[----------] 1 test from PredicateTest
[ RUN ] PredicateTest.Semantic_predicate_test
[ OK ] PredicateTest.Semantic_predicate_test (32 ms)
[----------] 1 test from PredicateTest (32 ms total)
[----------] 4 tests from UnicodeTest
[ RUN ] UnicodeTest.Japanese_character
[ OK ] UnicodeTest.Japanese_character (193 ms)
[ RUN ] UnicodeTest.dot_with_a_code
[ OK ] UnicodeTest.dot_with_a_code (22 ms)
[ RUN ] UnicodeTest.dot_with_a_char
[ OK ] UnicodeTest.dot_with_a_char (22 ms)
[ RUN ] UnicodeTest.character_class
[ OK ] UnicodeTest.character_class (49 ms)
[----------] 4 tests from UnicodeTest (287 ms total)
[----------] 16 tests from MacroTest
[ RUN ] MacroTest.Macro_simple_test
[ OK ] MacroTest.Macro_simple_test (91 ms)
[ RUN ] MacroTest.Macro_two_parameters
[ OK ] MacroTest.Macro_two_parameters (99 ms)
[ RUN ] MacroTest.Macro_syntax_error
[ OK ] MacroTest.Macro_syntax_error (30 ms)
[ RUN ] MacroTest.Macro_missing_argument
[ OK ] MacroTest.Macro_missing_argument (61 ms)
[ RUN ] MacroTest.Macro_reference_syntax_error
[ OK ] MacroTest.Macro_reference_syntax_error (50 ms)
[ RUN ] MacroTest.Macro_invalid_macro_reference_error
[ OK ] MacroTest.Macro_invalid_macro_reference_error (40 ms)
[ RUN ] MacroTest.Macro_calculator
[ OK ] MacroTest.Macro_calculator (320 ms)
[ RUN ] MacroTest.Macro_expression_arguments
[ OK ] MacroTest.Macro_expression_arguments (99 ms)
[ RUN ] MacroTest.Macro_recursive
[ OK ] MacroTest.Macro_recursive (77 ms)
[ RUN ] MacroTest.Macro_recursive2
[ OK ] MacroTest.Macro_recursive2 (515 ms)
[ RUN ] MacroTest.Macro_exclusive_modifiers
[ OK ] MacroTest.Macro_exclusive_modifiers (257 ms)
[ RUN ] MacroTest.Macro_token_check_test
[ OK ] MacroTest.Macro_token_check_test (315 ms)
[ RUN ] MacroTest.Macro_passes_an_arg_to_another_macro
[ OK ] MacroTest.Macro_passes_an_arg_to_another_macro (54 ms)
[ RUN ] MacroTest.Unreferenced_rule
[ OK ] MacroTest.Unreferenced_rule (69 ms)
[ RUN ] MacroTest.Nested_macro_call
[ OK ] MacroTest.Nested_macro_call (77 ms)
[ RUN ] MacroTest.Nested_macro_call2
[ OK ] MacroTest.Nested_macro_call2 (123 ms)
[----------] 16 tests from MacroTest (2280 ms total)
[----------] 1 test from LineInformationTest
[ RUN ] LineInformationTest.Line_information_test
[ OK ] LineInformationTest.Line_information_test (83 ms)
[----------] 1 test from LineInformationTest (83 ms total)
[----------] 2 tests from DicTest
[ RUN ] DicTest.Dictionary
[ OK ] DicTest.Dictionary (71 ms)
[ RUN ] DicTest.Dictionary_invalid
[ OK ] DicTest.Dictionary_invalid (59 ms)
[----------] 2 tests from DicTest (130 ms total)
[----------] 8 tests from ErrorTest
[ RUN ] ErrorTest.Default_error_handling_1
[ OK ] ErrorTest.Default_error_handling_1 (105 ms)
[ RUN ] ErrorTest.Default_error_handling_2
[ OK ] ErrorTest.Default_error_handling_2 (111 ms)
[ RUN ] ErrorTest.Default_error_handling_fiblang
[ OK ] ErrorTest.Default_error_handling_fiblang (679 ms)
[ RUN ] ErrorTest.Error_recovery_1
[ OK ] ErrorTest.Error_recovery_1 (680 ms)
[ RUN ] ErrorTest.Error_recovery_2
[ OK ] ErrorTest.Error_recovery_2 (266 ms)
[ RUN ] ErrorTest.Error_recovery_3
[ OK ] ErrorTest.Error_recovery_3 (1083 ms)
[ RUN ] ErrorTest.Error_recovery_Java
[ OK ] ErrorTest.Error_recovery_Java (1202 ms)
[ RUN ] ErrorTest.Error_message_with_rule_instruction
[ OK ] ErrorTest.Error_message_with_rule_instruction (197 ms)
[----------] 8 tests from ErrorTest (4323 ms total)
[----------] 2 tests from StateTest
[ RUN ] StateTest.Indent
[ OK ] StateTest.Indent (216 ms)
[ RUN ] StateTest.NestedBlocks
[ OK ] StateTest.NestedBlocks (306 ms)
[----------] 2 tests from StateTest (522 ms total)
[----------] 1 test from PEGTest
[ RUN ] PEGTest.PEG_Grammar
unknown file: Failure
C++ exception with description "bad any_cast" thrown in the test body.
[ FAILED ] PEGTest.PEG_Grammar (3 ms)
[----------] 1 test from PEGTest (3 ms total)
[----------] Global test environment tear-down
[==========] 169 tests from 17 test suites ran. (22430 ms total)
[ PASSED ] 162 tests.
[ FAILED ] 7 tests, listed below:
[ FAILED ] LeftRecursiveTest.PEG_Definition
[ FAILED ] LeftRecursiveTest.PEG_Expression
[ FAILED ] LeftRecursiveTest.PEG_Sequence
[ FAILED ] LeftRecursiveTest.PEG_Prefix
[ FAILED ] LeftRecursiveTest.PEG_Suffix
[ FAILED ] LeftRecursiveTest.PEG_Primary
[ FAILED ] PEGTest.PEG_Grammar
7 FAILED TESTS
==25818==
==25818== HEAP SUMMARY:
==25818== in use at exit: 0 bytes in 0 blocks
==25818== total heap usage: 94,579 allocs, 94,579 frees, 6,232,518 bytes allocated
==25818==
==25818== All heap blocks were freed -- no leaks are possible
==25818==
==25818== For lists of detected and suppressed errors, rerun with: -s
==25818== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
If I only have auto g =
in:
TEST(LeftRecursiveTest, PEG_Definition) {
auto g = ParserGenerator::grammar();
EXPECT_TRUE(exact(g, "Definition", "Definition <- a / (b c) / d "));
EXPECT_TRUE(exact(g, "Definition", "Definition <- a / b c / d "));
EXPECT_TRUE(exact(g, "Definition", u8"Definitiond ← a "));
EXPECT_FALSE(exact(g, "Definition", "Definition "));
EXPECT_FALSE(exact(g, "Definition", " "));
EXPECT_FALSE(exact(g, "Definition", ""));
EXPECT_FALSE(exact(g, "Definition", "Definition = a / (b c) / d "));
EXPECT_TRUE(exact(g, "Definition", "Macro(param) <- a "));
EXPECT_FALSE(exact(g, "Definition", "Macro (param) <- a "));
}
Then all tests pass and no segfault occur.
Making a cut down version and testing it I'm getting the stack trace shown bellow:
#include <peglib.h>
using namespace peg;
bool exact(Grammar &g, const char *d, const char *s) {
auto n = strlen(s);
auto r = g[d].parse(s, n);
return r.ret && r.len == n;
}
int main(int argc, char** argv) {
Grammar &g = ParserGenerator::grammar();
exact(g, "Definition", "Definition <- a / (b c) / d ");
return 0;
}
Stack trace:
__GI_raise (sig=6, sig@entry=6)
__GI_abort ()
?? ()
?? ()
std::terminate() ()
__cxa_throw ()
std::__throw_system_error(int) ()
std::call_once<peg::Definition::initialize_definition_ids() const::{lambda()#1}>(std::once_flag&, peg::Definition::initialize_definition_ids() const::{lambda()#1}&&) (__once=@0x555555832394: {_M_once = 0}, __f=@0x7fffffffda00: {__this = 0x5555558321b8})
peg::Definition::initialize_definition_ids (this=0x5555558321b8)
peg::Definition::parse_core(char const*, unsigned long, peg::SemanticValues&, std::any&, char const*, std::function<void (unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>) const (this=0x5555558321b8, s=0x5555555db08f \"Definition <- a / (b c) / d \", n=28, vs=@0x7fffffffdea0: {<std::vector<std::any, std::allocator<std::any> >> = std::vector of length 0, capacity 0, path = 0x0, ss = 0x0, tags = std::vector of length 0, capacity 0, tokens = std::vector of length 0, capacity 0, c_ = 0x0, sv_ = \"\", choice_count_ = 0, choice_ = 0, name_ = \"\"}, dt=std::any [no contained value], path=0x0, log={<std::_Maybe_unary_or_binary_function<void, unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x555555835e00, _M_const_object = 0x555555835e00, _M_function_pointer = 0x555555835e00, _M_member_pointer = (void (std::_Undefined_class::*)(class std::_Undefined_class * const)) 0x555555835e00, this adjustment 93824995238296}, _M_pod_data = \"\\000^\\203UUU\\000\\000\\230!\\203UUU\\000\"}, _M_manager = 0x0}, _M_invoker = 0x5555555a6fae <std::__detail::_Hash_node_value_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, peg::Definition> >::_M_valptr()+28>})
peg::Definition::parse(char const*, unsigned long, char const*, std::function<void (unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>) const (this=0x5555558321b8, s=0x5555555db08f \"Definition <- a / (b c) / d \", n=28, path=0x0, log={<std::_Maybe_unary_or_binary_function<void, unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7fffffffdfd0, _M_const_object = 0x7fffffffdfd0, _M_function_pointer = 0x7fffffffdfd0, _M_member_pointer = (void (std::_Undefined_class::*)(class std::_Undefined_class * const)) 0x7fffffffdfd0, this adjustment 11}, _M_pod_data = \"\\320\\337\\377\\377\\377\\177\\000\\000\\v\\000\\000\\000\\000\\000\\000\"}, _M_manager = 0x0}, _M_invoker = 0x636f00006e6f69})
exact (g=std::unordered_map with 70 elements, d=0x5555555dacb1 \"Definition\", s=0x5555555db08f \"Definition <- a / (b c) / d \")
main (argc=1, argv=0x7fffffffe198)
Compiling with clang15 the minimal example shown above, I'm getting a different stack trace:
cd '/tmp/cpp-peglib/mytest-nb'
/usr/bin/make -f Makefile CONF=Debug clean
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .clean-conf
make[1]: Entering directory '/tmp/cpp-peglib/mytest-nb'
rm -f -r build/Debug
make[1]: Leaving directory '/tmp/cpp-peglib/mytest-nb'
CLEAN SUCCESSFUL (total time: 53ms)
cd '/tmp/cpp-peglib/mytest-nb'
/usr/bin/make -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/tmp/cpp-peglib/mytest-nb'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux/mytest-nb
make[2]: Entering directory '/tmp/cpp-peglib/mytest-nb'
mkdir -p build/Debug/GNU-Linux
rm -f "build/Debug/GNU-Linux/main.o.d"
clang-15-env clang++ -std=c++17 -c -g -Wall -I.. -MMD -MP -MF "build/Debug/GNU-Linux/main.o.d" -o build/Debug/GNU-Linux/main.o main.cpp
mkdir -p dist/Debug/GNU-Linux
clang-15-env clang++ -o dist/Debug/GNU-Linux/mytest-nb build/Debug/GNU-Linux/main.o -lpthread
make[2]: Leaving directory '/tmp/cpp-peglib/mytest-nb'
make[1]: Leaving directory '/tmp/cpp-peglib/mytest-nb'
...
__GI_raise (sig=6, sig@entry=6)
__GI_abort ()
?? ()
?? ()
std::terminate() ()
__cxa_throw ()
std::__throw_bad_any_cast ()
std::any_cast<peg::ParserGenerator::Data*> (__any=std::any [no contained value])
peg::ParserGenerator::setup_actions()::{lambda(peg::Context const&, char const*, unsigned long, std::any&)#1}::operator()(peg::Context const&, char const*, unsigned long, std::any&) const (this=0x5555558314e8, dt=std::any [no contained value])
std::__invoke_impl<void, peg::ParserGenerator::setup_actions()::{lambda(peg::Context const&, char const*, unsigned long, std::any&)#1}&, peg::Context const&, char const*, unsigned long, std::any&>(std::__invoke_other, peg::ParserGenerator::setup_actions()::{lambda(peg::Context const&, char const*, unsigned long, std::any&)#1}&, peg::Context const&, char const*&&, unsigned long&&, std::any&) (__f=@0x5555558314e8: {<No data fields>}, __args=std::any [no contained value], __args=std::any [no contained value], __args=std::any [no contained value], __args=std::any [no contained value])
std::__invoke_r<void, peg::ParserGenerator::setup_actions()::{lambda(peg::Context const&, char const*, unsigned long, std::any&)#1}&, peg::Context const&, char const*, unsigned long, std::any&>(peg::ParserGenerator::setup_actions()::{lambda(peg::Context const&, char const*, unsigned long, std::any&)#1}&, peg::Context const&, char const*&&, unsigned long&&, std::any&) (__fn=@0x5555558314e8: {<No data fields>}, __args=std::any [no contained value], __args=std::any [no contained value], __args=std::any [no contained value], __args=std::any [no contained value])
std::_Function_handler<void (peg::Context const&, char const*, unsigned long, std::any&), peg::ParserGenerator::setup_actions()::{lambda(peg::Context const&, char const*, unsigned long, std::any&)#1}>::_M_invoke(std::_Any_data const&, peg::Context const&, char const*&&, unsigned long&&, std::any&) (__functor=@0x5555558314e8: {_M_unused = {_M_object = 0x55555581e310 <peg::ParserGenerator::get_instance()::instance>, _M_const_object = 0x55555581e310 <peg::ParserGenerator::get_instance()::instance>, _M_function_pointer = 0x55555581e310 <peg::ParserGenerator::get_instance()::instance>, _M_member_pointer = (void (std::_Undefined_class::*)(class std::_Undefined_class * const)) 0x55555581e310 <peg::ParserGenerator::get_instance()::instance>, this adjustment 93824995234920}, _M_pod_data = \"\\020\\343\\201UUU\\000\\000h\\024\\203UUU\\000\"}, __args=std::any [no contained value], __args=std::any [no contained value], __args=std::any [no contained value], __args=std::any [no contained value])
std::function<void (peg::Context const&, char const*, unsigned long, std::any&)>::operator()(peg::Context const&, char const*, unsigned long, std::any&) const (this=0x5555558314e8, __args=std::any [no contained value], __args=std::any [no contained value], __args=std::any [no contained value], __args=std::any [no contained value])
peg::Holder::parse_core(char const*, unsigned long, peg::SemanticValues&, peg::Context&, std::any&) const::{lambda(std::any&)#1}::operator()(std::any&) const (this=0x7fffffffd790, a_val=std::any [no contained value])
peg::Context::packrat<peg::Holder::parse_core(char const*, unsigned long, peg::SemanticValues&, peg::Context&, std::any&) const::{lambda(std::any&)#1}>(char const*, unsigned long, unsigned long&, std::any&, peg::Holder::parse_core(char const*, unsigned long, peg::SemanticValues&, peg::Context&, std::any&) const::{lambda(std::any&)#1}) (this=0x7fffffffda90, a_s=0x5555555dbc92 \"Definition <- a / (b c) / d \", def_id=0, len=@0x7fffffffd848: 93824992328501, val=std::any [no contained value], fn={this = 0x5555558316a0, c = @0x7fffffffda90, s = @0x7fffffffd888, n = @0x7fffffffd880, dt = std::any [no contained value], len = @0x7fffffffd848})
peg::Holder::parse_core (this=0x5555558316a0, s=0x5555555dbc92 \"Definition <- a / (b c) / d \", n=28, vs=@0x7fffffffde58: {<std::vector<std::any, std::allocator<std::any> >> = std::vector of length 0, capacity 0, path = 0x0, ss = 0x0, tags = std::vector of length 0, capacity 0, tokens = std::vector of length 0, capacity 0, c_ = 0x0, sv_ = \"\", choice_count_ = 0, choice_ = 0, name_ = }, c=@0x7fffffffda90: {path = 0x0, s = 0x5555555dbc92 \"Definition <- a / (b c) / d \", l = 28, error_info = {error_pos = 0x0, expected_tokens = std::vector of length 0, capacity 0, message_pos = 0x0, message = , label = , last_output_pos = 0x0, keep_previous_token = false}, recovered = false, value_stack = std::vector of length 0, capacity 0, value_stack_size = 0, rule_stack = std::vector of length 0, capacity 0, args_stack = std::vector of length 1, capacity 1 = {std::vector of length 0, capacity 0}, in_token_boundary_count = 0, whitespaceOpe = std::shared_ptr<class peg::Ope> (empty) = {get() = 0x0}, in_whitespace = false, wordOpe = std::shared_ptr<class peg::Ope> (empty) = {get() = 0x0}, capture_scope_stack = std::vector of length 1, capacity 1 = {std::map with 0 elements}, capture_scope_stack_size = 1, cut_stack = std::vector<bool> of length 0, capacity 0, def_count = 68, enablePackratParsing = false, cache_registered = std::vector<bool> of length 0, capacity 0, cache_success = std::vector<bool> of length 0, capacity 0, cache_values = std::map with 0 elements, tracer_enter = {<std::_Maybe_unary_or_binary_function<void, peg::Ope const&, char const*, unsigned long, peg::SemanticValues const&, peg::Context const&, std::any const&, std::any&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x65636e6575716500, _M_const_object = 0x65636e6575716500, _M_function_pointer = 0x65636e6575716500, _M_member_pointer = (void (std::_Undefined_class::*)(class std::_Undefined_class * const)) 0x65636e6575716500, this adjustment 256}, _M_pod_data = \"\\000equence\\000\\001\\000\\000\\000\\000\\000\"}, _M_manager = 0x0}, _M_invoker = 0x555555568b1c <std::char_traits<char>::compare(char const*, char const*, unsigned long)+60>}, tracer_leave = {<std::_Maybe_unary_or_binary_function<void, peg::Ope const&, char const*, unsigned long, peg::SemanticValues const&, peg::Context const&, std::any const&, unsigned long, std::any&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x5555555b2290 <std::_Function_handler<std::any (peg::SemanticValues&, std::any&), peg::Action::make_adaptor<peg::ParserGenerator::setup_actions()::{lambda(peg::SemanticValues const&)#8}>(peg::ParserGenerator::setup_actions()::{lambda(peg::SemanticValues const&)#8})::{lambda(auto:1&, auto:2&)#1}>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation)>, _M_const_object = 0x5555555b2290 <std::_Function_handler<std::any (peg::SemanticValues&, std::any&), peg::Action::make_adaptor<peg::ParserGenerator::setup_actions()::{lambda(peg::SemanticValues const&)#8}>(peg::ParserGenerator::setup_actions()::{lambda(peg::SemanticValues const&)#8})::{lambda(auto:1&, auto:2&)#1}>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation)>, _M_function_pointer = 0x5555555b2290 <std::_Function_handler<std::any (peg::SemanticValues&, std::any&), peg::Action::make_adaptor<peg::ParserGenerator::setup_actions()::{lambda(peg::SemanticValues const&)#8}>(peg::ParserGenerator::setup_actions()::{lambda(peg::SemanticValues const&)#8})::{lambda(auto:1&, auto:2&)#1}>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation)>, _M_member_pointer = (void (std::_Undefined_class::*)(class std::_Undefined_class * const)) 0x5555555b2290 <std::_Function_handler<std::any (peg::SemanticValues&, std::any&), peg::Action::make_adaptor<peg::ParserGenerator::setup_actions()::{lambda(peg::SemanticValues const&)#8}>(peg::ParserGenerator::setup_actions()::{lambda(peg::SemanticValues const&)#8})::{lambda(auto:1&, auto:2&)#1}>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation)>, this adjustment 93824992617024}, _M_pod_data = \"\\220\\\"[UUU\\000\\000@\\\"[UUU\\000\"}, _M_manager = 0x0}, _M_invoker = 0x555555831458}, trace_data = std::any [no contained value], verbose_trace = false, log = {<std::_Maybe_unary_or_binary_function<void, unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0xb, _M_const_object = 0xb, _M_function_pointer = 0xb, _M_member_pointer = &virtual table offset 10, this adjustment 8386676065534438915}, _M_pod_data = \"\\v\\000\\000\\000\\000\\000\\000\\000\\003nstruct\"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffdd40}, next_trace_id = 0, trace_ids = std::vector of length 0, capacity 0, ignore_trace_state = false, source_line_index_init_ = {_M_once = 0}, source_line_index = std::vector of length 0, capacity 0}, dt=std::any [no contained value])
peg::Ope::parse (this=0x5555558316a0, s=0x5555555dbc92 \"Definition <- a / (b c) / d \", n=28, vs=@0x7fffffffde58: {<std::vector<std::any, std::allocator<std::any> >> = std::vector of length 0, capacity 0, path = 0x0, ss = 0x0, tags = std::vector of length 0, capacity 0, tokens = std::vector of length 0, capacity 0, c_ = 0x0, sv_ = \"\", choice_count_ = 0, choice_ = 0, name_ = }, c=@0x7fffffffda90: {path = 0x0, s = 0x5555555dbc92 \"Definition <- a / (b c) / d \", l = 28, error_info = {error_pos = 0x0, expected_tokens = std::vector of length 0, capacity 0, message_pos = 0x0, message = , label = , last_output_pos = 0x0, keep_previous_token = false}, recovered = false, value_stack = std::vector of length 0, capacity 0, value_stack_size = 0, rule_stack = std::vector of length 0, capacity 0, args_stack = std::vector of length 1, capacity 1 = {std::vector of length 0, capacity 0}, in_token_boundary_count = 0, whitespaceOpe = std::shared_ptr<class peg::Ope> (empty) = {get() = 0x0}, in_whitespace = false, wordOpe = std::shared_ptr<class peg::Ope> (empty) = {get() = 0x0}, capture_scope_stack = std::vector of length 1, capacity 1 = {std::map with 0 elements}, capture_scope_stack_size = 1, cut_stack = std::vector<bool> of length 0, capacity 0, def_count = 68, enablePackratParsing = false, cache_registered = std::vector<bool> of length 0, capacity 0, cache_success = std::vector<bool> of length 0, capacity 0, cache_values = std::map with 0 elements, tracer_enter = {<std::_Maybe_unary_or_binary_function<void, peg::Ope const&, char const*, unsigned long, peg::SemanticValues const&, peg::Context const&, std::any const&, std::any&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x65636e6575716500, _M_const_object = 0x65636e6575716500, _M_function_pointer = 0x65636e6575716500, _M_member_pointer = (void (std::_Undefined_class::*)(class std::_Undefined_class * const)) 0x65636e6575716500, this adjustment 256}, _M_pod_data = \"\\000equence\\000\\001\\000\\000\\000\\000\\000\"}, _M_manager = 0x0}, _M_invoker = 0x555555568b1c <std::char_traits<char>::compare(char const*, char const*, unsigned long)+60>}, tracer_leave = {<std::_Maybe_unary_or_binary_function<void, peg::Ope const&, char const*, unsigned long, peg::SemanticValues const&, peg::Context const&, std::any const&, unsigned long, std::any&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x5555555b2290 <std::_Function_handler<std::any (peg::SemanticValues&, std::any&), peg::Action::make_adaptor<peg::ParserGenerator::setup_actions()::{lambda(peg::SemanticValues const&)#8}>(peg::ParserGenerator::setup_actions()::{lambda(peg::SemanticValues const&)#8})::{lambda(auto:1&, auto:2&)#1}>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation)>, _M_const_object = 0x5555555b2290 <std::_Function_handler<std::any (peg::SemanticValues&, std::any&), peg::Action::make_adaptor<peg::ParserGenerator::setup_actions()::{lambda(peg::SemanticValues const&)#8}>(peg::ParserGenerator::setup_actions()::{lambda(peg::SemanticValues const&)#8})::{lambda(auto:1&, auto:2&)#1}>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation)>, _M_function_pointer = 0x5555555b2290 <std::_Function_handler<std::any (peg::SemanticValues&, std::any&), peg::Action::make_adaptor<peg::ParserGenerator::setup_actions()::{lambda(peg::SemanticValues const&)#8}>(peg::ParserGenerator::setup_actions()::{lambda(peg::SemanticValues const&)#8})::{lambda(auto:1&, auto:2&)#1}>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation)>, _M_member_pointer = (void (std::_Undefined_class::*)(class std::_Undefined_class * const)) 0x5555555b2290 <std::_Function_handler<std::any (peg::SemanticValues&, std::any&), peg::Action::make_adaptor<peg::ParserGenerator::setup_actions()::{lambda(peg::SemanticValues const&)#8}>(peg::ParserGenerator::setup_actions()::{lambda(peg::SemanticValues const&)#8})::{lambda(auto:1&, auto:2&)#1}>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation)>, this adjustment 93824992617024}, _M_pod_data = \"\\220\\\"[UUU\\000\\000@\\\"[UUU\\000\"}, _M_manager = 0x0}, _M_invoker = 0x555555831458}, trace_data = std::any [no contained value], verbose_trace = false, log = {<std::_Maybe_unary_or_binary_function<void, unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0xb, _M_const_object = 0xb, _M_function_pointer = 0xb, _M_member_pointer = &virtual table offset 10, this adjustment 8386676065534438915}, _M_pod_data = \"\\v\\000\\000\\000\\000\\000\\000\\000\\003nstruct\"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffdd40}, next_trace_id = 0, trace_ids = std::vector of length 0, capacity 0, ignore_trace_state = false, source_line_index_init_ = {_M_once = 0}, source_line_index = std::vector of length 0, capacity 0}, dt=std::any [no contained value])
peg::Definition::parse_core(char const*, unsigned long, peg::SemanticValues&, std::any&, char const*, std::function<void (unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>) const (this=0x555555831468, s=0x5555555dbc92 \"Definition <- a / (b c) / d \", n=28, vs=@0x7fffffffde58: {<std::vector<std::any, std::allocator<std::any> >> = std::vector of length 0, capacity 0, path = 0x0, ss = 0x0, tags = std::vector of length 0, capacity 0, tokens = std::vector of length 0, capacity 0, c_ = 0x0, sv_ = \"\", choice_count_ = 0, choice_ = 0, name_ = }, dt=std::any [no contained value], path=0x0, log={<std::_Maybe_unary_or_binary_function<void, unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x555555599539 <std::__detail::_Hash_node_value_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, peg::Definition> >::_M_valptr()+25>, _M_const_object = 0x555555599539 <std::__detail::_Hash_node_value_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, peg::Definition> >::_M_valptr()+25>, _M_function_pointer = 0x555555599539 <std::__detail::_Hash_node_value_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, peg::Definition> >::_M_valptr()+25>, _M_member_pointer = &virtual table offset 93824992515384, this adjustment 93824995248704}, _M_pod_data = \"9\\225YUUU\\000\\000@J\\203UUU\\000\"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffde60})
peg::Definition::parse(char const*, unsigned long, char const*, std::function<void (unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>) const (this=0x555555831468, s=0x5555555dbc92 \"Definition <- a / (b c) / d \", n=28, path=0x0, log={<std::_Maybe_unary_or_binary_function<void, unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x555555831720, _M_const_object = 0x555555831720, _M_function_pointer = 0x555555831720, _M_member_pointer = (void (std::_Undefined_class::*)(class std::_Undefined_class * const)) 0x555555831720, this adjustment 140737488347032}, _M_pod_data = \" \\027\\203UUU\\000\\000\\230\\337\\377\\377\\377\\177\\000\"}, _M_manager = 0x0}, _M_invoker = 0x6974696e69666544})
exact (g=std::unordered_map with 70 elements, d=0x5555555dbc87 \"Definition\", s=0x5555555dbc92 \"Definition <- a / (b c) / d \")
main (argc=1, argv=0x7fffffffe198)
Before I was using g++
:
g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-nrQql7/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~18.04)
With clang15
if I use Grammar g =
instead of Grammar &g =
then it runs fine.
But with g++9.4.0
it fail both ways.
With g++-12
:
gcc-12-env g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/home/mingo/local/gcc-12/libexec/gcc/x86_64-pc-linux-gnu/12.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --prefix=/home/mingo/local/gcc-12 --enable-languages=c,d,c++
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (GCC)
The minimal example behaves like the clang-15
and when it fails it shows this stack trace:
__GI_raise (sig=6, sig@entry=6)
__GI_abort ()
?? ()
?? ()
std::terminate() ()
__cxa_throw ()
std::__throw_bad_any_cast ()
std::any_cast<peg::ParserGenerator::Data*> (__any=std::any [no contained value])
peg::ParserGenerator::setup_actions()::{lambda(peg::Context const&, char const*, unsigned long, std::any&)#2}::operator()(peg::Context const&, char const*, unsigned long, std::any&) const (__closure=0x6d5238, dt=std::any [no contained value])
std::__invoke_impl<void, peg::ParserGenerator::setup_actions()::{lambda(peg::Context const&, char const*, unsigned long, std::any&)#2}&, peg::Context const&, char const*, unsigned long, std::any&>(std::__invoke_other, peg::ParserGenerator::setup_actions()::{lambda(peg::Context const&, char const*, unsigned long, std::any&)#2}&, peg::Context const&, char const*&&, unsigned long&&, std::any&) (__f=@0x6d5238: {<No data fields>})
std::__invoke_r<void, peg::ParserGenerator::setup_actions()::{lambda(peg::Context const&, char const*, unsigned long, std::any&)#2}&, peg::Context const&, char const*, unsigned long, std::any&>(peg::ParserGenerator::setup_actions()::{lambda(peg::Context const&, char const*, unsigned long, std::any&)#2}&, peg::Context const&, char const*&&, unsigned long&&, std::any&) (__fn=@0x6d5238: {<No data fields>})
std::_Function_handler<void (peg::Context const&, char const*, unsigned long, std::any&), peg::ParserGenerator::setup_actions()::{lambda(peg::Context const&, char const*, unsigned long, std::any&)#2}>::_M_invoke(std::_Any_data const&, peg::Context const&, char const*&&, unsigned long&&, std::any&) (__functor=@0x6d5238: {_M_unused = {_M_object = 0x0, _M_const_object = 0x0, _M_function_pointer = 0x0, _M_member_pointer = NULL}, _M_pod_data = \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"}, __args#0=@0x7fffffffda40: {path = 0x0, s = 0x47c977 \"Definition <- a / (b c) / d \", l = 28, error_info = {error_pos = 0x0, expected_tokens = std::vector of length 0, capacity 0, message_pos = 0x0, message = \"\", label = \"\", last_output_pos = 0x0, keep_previous_token = false}, recovered = false, value_stack = std::vector of length 0, capacity 0, value_stack_size = 0, rule_stack = std::vector of length 0, capacity 0, args_stack = std::vector of length 1, capacity 1 = {std::vector of length 0, capacity 0}, in_token_boundary_count = 0, whitespaceOpe = std::shared_ptr<class peg::Ope> (empty) = {get() = 0x0}, in_whitespace = false, wordOpe = std::shared_ptr<class peg::Ope> (empty) = {get() = 0x0}, capture_scope_stack = std::vector of length 1, capacity 1 = {std::map with 0 elements}, capture_scope_stack_size = 1, cut_stack = std::vector<bool> of length 0, capacity 0, def_count = 68, enablePackratParsing = false, cache_registered = std::vector<bool> of length 0, capacity 0, cache_success = std::vector<bool> of length 0, capacity 0, cache_values = std::map with 0 elements, tracer_enter = {<std::_Maybe_unary_or_binary_function<void, peg::Ope const&, char const*, unsigned long, peg::SemanticValues const&, peg::Context const&, std::any const&, std::any&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x0, _M_const_object = 0x0, _M_function_pointer = 0x0, _M_member_pointer = NULL}, _M_pod_data = \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"}, _M_manager = 0x0}, _M_invoker = 0x0}, tracer_leave = {<std::_Maybe_unary_or_binary_function<void, peg::Ope const&, char const*, unsigned long, peg::SemanticValues const&, peg::Context const&, std::any const&, unsigned long, std::any&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x0, _M_const_object = 0x0, _M_function_pointer = 0x0, _M_member_pointer = NULL}, _M_pod_data = \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"}, _M_manager = 0x0}, _M_invoker = 0x0}, trace_data = std::any [no contained value], verbose_trace = false, log = {<std::_Maybe_unary_or_binary_function<void, unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x0, _M_const_object = 0x0, _M_function_pointer = 0x0, _M_member_pointer = NULL}, _M_pod_data = \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"}, _M_manager = 0x0}, _M_invoker = 0x0}, next_trace_id = 0, trace_ids = std::vector of length 0, capacity 0, ignore_trace_state = false, source_line_index_init_ = {_M_once = 0}, source_line_index = std::vector of length 0, capacity 0}, __args#1=@0x7fffffffd648: 0x47c977 \"Definition <- a / (b c) / d \", __args#2=@0x7fffffffd640: 28, __args#3=std::any [no contained value])
std::function<void (peg::Context const&, char const*, unsigned long, std::any&)>::operator()(peg::Context const&, char const*, unsigned long, std::any&) const (this=0x6d5238, __args#0=@0x7fffffffda40: {path = 0x0, s = 0x47c977 \"Definition <- a / (b c) / d \", l = 28, error_info = {error_pos = 0x0, expected_tokens = std::vector of length 0, capacity 0, message_pos = 0x0, message = \"\", label = \"\", last_output_pos = 0x0, keep_previous_token = false}, recovered = false, value_stack = std::vector of length 0, capacity 0, value_stack_size = 0, rule_stack = std::vector of length 0, capacity 0, args_stack = std::vector of length 1, capacity 1 = {std::vector of length 0, capacity 0}, in_token_boundary_count = 0, whitespaceOpe = std::shared_ptr<class peg::Ope> (empty) = {get() = 0x0}, in_whitespace = false, wordOpe = std::shared_ptr<class peg::Ope> (empty) = {get() = 0x0}, capture_scope_stack = std::vector of length 1, capacity 1 = {std::map with 0 elements}, capture_scope_stack_size = 1, cut_stack = std::vector<bool> of length 0, capacity 0, def_count = 68, enablePackratParsing = false, cache_registered = std::vector<bool> of length 0, capacity 0, cache_success = std::vector<bool> of length 0, capacity 0, cache_values = std::map with 0 elements, tracer_enter = {<std::_Maybe_unary_or_binary_function<void, peg::Ope const&, char const*, unsigned long, peg::SemanticValues const&, peg::Context const&, std::any const&, std::any&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x0, _M_const_object = 0x0, _M_function_pointer = 0x0, _M_member_pointer = NULL}, _M_pod_data = \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"}, _M_manager = 0x0}, _M_invoker = 0x0}, tracer_leave = {<std::_Maybe_unary_or_binary_function<void, peg::Ope const&, char const*, unsigned long, peg::SemanticValues const&, peg::Context const&, std::any const&, unsigned long, std::any&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x0, _M_const_object = 0x0, _M_function_pointer = 0x0, _M_member_pointer = NULL}, _M_pod_data = \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"}, _M_manager = 0x0}, _M_invoker = 0x0}, trace_data = std::any [no contained value], verbose_trace = false, log = {<std::_Maybe_unary_or_binary_function<void, unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x0, _M_const_object = 0x0, _M_function_pointer = 0x0, _M_member_pointer = NULL}, _M_pod_data = \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"}, _M_manager = 0x0}, _M_invoker = 0x0}, next_trace_id = 0, trace_ids = std::vector of length 0, capacity 0, ignore_trace_state = false, source_line_index_init_ = {_M_once = 0}, source_line_index = std::vector of length 0, capacity 0}, __args#1=0x47c977 \"Definition <- a / (b c) / d \", __args#2=28, __args#3=std::any [no contained value])
peg::Holder::parse_core(char const*, unsigned long, peg::SemanticValues&, peg::Context&, std::any&) const::{lambda(std::any&)#1}::operator()(std::any&) const (__closure=0x7fffffffd8c0, a_val=std::any [no contained value])
peg::Context::packrat<peg::Holder::parse_core(char const*, unsigned long, peg::SemanticValues&, peg::Context&, std::any&) const::{lambda(std::any&)#1}>(char const*, unsigned long, unsigned long&, std::any&, peg::Holder::parse_core(char const*, unsigned long, peg::SemanticValues&, peg::Context&, std::any&) const::{lambda(std::any&)#1}) (this=0x7fffffffda40, a_s=0x47c977 \"Definition <- a / (b c) / d \", def_id=0, len=@0x7fffffffd938: 68, val=std::any [no contained value], fn={__this = 0x6d53f0, __c = @0x7fffffffda40, __s = @0x7fffffffd910, __n = @0x7fffffffd908, __dt = std::any [no contained value], __len = @0x7fffffffd938})
peg::Holder::parse_core (this=0x6d53f0, s=0x47c977 \"Definition <- a / (b c) / d \", n=28, vs=@0x7fffffffde70: {<std::vector<std::any, std::allocator<std::any> >> = std::vector of length 0, capacity 0, path = 0x0, ss = 0x0, tags = std::vector of length 0, capacity 0, tokens = std::vector of length 0, capacity 0, c_ = 0x0, sv_ = \"\", choice_count_ = 0, choice_ = 0, name_ = \"\"}, c=@0x7fffffffda40: {path = 0x0, s = 0x47c977 \"Definition <- a / (b c) / d \", l = 28, error_info = {error_pos = 0x0, expected_tokens = std::vector of length 0, capacity 0, message_pos = 0x0, message = \"\", label = \"\", last_output_pos = 0x0, keep_previous_token = false}, recovered = false, value_stack = std::vector of length 0, capacity 0, value_stack_size = 0, rule_stack = std::vector of length 0, capacity 0, args_stack = std::vector of length 1, capacity 1 = {std::vector of length 0, capacity 0}, in_token_boundary_count = 0, whitespaceOpe = std::shared_ptr<class peg::Ope> (empty) = {get() = 0x0}, in_whitespace = false, wordOpe = std::shared_ptr<class peg::Ope> (empty) = {get() = 0x0}, capture_scope_stack = std::vector of length 1, capacity 1 = {std::map with 0 elements}, capture_scope_stack_size = 1, cut_stack = std::vector<bool> of length 0, capacity 0, def_count = 68, enablePackratParsing = false, cache_registered = std::vector<bool> of length 0, capacity 0, cache_success = std::vector<bool> of length 0, capacity 0, cache_values = std::map with 0 elements, tracer_enter = {<std::_Maybe_unary_or_binary_function<void, peg::Ope const&, char const*, unsigned long, peg::SemanticValues const&, peg::Context const&, std::any const&, std::any&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x0, _M_const_object = 0x0, _M_function_pointer = 0x0, _M_member_pointer = NULL}, _M_pod_data = \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"}, _M_manager = 0x0}, _M_invoker = 0x0}, tracer_leave = {<std::_Maybe_unary_or_binary_function<void, peg::Ope const&, char const*, unsigned long, peg::SemanticValues const&, peg::Context const&, std::any const&, unsigned long, std::any&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x0, _M_const_object = 0x0, _M_function_pointer = 0x0, _M_member_pointer = NULL}, _M_pod_data = \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"}, _M_manager = 0x0}, _M_invoker = 0x0}, trace_data = std::any [no contained value], verbose_trace = false, log = {<std::_Maybe_unary_or_binary_function<void, unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x0, _M_const_object = 0x0, _M_function_pointer = 0x0, _M_member_pointer = NULL}, _M_pod_data = \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"}, _M_manager = 0x0}, _M_invoker = 0x0}, next_trace_id = 0, trace_ids = std::vector of length 0, capacity 0, ignore_trace_state = false, source_line_index_init_ = {_M_once = 0}, source_line_index = std::vector of length 0, capacity 0}, dt=std::any [no contained value])
peg::Ope::parse (this=0x6d53f0, s=0x47c977 \"Definition <- a / (b c) / d \", n=28, vs=@0x7fffffffde70: {<std::vector<std::any, std::allocator<std::any> >> = std::vector of length 0, capacity 0, path = 0x0, ss = 0x0, tags = std::vector of length 0, capacity 0, tokens = std::vector of length 0, capacity 0, c_ = 0x0, sv_ = \"\", choice_count_ = 0, choice_ = 0, name_ = \"\"}, c=@0x7fffffffda40: {path = 0x0, s = 0x47c977 \"Definition <- a / (b c) / d \", l = 28, error_info = {error_pos = 0x0, expected_tokens = std::vector of length 0, capacity 0, message_pos = 0x0, message = \"\", label = \"\", last_output_pos = 0x0, keep_previous_token = false}, recovered = false, value_stack = std::vector of length 0, capacity 0, value_stack_size = 0, rule_stack = std::vector of length 0, capacity 0, args_stack = std::vector of length 1, capacity 1 = {std::vector of length 0, capacity 0}, in_token_boundary_count = 0, whitespaceOpe = std::shared_ptr<class peg::Ope> (empty) = {get() = 0x0}, in_whitespace = false, wordOpe = std::shared_ptr<class peg::Ope> (empty) = {get() = 0x0}, capture_scope_stack = std::vector of length 1, capacity 1 = {std::map with 0 elements}, capture_scope_stack_size = 1, cut_stack = std::vector<bool> of length 0, capacity 0, def_count = 68, enablePackratParsing = false, cache_registered = std::vector<bool> of length 0, capacity 0, cache_success = std::vector<bool> of length 0, capacity 0, cache_values = std::map with 0 elements, tracer_enter = {<std::_Maybe_unary_or_binary_function<void, peg::Ope const&, char const*, unsigned long, peg::SemanticValues const&, peg::Context const&, std::any const&, std::any&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x0, _M_const_object = 0x0, _M_function_pointer = 0x0, _M_member_pointer = NULL}, _M_pod_data = \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"}, _M_manager = 0x0}, _M_invoker = 0x0}, tracer_leave = {<std::_Maybe_unary_or_binary_function<void, peg::Ope const&, char const*, unsigned long, peg::SemanticValues const&, peg::Context const&, std::any const&, unsigned long, std::any&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x0, _M_const_object = 0x0, _M_function_pointer = 0x0, _M_member_pointer = NULL}, _M_pod_data = \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"}, _M_manager = 0x0}, _M_invoker = 0x0}, trace_data = std::any [no contained value], verbose_trace = false, log = {<std::_Maybe_unary_or_binary_function<void, unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x0, _M_const_object = 0x0, _M_function_pointer = 0x0, _M_member_pointer = NULL}, _M_pod_data = \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"}, _M_manager = 0x0}, _M_invoker = 0x0}, next_trace_id = 0, trace_ids = std::vector of length 0, capacity 0, ignore_trace_state = false, source_line_index_init_ = {_M_once = 0}, source_line_index = std::vector of length 0, capacity 0}, dt=std::any [no contained value])
peg::Definition::parse_core(char const*, unsigned long, peg::SemanticValues&, std::any&, char const*, std::function<void (unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>) const (this=0x6d51b8, s=0x47c977 \"Definition <- a / (b c) / d \", n=28, vs=@0x7fffffffde70: {<std::vector<std::any, std::allocator<std::any> >> = std::vector of length 0, capacity 0, path = 0x0, ss = 0x0, tags = std::vector of length 0, capacity 0, tokens = std::vector of length 0, capacity 0, c_ = 0x0, sv_ = \"\", choice_count_ = 0, choice_ = 0, name_ = \"\"}, dt=std::any [no contained value], path=0x0, log={<std::_Maybe_unary_or_binary_function<void, unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x0, _M_const_object = 0x0, _M_function_pointer = 0x0, _M_member_pointer = NULL}, _M_pod_data = \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"}, _M_manager = 0x0}, _M_invoker = 0x0})
peg::Definition::parse(char const*, unsigned long, char const*, std::function<void (unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>) const (this=0x6d51b8, s=0x47c977 \"Definition <- a / (b c) / d \", n=28, path=0x0, log={<std::_Maybe_unary_or_binary_function<void, unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x0, _M_const_object = 0x0, _M_function_pointer = 0x0, _M_member_pointer = NULL}, _M_pod_data = \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"}, _M_manager = 0x0}, _M_invoker = 0x0})
exact (g=std::unordered_map with 70 elements, d=0x47c599 \"Definition\", s=0x47c977 \"Definition <- a / (b c) / d \")
main (argc=1, argv=0x7fffffffe188)
I've tested with g++
8/9/10 and they fail with Grammar g =
or Grammar &g =
.
Interesting when testing with g++-9.4.0
and -m32
(for 32 bits) then I'm getting the same results as with clang15
, I mean it work with Grammar g =
and do not work with Grammar &g =
.
On Ubuntu 18.04 64 bits when running
test-main
I'm getting a segfault and valgrind report several problems like: