AFLplusplus / Grammar-Mutator

A grammar-based custom mutator for AFL++
Apache License 2.0
233 stars 16 forks source link

Seems broken with latest AFL++ ? #53

Open 20urc3 opened 2 days ago

20urc3 commented 2 days ago
/home/s0urc3/Downloads/Grammar-Mutator/third_party/antlr4-cpp-runtime/antlr4-cpp-runtime-src/runtime/src/support/Any.h:125:51: error: self-comparison always evaluates to true [-Werror=tautological-compare]
  125 |     template<int N = 0, typename std::enable_if<N == N && std::is_nothrow_copy_constructible<T>::value, int>::type = 0>
      |                                                 ~~^~~~
/home/s0urc3/Downloads/Grammar-Mutator/third_party/antlr4-cpp-runtime/antlr4-cpp-runtime-src/runtime/src/support/Any.h:130:51: error: self-comparison always evaluates to true [-Werror=tautological-compare]
  130 |     template<int N = 0, typename std::enable_if<N == N && !std::is_nothrow_copy_constructible<T>::value, int>::type = 0>
      |                                                 ~~^~~~
/home/s0urc3/Downloads/Grammar-Mutator/third_party/antlr4-cpp-runtime/antlr4-cpp-runtime-src/runtime/src/tree/ParseTree.h:49:18: error: ‘virtual bool antlr4::tree::ParseTree::operator==(const antlr4::tree::ParseTree&) const’ was hidden [-Werror=overloaded-virtual=]
   49 |     virtual bool operator == (const ParseTree &other) const;
      |                  ^~~~~~~~
/home/s0urc3/Downloads/Grammar-Mutator/third_party/antlr4-cpp-runtime/antlr4-cpp-runtime-src/runtime/src/RuleContext.h:131:10: note:   by ‘bool antlr4::RuleContext::operator==(const antlr4::RuleContext&)’
  131 |     bool operator == (const RuleContext &other) { return this == &other; } // Simple address comparison.
      |          ^~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [Makefile:51: antlr4_shim.o] Error 1
make[2]: Leaving directory '/home/s0urc3/Downloads/Grammar-Mutator/lib/antlr4_shim'
make[1]: *** [Makefile:25: antlr4_shim] Error 2
make[1]: Leaving directory '/home/s0urc3/Downloads/Grammar-Mutator/lib'
make: *** [GNUmakefile:120: build_lib] Error 2
domenukk commented 1 day ago

Maybe try either updating antlr4-cpp-runtime or disable these errors?

20urc3 commented 10 hours ago

Tried latest version of antlr4 and the one from the readme. Got this error again, which is weird bc it used to work perfectly fine

gnu++14 -fPIC -Wno-attributes -Wall -Wextra -Werror -O3 -o antlr4_shim.o -c antlr4_shim.cpp
In file included from /home/s0urc3/Downloads/Grammar-Mutator/third_party/antlr4-cpp-runtime/antlr4-cpp-runtime-src/runtime/src/tree/ParseTree.h:8,
                 from /home/s0urc3/Downloads/Grammar-Mutator/third_party/antlr4-cpp-runtime/antlr4-cpp-runtime-src/runtime/src/RuleContext.h:8,
                 from /home/s0urc3/Downloads/Grammar-Mutator/third_party/antlr4-cpp-runtime/antlr4-cpp-runtime-src/runtime/src/ParserRuleContext.h:8,
                 from /home/s0urc3/Downloads/Grammar-Mutator/third_party/antlr4-cpp-runtime/antlr4-cpp-runtime-src/runtime/src/InterpreterRuleContext.h:8,
                 from /home/s0urc3/Downloads/Grammar-Mutator/third_party/antlr4-cpp-runtime/antlr4-cpp-runtime-src/runtime/src/antlr4-runtime.h:30,
                 from antlr4_shim.cpp:21:
/home/s0urc3/Downloads/Grammar-Mutator/third_party/antlr4-cpp-runtime/antlr4-cpp-runtime-src/runtime/src/support/Any.h:125:51: error: self-comparison always evaluates to true [-Werror=tautological-compare]
  125 |     template<int N = 0, typename std::enable_if<N == N && std::is_nothrow_copy_constructible<T>::value, int>::type = 0>
      |                                                 ~~^~~~
/home/s0urc3/Downloads/Grammar-Mutator/third_party/antlr4-cpp-runtime/antlr4-cpp-runtime-src/runtime/src/support/Any.h:130:51: error: self-comparison always evaluates to true [-Werror=tautological-compare]
  130 |     template<int N = 0, typename std::enable_if<N == N && !std::is_nothrow_copy_constructible<T>::value, int>::type = 0>
      |                                                 ~~^~~~
/home/s0urc3/Downloads/Grammar-Mutator/third_party/antlr4-cpp-runtime/antlr4-cpp-runtime-src/runtime/src/tree/ParseTree.h:49:18: error: ‘virtual bool antlr4::tree::ParseTree::operator==(const antlr4::tree::ParseTree&) const’ was hidden [-Werror=overloaded-virtual=]
   49 |     virtual bool operator == (const ParseTree &other) const;
      |                  ^~~~~~~~
/home/s0urc3/Downloads/Grammar-Mutator/third_party/antlr4-cpp-runtime/antlr4-cpp-runtime-src/runtime/src/RuleContext.h:131:10: note:   by ‘bool antlr4::RuleContext::operator==(const antlr4::RuleContext&)’
  131 |     bool operator == (const RuleContext &other) { return this == &other; } // Simple address comparison.
      |          ^~~~~~~~
In file included from antlr4_shim.cpp:22:
./generated/GrammarLexer.h:263:16: error: ‘SerializedATNView’ in namespace ‘antlr4::atn’ does not name a type
  263 |   antlr4::atn::SerializedATNView getSerializedATN() const override;
      |                ^~~~~~~~~~~~~~~~~
In file included from antlr4_shim.cpp:23:
./generated/GrammarParser.h:256:64: error: ‘ParserATNSimulatorOptions’ in namespace ‘antlr4::atn’ does not name a type; did you mean ‘ParserATNSimulator’?
  256 |   GrammarParser(antlr4::TokenStream *input, const antlr4::atn::ParserATNSimulatorOptions &options);
      |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                ParserATNSimulator
./generated/GrammarParser.h:268:16: error: ‘SerializedATNView’ in namespace ‘antlr4::atn’ does not name a type
  268 |   antlr4::atn::SerializedATNView getSerializedATN() const override;
      |                ^~~~~~~~~~~~~~~~~
antlr4_shim.cpp: In function ‘tree_t* tree_from_buf(const uint8_t*, size_t)’:
antlr4_shim.cpp:84:22: error: cannot declare variable ‘lexer’ to be of abstract type ‘GrammarLexer’
   84 |     GrammarLexer     lexer(&input);
      |                      ^~~~~
./generated/GrammarLexer.h:12:8: note:   because the following virtual functions are pure within ‘GrammarLexer’:
   12 | class  GrammarLexer : public antlr4::Lexer {
      |        ^~~~~~~~~~~~
In file included from /home/s0urc3/Downloads/Grammar-Mutator/third_party/antlr4-cpp-runtime/antlr4-cpp-runtime-src/runtime/src/Lexer.h:8,
                 from /home/s0urc3/Downloads/Grammar-Mutator/third_party/antlr4-cpp-runtime/antlr4-cpp-runtime-src/runtime/src/antlr4-runtime.h:31:
/home/s0urc3/Downloads/Grammar-Mutator/third_party/antlr4-cpp-runtime/antlr4-cpp-runtime-src/runtime/src/Recognizer.h:28:45: note:     ‘virtual const std::vector<std::__cxx11::basic_string<char> >& antlr4::Recognizer::getTokenNames() const’
   28 |     virtual std::vector<std::string> const& getTokenNames() const = 0;
      |                                             ^~~~~~~~~~~~~
antlr4_shim.cpp:91:19: error: cannot declare variable ‘parser’ to be of abstract type ‘GrammarParser’
   91 |     GrammarParser parser(&tokens);
      |                   ^~~~~~
./generated/GrammarParser.h:12:8: note:   because the following virtual functions are pure within ‘GrammarParser’:
   12 | class  GrammarParser : public antlr4::Parser {
      |        ^~~~~~~~~~~~~
/home/s0urc3/Downloads/Grammar-Mutator/third_party/antlr4-cpp-runtime/antlr4-cpp-runtime-src/runtime/src/Recognizer.h:28:45: note:     ‘virtual const std::vector<std::__cxx11::basic_string<char> >& antlr4::Recognizer::getTokenNames() const’
   28 |     virtual std::vector<std::string> const& getTokenNames() const = 0;
      |                                             ^~~~~~~~~~~~~