Skip to content

Instantly share code, notes, and snippets.

@olee
Created January 14, 2026 02:47
Show Gist options
  • Select an option

  • Save olee/1cd64b337193d9ff903c8ef75e43e03c to your computer and use it in GitHub Desktop.

Select an option

Save olee/1cd64b337193d9ff903c8ef75e43e03c to your computer and use it in GitHub Desktop.
Reproduction script for Manticore table corruption & crash when trying to add a MVA64 column using columnar engine

Instructions

  • Install go
  • Start manticore docker run -d --name manticore -p 9308:9308 manticoresearch/manticore:dev-16.2.3
  • Execute script using go run .

Because of the crash, Manticore seems to be unable to properly drop the table afterwards. In order to try again, you need to remove leftover files using

docker exec manticore rm -r crash_table

Expected Error

After the script completes, manticore should have crashed with the following error:

------- FATAL: CRASH DUMP -------
[Wed Jan 14 02:41:58.601 2026] [ 1]

--- crashed SphinxQL request dump ---
�����y�����yWHERE match('Lorem') LIMIT 10
--- request dump end ---
--- local index:�
Manticore 16.2.3 5d39e58b8@26010516 dev (columnar 9.0.2 5b73f8d@25122308) (secondary 9.0.2 5b73f8d@25122308) (knn 9.0.2 5b73f8d@25122308) (embeddings 1.0.1)
Handling signal 11
-------------- backtrace begins here ---------------
Program compiled with Clang 16.0.6
Configured with flags: Configured with these definitions: -DDISTR_BUILD=jammy -DUSE_SYSLOG=1 -DWITH_GALERA=1 -DWITH_RE2=1 -DWITH_RE2_FORCE_STATIC=1 -DWITH_STEMMER=1 -DWITH_STEMMER_FORCE_STATIC=1 -DWITH_NLJSON=1 -DWITH_UNIALGO=1 -DWITH_ICU=1 -DWITH_ICU_FORCE_STATIC=1 -DWITH_JIEBA=1 -DWITH_SSL=1 -DWITH_ZLIB=1 -DWITH_ZSTD=1 -DDL_ZSTD=1 -DZSTD_LIB=libzstd.so.1 -DWITH_CURL=1 -DDL_CURL=1 -DCURL_LIB=libcurl.so.4 -DWITH_ODBC=1 -DDL_ODBC=1 -DODBC_LIB=libodbc.so.2 -DWITH_EXPAT=1 -DDL_EXPAT=1 -DEXPAT_LIB=libexpat.so.1 -DWITH_ICONV=1 -DWITH_MYSQL=1 -DDL_MYSQL=1 -DMYSQL_LIB=libmysqlclient.so.21 -DWITH_POSTGRESQL=1 -DDL_POSTGRESQL=1 -DPOSTGRESQL_LIB=libpq.so.5 -DLOCALDATADIR=/var/lib/manticore -DFULL_SHARE_DIR=/usr/share/manticore
Built on Linux x86_64 (jammy) (cross-compiled)
Stack bottom = 0x79ec29eeebb0, thread stack size = 0x20000
Trying manual backtrace:
Something wrong with thread stack, manual backtrace may be incorrect (fp=0x20000)
Wrong stack limit or frame pointer, manual backtrace failed (fp=0x20000, stack=0x79ec29ef0000, stacksize=0x20000)
Trying system backtrace:
begin of system symbols:
Trying boost backtrace:
0# sphBacktrace(int, bool) in searchd
1# HandleCrash(int) in searchd
2# 0x000079EC4C09B330 in /lib/x86_64-linux-gnu/libc.so.6
3# 0x000079EC4C1DEBE4 in /lib/x86_64-linux-gnu/libc.so.6
4# CSphWriter::PutBytes(void const*, long) in searchd
5# BlobRowBuilder_File_c::Flush(unsigned char const*) in searchd
6# bool AttrMerger_c::Impl_c::CopyMixedAttributes_T<true, true, true, true, false, false>(CSphIndex const&, VecTraits_T<unsigned int> const&) in searchd
7# CSphIndex_VLN::DoMerge(CSphIndex_VLN const*, CSphIndex_VLN const*, ISphFilter const*, CSphString&, CSphIndexProgress&, bool, bool) in searchd
8# sphMerge(CSphIndex const*, CSphIndex const*, VecTraits_T<CSphFilterSettings>, CSphIndexProgress&, CSphString&) in searchd
9# RtIndex_c::MergeDiskChunks(char const*, CSphRefcountedPtr<DiskChunk_c const> const&, CSphRefcountedPtr<DiskChunk_c const> const&, CSphIndexProgress&, VecTraits_T<CSphFilterSettings>) in searchd
10# RtIndex_c::MergeTwoChunks(int, int, int*, CSphString*) in searchd
11# RtIndex_c::ProgressiveOptimize(int) in searchd
12# RtIndex_c::Optimize(OptimizeTask_t) in searchd
13# 0x000056EFA52637CC in searchd
14# Threads::CoRoutine_c::CreateContext(std::function<void ()>, std::pair<boost::context::stack_context, Threads::StackFlavour_E>)::{lambda(boost::context::detail::transfer_t)#1}::__invoke(boost::context::detail::transfer_t) in searchd
15# make_fcontext in searchd

-------------- backtrace ends here ---------------
Please, create a bug report in our bug tracker (https://github.com/manticoresoftware/manticore/issues)
and attach there:
a) searchd log, b) searchd binary, c) searchd symbols.
Look into the chapter 'Reporting bugs' in the manual
(https://manual.manticoresearch.com/Reporting_bugs)
module main
go 1.25.5
require github.com/manticoresoftware/manticoresearch-go v1.10.0
require gopkg.in/validator.v2 v2.0.1 // indirect
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/manticoresoftware/manticoresearch-go v1.10.0 h1:kQjCPSB85m6gx3q9YDf5pAXEdgdJWOpFDIuNkV0rwEI=
github.com/manticoresoftware/manticoresearch-go v1.10.0/go.mod h1:iS4Ip3xUIKfiM94NL0e0b+cCkBxxPTmfrnosfsLfSDw=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/validator.v2 v2.0.1 h1:xF0KWyGWXm/LM2G1TrEjqOu4pa6coO9AlWSf3msVfDY=
gopkg.in/validator.v2 v2.0.1/go.mod h1:lIUZBlB3Im4s/eYp39Ry/wkR02yOPhZ9IwIRBjuPuG8=
package main
import (
"context"
"encoding/json"
"fmt"
"strings"
"time"
manticore_client "github.com/manticoresoftware/manticoresearch-go"
)
const tableName = "crash_table"
const manticoreHost = "http://localhost:9308"
const BATCH_COUNT = 10
const BATCH_SIZE = 10000
type Product struct {
Name string `json:"name"`
Description string `json:"description"`
}
type ReplacePayload[T any] struct {
Index string `json:"index"`
Id *int64 `json:"id,omitempty"`
Doc T `json:"doc"`
}
type BulkPayload[T any] struct {
Replace ReplacePayload[T] `json:"replace"`
}
func assertNoError(err error) {
if err != nil {
panic(err)
}
}
func main() {
var err error
ctx := context.Background()
// Create Manticore client
config := manticore_client.NewConfiguration()
config.Servers = manticore_client.ServerConfigurations{
{URL: manticoreHost},
}
client := manticore_client.NewAPIClient(config)
// Drop table if it already exists
fmt.Printf("Dropping table %s\n", tableName)
_, _, err = client.UtilsAPI.
Sql(ctx).
Body(fmt.Sprintf(`DROP TABLE IF EXISTS %s`, tableName)).
Execute()
assertNoError(err)
time.Sleep(1 * time.Second)
fmt.Printf("Creating table %s\n", tableName)
_, _, err = client.UtilsAPI.
Sql(ctx).
Body(fmt.Sprintf(`CREATE TABLE IF NOT EXISTS %s (
name STRING ATTRIBUTE INDEXED,
description TEXT
)`, tableName)).
Execute()
assertNoError(err)
time.Sleep(1 * time.Second)
// Insert documents in batches
for batch := 0; batch < BATCH_COUNT; batch++ {
fmt.Printf("Inserting batch %d\n", batch)
var bulkLines []string
for i := 0; i < BATCH_SIZE; i++ {
index := int64(batch*BATCH_SIZE + i)
jsonBytes, _ := json.Marshal(BulkPayload[Product]{
Replace: ReplacePayload[Product]{
Index: tableName,
Id: &index,
Doc: Product{
Name: fmt.Sprintf("Product Name %d", index),
Description: strings.Repeat("Lorem ipsum dolor sit amet, consectetur adipiscing elit. ", 100),
},
},
})
bulkLines = append(bulkLines, string(jsonBytes))
}
bulkBody := strings.Join(bulkLines, "\n") + "\n"
_, _, err = client.IndexAPI.Bulk(ctx).Body(bulkBody).Execute()
assertNoError(err)
}
// Run test query
fmt.Println("Running test query to check if data is inserted")
_, _, err = client.UtilsAPI.Sql(ctx).Body(fmt.Sprintf(`SELECT * FROM %s WHERE match('Lorem') LIMIT 10`, tableName)).Execute()
assertNoError(err)
fmt.Println("Add new mva64 columnar column")
_, _, err = client.UtilsAPI.Sql(ctx).Body(fmt.Sprintf(`ALTER TABLE %s ADD COLUMN attribute_ids MULTI64 ENGINE='columnar' `, tableName)).Execute()
assertNoError(err)
fmt.Println("Triggering optimize (which will crash manticore)")
_, _, err = client.UtilsAPI.Sql(ctx).Body(fmt.Sprintf(`OPTIMIZE TABLE %s OPTION cutoff=2`, tableName)).Execute()
assertNoError(err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment