From 55ce39d543e8c91e387b8585888fdf205b2746b1 Mon Sep 17 00:00:00 2001 From: bibby Date: Wed, 16 Oct 2019 15:36:33 -0400 Subject: [PATCH] Attempting to destroy the opts.cst will segfault Reference: https://github.com/facebook/rocksdb/issues/1095 The cst has alredy been consumed when associated with the prefix_extractor --- options.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/options.go b/options.go index 5f80d1af..07000215 100644 --- a/options.go +++ b/options.go @@ -1202,9 +1202,8 @@ func (opts *Options) Destroy() { if opts.ccmp != nil { C.rocksdb_comparator_destroy(opts.ccmp) } - if opts.cst != nil { - C.rocksdb_slicetransform_destroy(opts.cst) - } + // don't destroy the opts.cst here, it has already been + // associated with a PrefixExtractor and this will segfault if opts.ccf != nil { C.rocksdb_compactionfilter_destroy(opts.ccf) }