Skip to content

./src/box/tuple_compare.cc:1020: Assertion `fc_b >= key_def->part_count' failed. #10099

Closed
@ligurio

Description

@ligurio

Bug description

  • OS: Linux
  • OS Version: 22.04
  • Architecture: amd64

Tarantool 3.2.0-entrypoint-56-g05d03a1c58
Target: Linux-x86_64-Debug
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_BACKTRACE=TRUE
Compiler: GNU-11.4.0
C_FLAGS: -fexceptions -funwind-tables -fasynchronous-unwind-tables -fno-common -msse2 -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -fPIC -fmacro-prefix-map=/home/sergeyb/sources/MRG/tarantool=. -std=c11 -Wall -Wextra -Wno-gnu-alignof-expression -fno-gnu89-inline -Wno-cast-function-type -Werror -g -ggdb -O0
CXX_FLAGS: -fexceptions -funwind-tables -fasynchronous-unwind-tables -fno-common -msse2 -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -fPIC -fmacro-prefix-map=/home/sergeyb/sources/MRG/tarantool=. -std=c++11 -Wall -Wextra -Wno-invalid-offsetof -Wno-gnu-alignof-expression -Wno-cast-function-type -Werror -g -ggdb -O0

Steps to reproduce

Actually, there are no exact steps to reproduce.

Actual behavior

$  taskset 0xef ./tarantool vinyl.lua --workers 50 --test_duration 30 --engine vinyl
[1] ~/sources/snippets/tarantool-tools$ taskset 0xef ./tarantool vinyl.lua --workers 50 --test_duration 30 --engine vinyl                          
Random seed: 1717604553                                                                                                                            
CLEANUP                                                                                                                                            
SETUP                                                                                                                                              
2024-06-05 19:22:33.458 [855568] main/104/vinyl.lua I> Tarantool 3.2.0-entrypoint-56-g05d03a1c58 Linux-x86_64-Debug                                
2024-06-05 19:22:33.458 [855568] main/104/vinyl.lua I> log level 5 (INFO)                                                                          
2024-06-05 19:22:33.458 [855568] main/104/vinyl.lua I> wal/engine cleanup is paused                                                                
2024-06-05 19:22:33.458 [855568] main/104/vinyl.lua I> mapping 67108864 bytes for memtx tuple arena...                                             
2024-06-05 19:22:33.458 [855568] main/104/vinyl.lua I> Actual slab_alloc_factor calculated on the basis of desired slab_alloc_factor = 1.044274    
2024-06-05 19:22:33.458 [855568] main/104/vinyl.lua I> mapping 16777216 bytes for vinyl tuple arena...
2024-06-05 19:22:33.466 [855568] main/104/vinyl.lua I> update replication_synchro_quorum = 1
2024-06-05 19:22:33.466 [855568] main/104/vinyl.lua I> instance uuid 355860bb-953d-4f73-8c57-8136f09b1005
2024-06-05 19:22:33.466 [855568] main/104/vinyl.lua I> initializing an empty data directory
2024-06-05 19:22:33.489 [855568] main/104/vinyl.lua I> assigned id 1 to replica 355860bb-953d-4f73-8c57-8136f09b1005
2024-06-05 19:22:33.489 [855568] main/104/vinyl.lua I> update replication_synchro_quorum = 1
2024-06-05 19:22:33.489 [855568] main/104/vinyl.lua I> replicaset uuid e95d3f3e-41fb-4b4f-995d-66cf77ab2d60
2024-06-05 19:22:33.490 [855568] snapshot/101/main I> saving snapshot `./00000000000000000000.snap.inprogress'
2024-06-05 19:22:33.502 [855568] snapshot/101/main I> done
2024-06-05 19:22:33.502 [855568] main/104/vinyl.lua I> ready to accept requests
2024-06-05 19:22:33.502 [855568] main/105/gc I> wal/engine cleanup is resumed
2024-06-05 19:22:33.502 [855568] main/104/vinyl.lua/box.load_cfg I> set 'memtx_memory' configuration option to 1048576
2024-06-05 19:22:33.502 [855568] main/104/vinyl.lua/box.load_cfg I> set 'vinyl_memory' configuration option to 10485760
2024-06-05 19:22:33.502 [855568] main/104/vinyl.lua/box.load_cfg I> set 'vinyl_cache' configuration option to 9
2024-06-05 19:22:33.502 [855568] main/104/vinyl.lua/box.load_cfg I> set 'vinyl_timeout' configuration option to 4
2024-06-05 19:22:33.502 [855568] main/104/vinyl.lua/box.load_cfg I> set 'vinyl_max_tuple_size' configuration option to 14812
2024-06-05 19:22:33.503 [855568] main/104/vinyl.lua/box.load_cfg I> set 'checkpoint_count' configuration option to 1
2024-06-05 19:22:33.503 [855568] main/104/vinyl.lua/box.load_cfg I> set 'checkpoint_wal_threshold' configuration option to 918
2024-06-05 19:22:33.503 [855568] main/104/vinyl.lua/box.load_cfg I> set 'checkpoint_interval' configuration option to 41
2024-06-05 19:22:33.504 [855568] main/104/vinyl.lua/vinyl I> FINISH BOX.CFG
2024-06-05 19:22:33.504 [855568] main/104/vinyl.lua/vinyl I> CREATE A SPACE
2024-06-05 19:22:33.504 [855568] main/104/vinyl.lua/vinyl I> {"format":[{"name":"name_1","type":"integer"},{"name":"name_2","type":"uuid"},{"name":
"name_3","type":"decimal"},{"name":"name_4","type":"boolean"}],"if_not_exists":false,"is_local":false,"field_count":0,"engine":"vinyl"}
2024-06-05 19:22:33.504 [855568] main/106/checkpoint_daemon I> scheduled next checkpoint for Wed Jun  5 19:23:52 2024
2024-06-05 19:22:33.505 [855568] main/104/vinyl.lua/vinyl I> ERROR: Can't create or modify index 'idx_32' in space 'test_91': primary key must be unique ({"unique":false,"parts":[["name_1"],["name_2"]],"if_not_exists":false,"bloom_fpr":0.41,"type":"TREE"})
2024-06-05 19:22:33.517 [855568] main/104/vinyl.lua/vinyl I> FINISH SETUP 
2024-06-05 19:22:33.532 [855568] main/114/WORKER #1/vinyl I> {"unique":true,"parts":[{"fieldno":1,"sort_order":"asc","type":"integer","exclude_null":false,"is_nullable":false}],"id":0,"space_id":512,"type":"TREE","name":"idx_34","options":{"page_size":8192,"run_count_per_level":7,"run_size_ratio":2,"bloom_fpr":0.09}}
2024-06-05 19:22:33.532 [855568] main/114/WORKER #1/vinyl I> {"unique":true,"parts":[{"fieldno":1,"sort_order":"asc","type":"integer","exclude_null
":false,"is_nullable":false}],"id":0,"space_id":512,"type":"TREE","name":"idx_34","options":{"page_size":8192,"run_count_per_level":7,"run_size_ratio":2,"bloom_fpr":0.09}}

<snipped>

2024-06-05 19:22:33.613 [855568] main/140/WORKER #27/vinyl I> ERROR: Duplicate key exists in unique index "idx_34" in space "test_91" with old tuple - [329071139408, e0cc4b35-1661-48e7-9201-6597eae62844, 817063850936, false] and new tuple - [329071139408, e0cc4b35-1661-48e7-9201-6597eae62844, 817063850936, false]
2024-06-05 19:22:33.613 [855568] main/125/WORKER #12/vinyl I> ["REPLACE_OP",[[66352317204,"c5a2dea3-926a-4a86-b423-80bd477d81fa","427573241736",true]]]
2024-06-05 19:22:33.613 [855568] main/141/WORKER #28/vinyl I> ["INSERT_OP",[[594603138543,"d28ead3f-aa7d-45c8-aaf6-ed36d4a33dfd","262433753496",true]]]
2024-06-05 19:22:33.613 [855568] main/141/WORKER #28/vinyl I> ERROR: Duplicate key exists in unique index "idx_34" in space "test_91" with old tuple - [594603138543, d28ead3f-aa7d-45c8-aaf6-ed36d4a33dfd, 262433753496, true] and new tuple - [594603138543, d28ead3f-aa7d-45c8-aaf6-ed36d4a33dfd, 262433753496, true]
2024-06-05 19:22:33.613 [855568] main/145/WORKER #32/vinyl I> ["INSERT_OP",[[176255080257,"37abd1f4-1fa3-4edf-8191-1d9cb56edc08","155181039308",false]]]
2024-06-05 19:22:33.613 [855568] main/145/WORKER #32/vinyl I> ERROR: Duplicate key exists in unique index "idx_34" in space "test_91" with old tuple - [176255080257, 37abd1f4-1fa3-4edf-8191-1d9cb56edc08, 155181039308, false] and new tuple - [176255080257, 37abd1f4-1fa3-4edf-8191-1d9cb56edc08, 155181039308, false]
2024-06-05 19:22:33.613 [855568] main/151/WORKER #38/vinyl I> ["SELECT_OP",[[405470277355]]]
tarantool: ./src/box/tuple_compare.cc:1020: int tuple_compare_sequential(tuple*, hint_t, tuple*, hint_t, key_def*) [with bool is_nullable = false; bool has_optional_parts = false; bool has_desc_parts = false; hint_t = long unsigned int]: Assertion `fc_b >= key_def->part_count' failed.
Aborted (core dumped)

coredump and tarantool binary: gh-10099-core.zip

backtrace:

#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=131949695036096) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=131949695036096) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=131949695036096, signo=signo@entry=6) at ./nptl/pthread_kill.c:89                                           
#3  0x00007801ed842476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26  
#4  0x00007801ed8287f3 in __GI_abort () at ./stdlib/abort.c:79                                                                                     
#5  0x00007801ed82871b in __assert_fail_base (fmt=0x7801ed9dd130 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=0x6064f8cf4190 "fc_b >= key_def->part_count", file=0x6064f8cf3341 "./src/box/tuple_compare.cc", line=1020, function=<optimized out>)
    at ./assert/assert.c:92                                              
#6  0x00007801ed839e96 in __GI___assert_fail (assertion=0x6064f8cf4190 "fc_b >= key_def->part_count", 
    file=0x6064f8cf3341 "./src/box/tuple_compare.cc", line=1020, 
    function=0x6064f8cf4030 "int tuple_compare_sequential(tuple*, hint_t, tuple*, hint_t, key_def*) [with bool is_nullable = false; bool has_option
al_parts = false; bool has_desc_parts = false; hint_t = long unsigned int]") at ./assert/assert.c:101                                            
#7  0x00006064f897e294 in tuple_compare_sequential<false, false, false> (tuple_a=0x6064f92f5900, tuple_a_hint=18446744073709551615, 
    tuple_b=0x6064f92ee190, tuple_b_hint=18446744073709551615, key_def=0x6064f90e95a0)
    at /home/sergeyb/sources/MRG/tarantool/src/box/tuple_compare.cc:1020                                                                           
#8  0x00006064f84df111 in tuple_compare (tuple_a=0x6064f92f5900, tuple_a_hint=18446744073709551615, tuple_b=0x6064f92ee190, 
    tuple_b_hint=18446744073709551615, key_def=0x6064f90e95a0) at /home/sergeyb/sources/MRG/tarantool/src/box/key_def.h:1077
#9  0x00006064f84df788 in vy_stmt_compare (a=0x6064f92f5900, a_hint=18446744073709551615, b=0x6064f92ee190, b_hint=18446744073709551615, 
    key_def=0x6064f90e95a0) at /home/sergeyb/sources/MRG/tarantool/src/box/vy_stmt.h:427                                           
#10 0x00006064f84e04e0 in vy_apply_result_does_cross_pk (old_stmt=0x6064f92f5900, result=0x7801eb08b3a8 "\220", 'P' <repeats 199 times>..., 
    result_end=0x7801eb08b3a9 'P' <repeats 200 times>..., cmp_def=0x6064f90e95a0, col_mask=18446744073709551615)                   
    at /home/sergeyb/sources/MRG/tarantool/src/box/vy_upsert.c:53                                                                                  
#11 0x00006064f84e0915 in vy_apply_upsert_on_terminal_stmt (upsert=0x6064f92fdd60, stmt=0x6064f92f5900, cmp_def=0x6064f90e95a0, 
    suppress_error=true) at /home/sergeyb/sources/MRG/tarantool/src/box/vy_upsert.c:139   
#12 0x00006064f84e0c83 in vy_apply_upsert (new_stmt=0x6064f92fdd60, old_stmt=0x6064f92f5900, cmp_def=0x6064f90e95a0, suppress_error=true)
    at /home/sergeyb/sources/MRG/tarantool/src/box/vy_upsert.c:204
#13 0x00006064f84e18b5 in vy_entry_apply_upsert (new_entry=..., old_entry=..., cmp_def=0x6064f90e95a0, suppress_error=true)
    at /home/sergeyb/sources/MRG/tarantool/src/box/vy_upsert.h:76
#14 0x00006064f84e1ce4 in vy_history_apply (history=0x7801a8380a80, cmp_def=0x6064f90e95a0, keep_delete=true, upserts_applied=0x7801a8380a64, 
    ret=0x7801a8380ac0) at /home/sergeyb/sources/MRG/tarantool/src/box/vy_history.c:106
#15 0x00006064f84c444d in vy_read_iterator_apply_history (itr=0x7801eb0e0110, ret=0x7801a8380ac0)
    at /home/sergeyb/sources/MRG/tarantool/src/box/vy_read_iterator.c:886
#16 0x00006064f84c4667 in vy_read_iterator_next (itr=0x7801eb0e0110, result=0x7801a8380b30)
    at /home/sergeyb/sources/MRG/tarantool/src/box/vy_read_iterator.c:930
#17 0x00006064f84856e0 in vinyl_iterator_primary_next (base=0x7801eb0e0090, ret=0x7801a8380c10)
    at /home/sergeyb/sources/MRG/tarantool/src/box/vinyl.c:3656
#18 0x00006064f841ebe2 in iterator_next (it=0x7801eb0e0090, ret=0x7801a8380c10) at /home/sergeyb/sources/MRG/tarantool/src/box/index.cc:645
#19 0x00006064f8551d69 in box_select (space_id=512, index_id=0, iterator=5, offset=95, limit=125, key=0x7801eb08b241 <incomplete sequence \317>, 
    key_end=0x7801eb08b24a "PPPPPP`\242\342\370d`", packed_pos=0x7801a8380ce8, packed_pos_end=0x7801a8380cf0, update_pos=false, 
    port=0x7801a8380d00) at /home/sergeyb/sources/MRG/tarantool/src/box/box.cc:3851
#20 0x00006064f8665373 in lbox_select (L=0x42017868) at /home/sergeyb/sources/MRG/tarantool/src/box/lua/misc.cc:445
#21 0x00006064f872ecc7 in lj_BC_FUNCC () at buildvm_x86.dasc:811
#22 0x00006064f873c83f in lua_pcall (L=0x42017868, nargs=1, nresults=-1, errfunc=0)
    at /home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/lj_api.c:1173
#23 0x00006064f86a1afc in luaT_call (L=0x42017868, nargs=1, nreturns=-1) at /home/sergeyb/sources/MRG/tarantool/src/lua/utils.c:687
#24 0x00006064f8697d1c in lua_fiber_run_f (ap=0x7801eb015b88) at /home/sergeyb/sources/MRG/tarantool/src/lua/fiber.c:426
#25 0x00006064f83fe147 in fiber_cxx_invoke(fiber_func, typedef __va_list_tag __va_list_tag *) (f=0x6064f8697c5f <lua_fiber_run_f>, 
    ap=0x7801eb015b88) at /home/sergeyb/sources/MRG/tarantool/src/lib/core/fiber.h:1311
#26 0x00006064f86d0bd1 in fiber_loop (data=0x0) at /home/sergeyb/sources/MRG/tarantool/src/lib/core/fiber.c:1159
#27 0x00006064f8aba0f6 in coro_init () at /home/sergeyb/sources/MRG/tarantool/third_party/coro/coro.c:108
(gdb) 

Expected behavior

no crash

Metadata

Metadata

Assignees

Labels

2.11Target is 2.11 and all newer release/master branches3.1Target is 3.1 and all newer release/master branchesbugSomething isn't workingcrashfuzzingvinyl

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions