Commit Briefs

Sergey Bronnikov

cmake: introduce an option ENABLE_INTERNAL_TESTS (master)

The patch introduce an option ENABLE_INTERNAL_TESTS, it is disabled by default. Follows up commit 2ec5436e90f1 ("libluamut: initial version").


Sergey Bronnikov

tests/capi: update blacklists with tests

Enabled tests `luaL_dostring_test`, `luaL_loadbuffer_test`, `luaL_loadstring_test` and `lua_dump_test` for PUC Rio Lua. `lua_dump_test` was disabled in the commit 15388716f29d ("tests: disable lua_dump_test") and tests `luaL_loadstring_test`, `luaL_loadbuffer_test`, `luaL_dostring_test` were disabled in the commit 81e842820fb3 ("tests: fix test names in blacklist"). Enabled tests `lua_dump_test` and `lua_load_test` for LuaJIT. `lua_load_test` was disabled by the commit 1ce18d55c4d4 ("tests: add lua_load_test").


Sergey Bronnikov

cfl: add a compiler flag used by Centipede


Sergey Bronnikov

docs: add citation information for the project

CITATION.cff files are plain text files with human- and machine-readable citation information for software (and datasets). Code developers can include them in their repositories to let others know how to correctly cite their software, see [1] and [2]. The patch adds a citation information for the project. 1. https://citation-file-format.github.io/ 2. https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files


Sergey Bronnikov

libluamut: initial version

The patch adds a shared library that implements a custom mutation and crossover functions for LibFuzzer. These functions allows to implement mutation and crossover logic with Lua programming language and thus replace the default mutation and crossover functions: `LLVMFuzzerCustomMutator` and `LLVMFuzzerCustomCrossover`. For implementing custom mutation function in Lua one need to create a Lua script with function `LLVMFuzzerCustomMutator` and set a path to the script in environment variable with name `LIBFUZZER_LUA_SCRIPT`. When this environment variable is not set default script name `libfuzzer_lua_script.lua` will be used. The same with custom crossover function - one need create a Lua script with defined Lua function `LLVMFuzzerCustomCrossover` and set a path to the script in environment variable `LIBFUZZER_LUA_SCRIPT`. Pay attention that both functions uses its own Lua state internally. Note, `libluamut` is unused now and building is disabled by default. Follows up #19


Sergey Bronnikov

tests: fix compiler warning

``` [60/62] Building CXX object tests/capi/luaL_loadbuffer_proto/CMakeFiles/luaL_loadbuffer_proto_test.dir/luaL_loadbuffer_proto_test.cc.o /home/runner/work/lua-c-api-tests/lua-c-api-tests/tests/capi/luaL_loadbuffer_proto/luaL_loadbuffer_proto_test.cc:308:30: warning: missing field 'B' initializer [-Wmissing-field-initializers] struct str_Writer state = {0}; ^ 1 warning generated. ```


Sergey Bronnikov

patches: fix PUC Rio Lua build

The commit 366c85564874 ("lua.c loads 'readline' dynamically") [1] breaks a build. The proposed patches fixes that. 1. https://github.com/lua/lua/commit/366c85564874d560b3608349f752e9e490f9002d


Sergey Bronnikov

cmake: update UBSan integration in LuaJIT

The patch updates integration of Undefined Behaviour Sanitizer with LuaJIT: some suppressions removed, some suppressions added per file, not project-wide. The patch is based on the patch made by Sergey Kaplun [1]. 1. https://github.com/tarantool/luajit/commit/b9ff5ae8ea60516f630a380948bfd140c237385a



Sergey Bronnikov

cfl: set fuzz-time to 2h


Sergey Bronnikov

tests/capi: speedup protobuf serialization

- clamp before cleaning string because cleaning is not cheap (O(n), where max n is equal to kMaxStrLength) - call cleaning for identifiers only, there is no sense to cleaning string literals - replace symbols disallowed by Lua grammar in indentifier's names with '_' The patch saves 16 sec on 145k samples (401 sec before the patch and 385 sec after the patch). It is actually not so much, but it is about 2.5 min per hour.


Sergey Bronnikov

cfl: fix option name

Follows up #85


Sergey Bronnikov

cfl: change a version of gh action

GH Action with enabled options `report-timeouts` and `report-ooms` [1][2] is not released yet. The patch changes a version to `master` to allow using of aforementioned options. Follows up #85 1. https://github.com/google/oss-fuzz/issues/11723 2. https://github.com/google/clusterfuzzlite/pull/138


Sergey Bronnikov

tests/capi: fix assertions in a torture_test


Sergey Bronnikov

tests: update message on creating test

The patch changes a message that CMake outputs on creating a CTest test, now message highlights that it is a Lua C API test. It is needed to distinquish with Lua API tests. The patch follows up commit e0216377d750 ("cmake: put C API tests to a separate subdirectory").


Sergey Bronnikov

ci: cleanup disk space in oss-fuzz workflow

Follows up commit c6485231cafd ("cfl: introduce an action for setting up Linux runner").


Sergey Bronnikov

cfl: do not report OOMs

`luaL_loadbuffer_proto_test` constantly reports OOM's. These fails are false-positives and really annoying. An example of such fail is below: ``` ==98== ERROR: libFuzzer: out-of-memory (used: 3524Mb; limit: 2560Mb) To change the out-of-memory limit use -rss_limit_mb=<N> Live Heap Allocations: 4748197972 bytes in 42448 chunks; quarantined: 8388640 bytes in 2 chunks; 103000 other chunks; total chunks: 145450; showing top 95% (at most 8 unique contexts) 2521827184 byte(s) (53%) in 25 allocation(s) #0 0x564a0a9b08c5 in realloc /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:85:3 #1 0x564a0ab9cd4f in lj_mem_realloc /src/lua-c-api-tests/build/luajit-v2.1/source/src/lj_gc.c:873:7 #2 0x564a0ab063d3 in lj_str_alloc /src/lua-c-api-tests/build/luajit-v2.1/source/src/lj_str.c:287:14 #3 0x564a0abacf26 in lj_buf_str /src/lua-c-api-tests/build/luajit-v2.1/source/src/./lj_buf.h:195:10 #4 0x564a0abacf26 in lj_meta_cat /src/lua-c-api-tests/build/luajit-v2.1/source/src/lj_meta.c:304:23 #5 0x564a0ab91e54 in lj_BC_CAT /src/lua-c-api-tests/build/luajit-v2.1/source/src/lj_vm.S:428 DEDUP_TOKEN: __interceptor_realloc--lj_mem_realloc--lj_str_alloc 2147483648 byte(s) (45%) in 1 allocation(s) #0 0x564a0a9b08c5 in realloc /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:85:3 #1 0x564a0ab9cd4f in lj_mem_realloc /src/lua-c-api-tests/build/luajit-v2.1/source/src/lj_gc.c:873:7 #2 0x564a0aba01b5 in buf_grow /src/lua-c-api-tests/build/luajit-v2.1/source/src/lj_buf.c:34:17 #3 0x564a0aba0711 in lj_buf_more2 /src/lua-c-api-tests/build/luajit-v2.1/source/src/lj_buf.c:85:5 #4 0x564a0abad075 in lj_buf_more /src/lua-c-api-tests/build/luajit-v2.1/source/src/./lj_buf.h:109:12 #5 0x564a0abad075 in lj_meta_cat /src/lua-c-api-tests/build/luajit-v2.1/source/src/lj_meta.c:289:7 #6 0x564a0ab91e54 in lj_BC_CAT /src/lua-c-api-tests/build/luajit-v2.1/source/src/lj_vm.S:428 DEDUP_TOKEN: __interceptor_realloc--lj_mem_realloc--buf_grow ``` The patch disables reporting of OOMS in `cflite_batch.yml` workflow by setting a flag `report-ooms` [1]. 1. https://google.github.io/oss-fuzz/getting-started/continuous-integration/#optional-configuration Fixes #85 Related to google/oss-fuzz#11723


Sergey Bronnikov

readme: update copyrights


Sergey Bronnikov

trophies: update


Sergey Bronnikov

tests: remove a comment

Follows up #72


Sergey Bronnikov

tests: enable luaL_loadbuffer_proto on AArch64

Fixes #72


Sergey Bronnikov

Revert "tests/luaL_loadbufferx_test: enable back for LuaJIT"

The issue described in #56 was not a false positive and was fixed in scope of LJ#1168. Follows up #56 This reverts commit d1e8b545fc115a91918c890603c4ec3e0b818861.


Sergey Bronnikov

ci: bump version of actions/checkout

New version fixes a warning in a Github Action web UI: > Node.js 16 actions are deprecated. Please update the following actions > to use Node.js 20: actions/checkout@v3. For more information see: > https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.


Sergey Bronnikov

cfl: fix copying dict and options files


Sergey Bronnikov

cfl: use cfl branch in a corpus repository