- Aug 25, 2023
-
-
Mergen Imeev authored
The maximum length of box.cfg{} string parameters is now 512 instead of 256 before. NO_DOC=no need to document NO_TEST=will be added in EE (cherry picked from commit f5511d45)
-
Vladimir Davydov authored
Just to demonstrate that the format argument of ok/is/isnt macros is now optional. NO_DOC=test NO_CHANGELOG=test (cherry picked from commit e13f2bf5)
-
Timur Safin authored
Part of #7618 NO_DOC=internal NO_CHANGELOG=internal (cherry picked from commit c573be80)
-
Vladimir Davydov authored
It's really annoying to add a message after each check in a unit test. Let's make this optional. If the message is omitted, "line %d" will be used instead. Also, let's print the expression on failure because it may be useful if exact sources are unavailable. NO_DOC=refactoring NO_CHANGELOG=refactoring (cherry picked from commit 62ae8bf3)
-
Vladimir Davydov authored
The ok/is/isnt macros expand to {} so they may be used without a trailing semicolon. This is going to be fixed so let's add missing semicolons. NO_DOC=code cleanup NO_CHANGELOG=code cleanup (cherry picked from commit 4871b697)
-
Vladimir Davydov authored
There's no need to duplicate all unit test helpers for TAP compatible tests. The only difference between them is that plan() prints the TAP version so let's do just that. NO_DOC=code cleanup NO_CHANGELOG=code cleanup (cherry picked from commit a235080c)
-
- Aug 24, 2023
-
-
Sergey Bronnikov authored
Fuzzing is a heavyweight job, we can reduce a set of paths used for triggering this job and therefore reduce an overall time of testing in some cases. The patch replaces `.github/workflows/**` to `.github/workflows/fuzzing.yml` because workflows are independent and changes in other workflows does not affect fuzzing at all and patch adds Lua files (`**.lua`) to ignores because fuzzing focused on C/C++ code. NO_CHANGELOG=ci NO_DOC=ci NO_TEST=ci (cherry picked from commit f14cb97d)
-
- Aug 22, 2023
-
-
Sergey Bronnikov authored
NO_DOC=seed corpus NO_CHANGELOG=seed corpus NO_TEST=seed corpus (cherry picked from commit 4894863e)
-
Sergey Bronnikov authored
NO_DOC=testing NO_CHANGELOG=testing (cherry picked from commit 4deadeb8)
-
Sergey Bronnikov authored
NO_DOC=seed corpus NO_CHANGELOG=seed corpus NO_TEST=seed corpus (cherry picked from commit 4b5fb953)
-
Sergey Bronnikov authored
Examples of IPROTO decoding issues: #3900, #1928, #6781. Patch adds a number of fuzzing tests that covers IPROTO decoding: - xrow_decode_auth - xrow_decode_begin - xrow_decode_call - xrow_decode_dml - xrow_decode_id - xrow_decode_raft - xrow_decode_sql - xrow_decode_watch - xrow_greeting_decode NO_DOC=testing NO_CHANGELOG=testing (cherry picked from commit 46cacf35)
-
Sergey Bronnikov authored
Fuzzing test for LuaJIT generates random Lua programs and executes them. We want to build a fuzzing test that will produce Lua programs that will not contain semantic errors and will trigger as much as possible components in LuaJIT. This proposed patch introduces metrics that gathered after running the test. LuaJIT metrics gathered using LuaJIT getmetrics module [1]. All gathered metrics test will output after running with a finite number of runs or finite duration of time (options `-runs` and `-max_total_time`) or after sending SIGUSR1 to a test process. ``` $ ./build/test/fuzz/luaL_loadbuffer/luaL_loadbuffer_fuzzer -runs=1000 <snipped> Done 1000 runs in 1 second(s) Total number of samples: 1000 Total number of samples with errors: 438 (43%) Total number of samples with recorded traces: 87 (8%) Total number of samples with snap restores: 30 (3%) Total number of samples with abort traces: 55 (5%) ``` 1. https://www.tarantool.io/en/doc/latest/reference/tooling/luajit_getmetrics/#getmetrics-c-api NO_CHANGELOG=testing NO_DOC=testing (cherry picked from commit 430fa6a2)
-
Rimma Tolkacheva authored
This refactoring will: 1. Move macros from a header to the source file. Macros should be used in header only with undef to avoid redefinitions. Undef directive is not useful since we want to use these macros in the source file. 2. Remove `using namespace lua_grammar` from header. https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-using-directive 3. Moving serializer entry point and constant parameters into luajit_fuzzer namespace. It's a common practice in C++ to avoid name collisions. 4. Move serializer functions into anonymous namespace. These functions are not a part of the interface so should have static linkage. https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-unnamed2 5. Fix ConvertToStringDefault function. It was logically wrong so it would generate an identifier `123` from `*123`. NO_CHANGELOG=internal NO_DOC=fuzzer fix (cherry picked from commit 56488e15)
-
klauwier authored
LuaJIT fuzzer used to stop due to timeout caused by infinite cycles and recursions. Counters were introduced for every cycle and function to address LuaJIT fuzzer timeouts. The idea is to add unique counters for every cycle and function to ensure finite code execution, if it wasn't already. For while, repeat, for cycles, local and global named, anonymous functions, counters will be initialized before the code generated from protobuf, and checked in the first body statement. An entry point for the serializer was created to count cycles and functions for counter initialization. The idea was taken from a paper "Program Reconditioning: Avoiding Undefined Behaviour When Finding and Reducing Compiler Bugs" [1]. Here is an example of a change in serialized code made by this commit. Before: ```lua while (true) do foo = 'bar' end function bar() bar() end ``` After: ```lua counter_0 = 0 counter_1 = 0 while (true) do if counter_0 > 5 then break end counter_0 = counter_0 + 1 foo = 'bar' end function bar() if counter_1 > 5 then return end counter_1 = counter_1 + 1 bar() end ``` Protobuf structures that reproduce the timeout problem were added to the LuaJIT fuzzer corpus. [1] https://www.doc.ic.ac.uk/~afd/homepages/papers/pdfs/2023/PLDI.pdf NO_CHANGELOG=internal NO_DOC=fuzzer fix (cherry picked from commit 4d004bbe)
-
Sergey Bronnikov authored
Function `datetime_strptime` decodes string with datetime according to specified format, it accepts a datetime struct, buffer with datetime and string with format in arguments. Fuzzing test used static string "iso8601" as a format and it blocked fuzzing test to cover functions used by datetime_strptime under the hood. Fuzz introspector shows that code coveraged by a test is quite low. Patch updates the test to make it more effective: buffer with datetime and format string are generated using FDP (Fuzzing Data Provider). Test file extension was changed to .cc, because FuzzingDataProvider is used and we need building it by C++ compiler. Function `tnt_strptime` uses assert, that triggered by fuzzing tests. Therefore it was replaced with to if..then. 1. https://storage.googleapis.com/oss-fuzz-introspector/tarantool/ Fixes #8490 NO_CHANGELOG=fuzzing test NO_DOC=fuzzing test NO_TEST=fuzzing test (cherry picked from commit a1bd6e0b)
-
Timur Safin authored
Fixes #8502 Needed for #8490 NO_DOC=bugfix NO_TEST=covered by fuzzing test (cherry picked from commit 783a7040)
-
Sergey Bronnikov authored
Corpus based on PUC Rio Lua tests imported from LuaJIT repository [1]. 1. https://github.com/tarantool/luajit/tree/tarantool/test/PUC-Rio-Lua-5.1-tests Follows up #4823 NO_CHANGELOG=corpus NO_DOC=corpus NO_TEST=corpus (cherry picked from commit 890eb224)
-
Dmitriy Nesterov authored
Patch adds a LuaJIT fuzzer based on libprotobuf-mutator and LibFuzzer. Grammar is described via messages in protobuf format, serializer is applied to convert .proto format to string. For displaying generated code on the screen during fuzzing set the environment variable 'LPM_DUMP_NATIVE_INPUT'. For displaying error messages from lua functions set the environment variable 'LUA_FUZZER_VERBOSE'. Note: UndefinedBehaviourSanitizer is unsupported by LuaJIT (see #8473), so fuzzing test is disabled when CMake option ENABLE_UB_SANITIZER is passed. Closes #4823 NO_DOC=<fuzzing testing of LuaJIT> NO_TEST=<fuzzing testing of LuaJIT> (cherry picked from commit a287c853)
-
Sergey Bronnikov authored
Follows-up #4823 NO_CHANGELOG=internal NO_DOC=internal NO_TEST=internal (cherry picked from commit 95d62cfc)
-
Dmitriy Nesterov authored
Added Google's 'libprotobuf-mutator' and 'protobuf' libraries for developing grammar-based LuaJIT and SQL fuzzers based on LibFuzzer. It is needed to build protobuf module from source because by default, the system-installed version of protobuf is used by libprotobuf-mutator, and this version can be too old. Part of #4823 NO_CHANGELOG=<dependencies> NO_DOC=<dependencies> NO_TEST=<dependencies> (cherry picked from commit b11072a6)
-
Dmitriy Nesterov authored
Added options for fuzzing and for getting more information on debugging. NO_CHANGELOG=<fuzzing options> NO_DOC=<fuzzing options> NO_TEST=<fuzzing options> (cherry picked from commit 69f21e25)
-
Sergey Bronnikov authored
Commit 2be74a65 ("test/cmake: add a function for generating unit test targets") added a function for generating unit test targets in CMake. This function makes code simpler and less error-prone. Proposed patch adds a similar function for generating fuzzing test targets in CMake. NO_CHANGELOG=build infrastructure updated NO_DOC=build infrastructure updated NO_TEST=build infrastructure updated (cherry picked from commit d9643bfd)
-
- Aug 21, 2023
-
-
Ilya Verbin authored
test/unit/guard.cc calls stack_break_f() recursively until the stack overflows and a signal is fired, however it relies on undefined behavior when compares pointers to local variables. Fixed by comparing __builtin_frame_address() instead. One of the examples of this UB is when ASAN allocates local variables on fake stacks, in that case the test completes without the stack overflow. Also this patch disables ASAN for stack_break_f() to keep the array on the fiber stack (see the corresponding comment) and marks it as volatile to avoid optimizing it away by the compiler. Closes tarantool/tarantool-qa#323 NO_DOC=test fix NO_CHANGELOG=test fix (cherry picked from commit 05b696c7)
-
- Aug 17, 2023
-
-
Magomed Kostoev authored
Since number type was introduced we can not assume if tuples are equal by comparison then their sizes are equal too. So the place the assumption is used is fixed. Closes #8899 NO_DOC=bugfix (cherry picked from commit f4de9faf)
-
Magomed Kostoev authored
This commit introduces the key_compare_and_skip_parts function that advances the keys on equal parts. These changes has been extracted from commit ca832f27 ("tuple_compare: compare not only functional key with key"). NO_CHANGELOG=internal NO_DOC=internal NO_TEST=see the next commit
-
Vladimir Davydov authored
Runtime tuple formats are reusable, which means that a tuple format returned by runtime_tuple_format_new may not be brand new, but actually be used by a Lua object. As a result, if we call any function that may trigger Lua GC between runtime_tuple_format_new and tuple_format_ref, the tuple format may be deleted, leading to a use-after-free bug. This is what happens in lbox_tuple_format_new. Fix this issue by taking a reference to the format before pushing a cdata object to the Lua stack in lbox_push_tuple_format. The issue was fixed in the master branch by commit 28ec245d ("lua: fix heap-use-after-free bug in tuple format constructor"). This isn't a clean cherry-pick because the code changed quite a bit. Closes #8889 NO_DOC=bug fix NO_TEST=difficult to reproduce, found by ASAN (cherry picked from commit 4123061b)
-
- Aug 16, 2023
-
-
Igor Munkin authored
* ci: support coveralls * cmake: add code coverage support * test: run flake8 static analysis via CMake * test: fix E741 errors by pycodestyle * test: fix E722 errors by pycodestyle * test: fix E711 errors by pycodestyle * test: fix E502 errors by pycodestyle * test: fix E501 errors by pycodestyle * test: fix E305 errors by pycodestyle * test: fix E303 errors by pycodestyle * test: fix E302 errors by pycodestyle * test: fix E301 errors by pycodestyle * test: fix E275 errors by pycodestyle * test: fix E251 errors by pycodestyle * test: fix E231 errors by pycodestyle * test: fix E203 errors by pycodestyle * test: fix E201 and E202 errors by pycodestyle * test: suppress E131 errors by pycodestyle * test: fix E128 errors by pycodestyle * test: fix E122 errors by pycodestyle * gdb: fix Python <assert> statement usage NO_DOC=LuaJIT submodule bump NO_TEST=LuaJIT submodule bump NO_CHANGELOG=LuaJIT submodule bump
-
- Aug 15, 2023
-
-
Ilya Verbin authored
The `__sanitizer_start_switch_fiber()` function takes a pointer as the first argument to store the current fake stack if there is one (it is necessary when stack-use-after-return detection is enabled). When leaving a fiber definitely, NULL must be passed so that the fake stack is destroyed. Before this patch, NULL was passed for dead fibers, however this is wrong for dead fibers that are recycled and resumed. In such cases ASAN destroys the fake stack, and the fiber crashes trying to use it in `fiber_yield()` upon return from `coro_transfer()`. Closes tarantool/tarantool-qa#321 NO_DOC=bugfix NO_TEST=tested by test-release-asan workflow (cherry picked from commit 72a6abee)
-
- Aug 14, 2023
-
-
Ilya Grishnov authored
Fixed the implementation of the box console. Before this fix, result of `\set language` is shared between clients via `console.connect`, despite the fact that clients have different `box.session.id`. Now the parameter of the selected language is stored by each client in his own `box.session.storage`. Fixes #8817 NO_DOC=bugfix (cherry picked from commit e4fda4b7)
-
Gleb Kashkin authored
Interactive console test helper could be used for remote connection too, for that purpose prompt needs to be changed accordingly to connection type. This patch introduces getter and setter for the prompt. Prompt is configured per session, so it is advised to create a new session for each test case (e.g. with before_each()). NO_CHANGELOG=test helper change NO_DOC=test helper change (cherry picked from commit ed86a729)
-
Yaroslav Lobankov authored
The ./test/luatest_helpers/interactive_tarantool.lua module is not a luatest helper. So moving it to the ./test/ dir and removing empty ./test/luatest_helpers/. NO_DOC=testing stuff NO_TEST=testing stuff NO_CHANGELOG=testing stuff (cherry picked from commit 5493db7c)
-
Alexander Turenko authored
A basic (and pretty useless) example: ```lua local it = require('test.luatest_helpers.interactive_tarantool') local child = it.new() child:execute_command('6 * 7') local res = child:read_response() t.assert_equals(res, 42) child:close() ``` The module also contains `:read_line()`, `:assert_line()` helpers for testing output directly: for example, when we need to catch a print() from a background fiber. It provides has constants related to terminal's control sequences. A real usage can be seen in a next commit. Part of #7169 NO_DOC=no user visible changes NO_TEST=not applicable, it is a testing helper NO_CHANGELOG=no user visible changes (cherry picked from commit a9d96007)
-
Gleb Kashkin authored
As the underlying problem behind this injection is fixed in #7357 it can be removed and `-i` flag could be used as initially intended. Closes #7554 Requires #7357 NO_DOC=refactoring NO_CHANGELOG=refactoring (cherry picked from commit 16d6e9d2)
-
Gleb Kashkin authored
The interactive mode has been ignored when stdin was not a tty and is no more. Now results of another command can be handled by tarantool. Before the patch: ``` $ echo 42 | tarantool -i LuajitError: stdin:1: unexpected symbol near '42' fatal error, exiting the event loop ``` After the patch: ``` $ echo 42 | tarantool -i Tarantool 2.5.0-130-ge3cf64a6c type 'help' for interactive help tarantool> 42 --- - 42 ... ``` Closes #5064 NO_DOC=bugfix (cherry picked from commit 9965e3fe)
-
- Aug 08, 2023
-
-
Oleg Chaplashkin authored
Bump test-run to new version with the following improvements: - luatest: fix detect tarantool crash at exit [1] - Fix bug when lua script name truncated by dot [2] - Raise an error and log it if test timeouts are set incorrectly [3] - Pin PyYAML version to 5.3.1 [4] - Add ability to set path to executable file [5] - Migrate tarantoolctl from tarantool repository [6] - Fix test-run crash when default server is crashed [7] - Disable reproduce content printing [8] [1] tarantool/test-run@be693d1 [2] tarantool/test-run@a6405f1 [3] tarantool/test-run@d34ecb0 [4] tarantool/test-run@704420e [5] tarantool/test-run@0a70001 [6] tarantool/test-run@ad43d8f [7] tarantool/test-run@b31329e [8] tarantool/test-run@31f0ced NO_DOC=test NO_TEST=test NO_CHANGELOG=test (cherry picked from commit f4511948)
-
Yaroslav Lobankov authored
Run release build LTO testing inside a Docker container created from the `tarantool/testing:ubuntu-jammy-clang16` image with Clang 16 installed. Closes #318 NO_DOC=ci NO_TEST=ci NO_CHANGELOG=ci (cherry picked from commit 9d0cb54f)
-
Yaroslav Lobankov authored
Run release build testing inside a Docker container created from the `tarantool/testing:ubuntu-jammy-clang16` image with Clang 16 installed. Closes #317 NO_DOC=ci NO_TEST=ci NO_CHANGELOG=ci (cherry picked from commit 9134dabd)
-
Sergey Vorontsov authored
NO_DOC=build NO_TEST=build NO_CHANGELOG=build (cherry picked from commit bb74d6c9)
-
Kirill Yukhin authored
Add code owners for CI-related script and for github automation directory. NO_CHANGELOG=no code changes NO_TEST=no code changes NO_DOC=no code changes (cherry picked from commit 9234763a)
-