Ark icon indicating copy to clipboard operation
Ark copied to clipboard

feat(fuzzing): minimize the crashes before uploading them

Open SuperFola opened this issue 1 year ago • 2 comments

Description

Minimizing the crashes before uploading to make crashes reproduction and analysis easier.

Checklist

  • [ ] I have read the Contributor guide
  • [ ] My code follows the style guidelines of this project
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have updated the documentation if needed
  • [ ] I have added tests that prove my fix/feature is working
  • [ ] New and existing tests pass locally with my changes

SuperFola avatar May 27 '24 11:05 SuperFola

Static analysis report

Lizard report

Listing only functions with cyclomatic complexity >= 15 or NLOC >= 100 or parameters >= 6.

Filename Start line:end line Function name Parameters NLOC CCN
src/arkreactor/VM/VM.cpp 258:1069 Ark::VM::safeRun 2 655 168
src/arkreactor/Compiler/Macros/Processor.cpp 215:458 Ark::internal::MacroProcessor::evaluate 2 205 75
include/Ark/Compiler/AST/Parser.hpp 84:175 Ark::internal::ARK_APIParser::string 0 89 34
src/arkreactor/Compiler/Compiler.cpp 539:652 Ark::Compiler::handleCalls 5 85 31
src/arkreactor/Compiler/Compiler.cpp 261:352 Ark::Compiler::compileExpression 5 75 25
src/arkreactor/Compiler/Macros/Processor.cpp 118:181 Ark::internal::MacroProcessor::processNode 2 48 20
src/arkreactor/Compiler/AST/Parser.cpp 263:377 Ark::internal::Parser::import_ 0 92 19
src/arkreactor/Compiler/Macros/Processor.cpp 53:98 Ark::internal::MacroProcessor::registerMacro 1 41 16
Report about files you didn't modify in this PR
Filename Start line:end line Function name Parameters NLOC CCN
src/arkreactor/Compiler/BytecodeReader.cpp 70:438 Ark::BytecodeReader::display 4 327 131
src/arkscript/main.cpp 17:300 main 2 246 30
src/arkreactor/Compiler/AST/Node.cpp 209:279 Ark::internal::Node::debugPrint 1 61 23
src/arkscript/JsonCompiler.cpp 23:188 JsonCompiler::_compile 1 139 23
src/arkreactor/VM/State.cpp 147:287 Ark::State::configure 0 116 22
include/utf8.hpp 138:184 utf8::isValid 1 44 21
src/arkreactor/Compiler/Macros/Executors/Function.cpp 12:86 Ark::internal::FunctionExecutor::applyMacro 1 60 18
src/arkreactor/Compiler/AST/Node.cpp 143:207 Ark::internal::Node::repr 0 56 17
src/arkreactor/VM/Value.cpp 77:135 Ark::Value::toString 1 46 17
include/Ark/Compiler/AST/Predicates.hpp 162:186 Ark::internal::IsSymbol::operator ( ) 1 24 16
src/arkreactor/TypeChecker.cpp 27:78 Ark::types::displayContract 2 45 15
src/arkscript/Formatter.cpp 115:168 Formatter::format 3 51 15
src/arkreactor/Exceptions.cpp 124:133 Ark::Diagnostics::helper 8 9 3
include/Ark/Exceptions.hpp 92:101 Ark::CodeError::CodeError 6 10 1

CppCheck report

Filename Line Type Description
include/Ark/Compiler/AST/Optimizer.hpp 63 style Unused private function 'Optimizer throwOptimizerError'
include/Ark/Compiler/AST/Parser.hpp 179 style Local variable 'symbol' shadows outer function
include/Ark/Compiler/AST/Predicates.hpp 117 performance Function parameter 'c' should be passed by const reference.
include/Ark/Compiler/AST/utf8_char.hpp 28 style Local variable 'codepoint' shadows outer function
include/Ark/TypeChecker.hpp 69 performance Function parameter 'name' should be passed by const reference.
include/Ark/TypeChecker.hpp 73 performance Function parameter 'name' should be passed by const reference.
src/arkreactor/Builtins/IO.cpp 192 style Consider using std transform algorithm instead of a raw loop.
src/arkreactor/Builtins/IO.cpp 24 style Parameter 'n' can be declared with const
src/arkreactor/Builtins/IO.cpp 43 style Parameter 'n' can be declared with const
src/arkreactor/Compiler/AST/BaseParser.cpp 310 style Consider using std any_of algorithm instead of a raw loop.
src/arkreactor/Compiler/AST/BaseParser.cpp 350 style Consider using std any_of algorithm instead of a raw loop.
src/arkreactor/Compiler/AST/Parser.cpp 369 error Uninitialized variable import_data.with_prefix
src/arkreactor/Compiler/Compiler.cpp 140 style Consider using std copy algorithm instead of a raw loop.
src/arkreactor/Compiler/Compiler.cpp 160 style Consider using std copy algorithm instead of a raw loop.
src/arkreactor/Compiler/Compiler.cpp 167 style Consider using std copy algorithm instead of a raw loop.
src/arkreactor/Compiler/ImportSolver.cpp 148 style Consider using std transform algorithm instead of a raw loop.
src/arkreactor/Compiler/Macros/Executors/Function.cpp 14 style The scope of the variable 'first' can be reduced.
src/arkreactor/TypeChecker.cpp 80 performance Function parameter 'funcname' should be passed by const reference.
src/arkreactor/VM/Future.cpp 10 performance Variable 'm_value' is assigned in constructor body. Consider performing initialization in initialization list.
src/arkreactor/VM/Scope.cpp 51 style Variable 'id' is not assigned a value.
src/arkreactor/VM/Scope.cpp 61 style Variable 'id' is not assigned a value.
src/arkreactor/VM/Scope.cpp 71 style Variable 'id' is not assigned a value.
src/arkreactor/VM/State.cpp 124 style Consider using std transform algorithm instead of a raw loop.
src/arkreactor/VM/VM.cpp 555 style Consider using std copy algorithm instead of a raw loop.
src/arkreactor/VM/VM.cpp 605 style Consider using std copy algorithm instead of a raw loop.
src/arkscript/Formatter.cpp 438 warning Either the condition 'node.constList().empty()' is redundant or expression 'node.constList().back()' cause access out of bounds.
src/arkscript/main.cpp 141 style Consider using std copy algorithm instead of a raw loop.
src/arkscript/main.cpp 148 style Consider using std copy algorithm instead of a raw loop.

github-actions[bot] avatar May 27 '24 11:05 github-actions[bot]

Actually it seems that it reduces the crashes to much and they're all identical

SuperFola avatar May 27 '24 16:05 SuperFola