commit e409734a22058795883c9c3bbbc21962857374cb from: Sergey Bronnikov date: Mon Jan 19 08:19:40 2026 UTC tests/capi: dump Lua samples mkdir /tmp/corpus RUNS=1 ctest -R luaL_loadbuffer_proto_test --verbose /home/sergeyb/sources/lua-c-api-tests/build/tests/capi/luaL_loadbuffer_proto/luaL_loadbuffer_proto_test -print_final_stats=1 -print_pcs=1 -reduce_inputs=1 -reload=1 -runs=1 -workers=22 -timeout=5 -jobs=5 /home/sergeyb/sources/lua-c-api-tests/corpus/corpus/luaL_loadbuffer_proto_test LUA_FUZZER_VERBOSE=1 LPM_DUMP_NATIVE_INPUT=1 /home/sergeyb/sources/lua-c-api-tests/build/tests/capi/luaL_loadbuffer_proto/luaL_loadbuffer_proto_test -print_final_stats=1 -print_pcs=1 -reduce_inputs=1 -reload=1 -runs=1 -workers=22 -timeout=5 /home/sergeyb/sources/lua-c-api-tests/corpus/corpus/luaL_loadbuffer_proto_test 2>&1 | tee log.txt ``` mkdir /tmp/lua-corpus/ go install github.com/yuin/gopher-lua/cmd/glua stat $GOPATH/bin/glua for f in /tmp/lua-corpus/*; do echo $f; glua $f; done ``` commit - fc84243ebf25fdac511e6be44330ce42573fa81b commit + e409734a22058795883c9c3bbbc21962857374cb blob - 0e7a01d1a02163c46befaf88ea005ef7cb07219d blob + febc47d215619ddb7ef87c69fac957e7bdac018f --- tests/capi/luaL_loadbuffer_proto/luaL_loadbuffer_proto_test.cc +++ tests/capi/luaL_loadbuffer_proto/luaL_loadbuffer_proto_test.cc @@ -5,6 +5,10 @@ * Copyright 2022, Tarantool AUTHORS. */ +#include +#include +#include + extern "C" { #include "lua.h" @@ -304,6 +308,11 @@ DEFINE_PROTO_FUZZER(const lua_grammar::Block &message) luaJIT_profile_dumpstack(L, "pfFlz", len, &depth); #endif /* LUAJIT */ + std::size_t hash = std::hash{}(code); + std::ofstream out("/tmp/corpus/" + std::to_string(hash) + ".lua"); + out << code; + out.close(); + if (luaL_loadbuffer(L, code.c_str(), code.size(), "fuzz") != LUA_OK) { report_error(L, "luaL_loadbuffer()"); goto end;