Skip to content

SIGSEGV in space_cache_replace #10283

@ligurio

Description

@ligurio

Bug description

  • OS: Linux
  • OS Version: Ubuntu 24.04 LTS
  • Architecture: amd64

Tarantool 3.2.0-entrypoint-154-gfc3196dca
Target: Linux-x86_64-RelWithDebInfo
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_BACKTRACE=TRUE
Compiler: GNU-13.2.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/ubuntu/tarantool=. -std=c11 -Wall -Wextra -Wno-gnu-alignof-expression -fno-gnu89-inline -Wno-cast-function-type -O2 -g -DNDEBUG -ggdb -O2
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/ubuntu/tarantool=. -std=c++11 -Wall -Wextra -Wno-invalid-offsetof -Wno-gnu-alignof-expression -Wno-cast-function-type -O2 -g -DNDEBUG -ggdb -O2

Steps to reproduce

Take test_engine.lua in #10264

How to run:

Just type ./build/src/tarantool test_engine.lua --workers 1000 --engine memtx --test_duration $((10*60*60)) --verbose.

Actual behavior

<snipped>

2024-07-20 19:19:41.661 [2513953] main/124/WRK #11/test_engine I> INDEX_ALTER_OP [{"unique":true,"parts":[{"fieldno":2,"sort_order":"asc","type":"u
nsigned","exclude_null":false,"is_nullable":false},{"fieldno":4,"sort_order":"asc","type":"integer","exclude_null":false,"is_nullable":false},{"fieldno":3,"sort_order":"asc","type":"uuid","exclude_null":false,"is_nullable":false},{"fieldno":5,"sort_order":"asc","type":"string","exclude_null":false,"is_nullable":false},{"fieldno":1,"sort_order":"asc","type":"double","exclude_null":false,"is_nullable":false}],"hint":true,"id":0,"type":"TREE","space_id":512,"name":"idx_1"},{"unique":false,"parts":[["field_10"]],"if_not_exists":false,"type":"RTREE","distance":"manhattan","dimension":19
}]                                                                                                                                                 
2024-07-20 19:19:41.661 [2513953] main/124/WRK #11/test_engine I> ERROR: opname "INDEX_ALTER_OP", err "Can't create or modify index 'idx_1' in space 'test_1': primary key must be unique", args [{"unique":true,"parts":[{"fieldno":2,"sort_order":"asc","type":"unsigned","exclude_null":false,"is_nullable":false},{"fieldno":4,"sort_order":"asc","type":"integer","exclude_null":false,"is_nullable":false},{"fieldno":3,"sort_order":"asc","type":"uuid","exclude_null":false,"is_nullable":false},{"fieldno":5,"sort_order":"asc","type":"string","exclude_null":false,"is_nullable":false},{"fieldno":1,"sort_order":"asc","type":"double","exclude_null":false,"is_nullable":false}],"hint":true,"id":0,"type":"TREE","space_id":512,"name":"idx_1"},{"unique":false,"parts":[["field_10"]],"type":"RTREE","distance":"manhattan","name":"idx_1","dimension":19}]                                        
2024-07-20 19:19:41.661 [2513953] main/124/WRK #11/test_engine I> INDEX_DROP_OP [{"unique":true,"parts":[{"fieldno":2,"sort_order":"asc","type":"unsigned","exclude_null":false,"is_nullable":false},{"fieldno":4,"sort_order":"asc","type":"integer","exclude_null":false,"is_nullable":false},{"fieldno":3,"sort_order":"asc","type":"uuid","exclude_null":false,"is_nullable":false},{"fieldno":5,"sort_order":"asc","type":"string","exclude_null":false,"is_nullable":false},{"fieldno":1,"sort_order":"asc","type":"double","exclude_null":false,"is_nullable":false}],"hint":true,"id":0,"type":"TREE","space_id":512,"name":"idx_1"}]                                                                                                                  
2024-07-20 19:19:41.661 [2513953] main/124/WRK #11/test_engine I> SNAPSHOT_OP []                                                                   
2024-07-20 19:19:41.661 [2513953] main/106/checkpoint_daemon I> scheduled next checkpoint for Sat Jul 20 19:19:45 2024                             
Segmentation fault                                                                                                                                 
  code: SEGV_MAPERR                                                                                                                                
  addr: 0x57833d435239                                                                                                                             
  context: 0x578644737800                                                                                                                          
  siginfo: 0x578644737930
 rax      0x57833d435191     96221180154257                                                                                                       
  rbx      0x578645264128     96234197369128                                                                                                       
  rcx      0x414355c8         1094931912                                                                                                           
  rdx      0x0                0                                                                                                                    
  rsi      0xfffffffd         4294967293                                                                                                           
  rdi      0x5786452613a0     96234197357472                                                                                                       
  rsp      0x7246a7880a10     125647783987728                                                                                                      
  rbp      0x578645263fd0     96234197368784                                                                                                       
  r8       0x578645fae218     96234211303960                                                                                                       
  r9       0x21d              541                                                                                                                  
  r10      0x4011a1c8         1074897352                                                                                                           
  r11      0x404cc010         1078771728                                                                                                           
  r12      0x5786452613a0     96234197357472                                                                                                       
  r13      0x578645264128     96234197369128                                                                                                       
  r14      0x10401c66         272637030                                                                                                            
  r15      0x1                1                                                                                                                    
  rip      0x578642135290     96234145796752                                                                                                       
  eflags   0x10246            66118                                                                                                                
  cs       0x33               51                                         
  gs       0x0                0                                                                                                                    
  fs       0x0                0                                                                                                                    
  cr2      0x57833d435239     96221180154425                             
  err      0x4                4                                                                                                                    
  oldmask  0x0                0                                          
  trapno   0xe                14   
Current time: 1721503181
Please file a bug at https://github.com/tarantool/tarantool/issues
Attempting backtrace... Note: since the server has already crashed, 
this may fail as well
#1  0x57864225be22 in crash_signal_cb+162
#2  0x7246fa845320 in __sigaction+80
#3  0x578642135290 in space_cache_replace+624
#4  0x57864214d98b in alter_space_do(txn_stmt*, alter_space*)+587
#5  0x578642151318 in on_replace_dd_index(trigger*, void*)+952
#6  0x57864227d2c6 in trigger_run_list(rlist*, void*)+134
#7  0x57864227d3ca in trigger_run+170
#8  0x57864213349d in space_on_replace+77
#9  0x57864215c789 in txn_commit_stmt+217
#10 0x578642169e2d in box_process_rw+253
#11 0x57864216ff19 in box_replace+89
#12 0x57864220ced8 in lbox_replace+440
#13 0x57864229e373 in lj_BC_FUNCC+70
#14 0x5786422a50c7 in lua_pcall+119
#15 0x57864224047f in luaT_call+15
#16 0x578642236a0a in lua_fiber_run_f+106
#17 0x57864209cba0 in fiber_cxx_invoke(int (*)(__va_list_tag*), __va_list_tag*)+16
#18 0x578642265e66 in fiber_loop+70
#19 0x5786424d5b9c in coro_init+76

tarantool binary and full test log: https://drive.google.com/file/d/1eIaXboaJvuxEF3mXGu4NH_Gxr-VHrBzF/view?usp=sharing

NOTE: coredump is not available, I'll try to reproduce to get a coredump

Expected behavior

no crash

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions