box: fix segfault in box.internal.compact
There is an internal Lua function `box.internal.compact` that used in `index_object:compact()` [1]. Tarantool has crashed when `box.internal.compact` running with id of non-existent space. Patch adds spaces cache initialization to box_init() and removes excessive check in space_cache_destroy(). 1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_index/compact/ Fixes #8196 NO_DOC=bugfix for internal Lua function NO_CHANGELOG=bugfix for internal Lua function
Showing
- src/box/box.cc 2 additions, 0 deletionssrc/box/box.cc
- src/box/schema.cc 0 additions, 3 deletionssrc/box/schema.cc
- src/box/space_cache.c 0 additions, 2 deletionssrc/box/space_cache.c
- test/box-luatest/gh_8196_crash_box_internal_compact_test.lua 20 additions, 0 deletionstest/box-luatest/gh_8196_crash_box_internal_compact_test.lua
Loading
Please register or sign in to comment