vinyl: clean-up unprocessed read views in *_build_read_views()
vy_write_iterator->read_views[i].history objects are allocated on region (see vy_write_iterator_push_rv()) during building history of the given key. However, in case of fail of vy_write_iterator_build_history() region is truncated but pointers to vy_write_history objects are not nullified. As a result, they may be accessed (for instance while finalizing write_iterator object in vy_write_iterator_stop) which in turn may lead to crash, segfaul or disk formatting. The same may happen if vy_read_view_merge() fails during processing of read view array. Let's clean-up those objects in case of error takes place. Part of #4864
Showing
- src/box/vy_write_iterator.c 46 additions, 12 deletionssrc/box/vy_write_iterator.c
- src/lib/core/errinj.h 1 addition, 0 deletionssrc/lib/core/errinj.h
- test/box/errinj.result 1 addition, 0 deletionstest/box/errinj.result
- test/vinyl/gh-4864-stmt-alloc-fail-compact.result 136 additions, 5 deletionstest/vinyl/gh-4864-stmt-alloc-fail-compact.result
- test/vinyl/gh-4864-stmt-alloc-fail-compact.test.lua 64 additions, 5 deletionstest/vinyl/gh-4864-stmt-alloc-fail-compact.test.lua
Loading
Please register or sign in to comment