Skip to content

swim crash on Tarantool shutdown #10495

@nshy

Description

@nshy

It is hard to reproduce on current master (3.3.0-entrypoint). Much eaiser to reproduce with PR #10207 (without "swim: fix gc after Tarantool shutdown started" commit of course).

Run test/test-run.py --force --builddir ../build-dev app-luatest/shutdown_test.lua -p test_swim_shutdown. The Tarantool server crashes with backtrace:

#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6,
    no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007a3d15ca5463 in __pthread_kill_internal (threadid=<optimized out>, signo=6)
    at pthread_kill.c:78
#2  0x00007a3d15c4c120 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007a3d15c334c3 in __GI_abort () at abort.c:79
#4  0x00005f0d1eb9ed5d in crash_signal_cb (signo=11, siginfo=0x5f0d2aa6cfb0,
    context=0x5f0d2aa6ce80) at /home/shiny/dev/tarantool/src/lib/core/crash.c:204
#5  <signal handler called>
#6  0x00005f0d1eba68a0 in fiber_is_dead (f=0x0)
    at /home/shiny/dev/tarantool/src/lib/core/fiber.h:1176
#7  0x00005f0d1eba8aa6 in fiber_cancel (f=0x0)
    at /home/shiny/dev/tarantool/src/lib/core/fiber.c:630
#8  0x00005f0d1ebf5f86 in swim_gc (swim=0x5f0d2aae9590)
    at /home/shiny/dev/tarantool/src/lib/swim/swim.c:2257
#9  0x00005f0d1eb91abe in lua_swim_gc (L=0x40ed1378)
    at /home/shiny/dev/tarantool/src/lua/swim.c:166
#10 0x00005f0d1ec07ac7 in lj_BC_FUNCC () at buildvm_x86.dasc:811
#11 0x00005f0d1ec22f16 in gc_call_finalizer (g=0x40ed13b8, L=0x40ed1378,
    mo=0x7ffffce9d2a0, o=0x40c49070)
    at /home/shiny/dev/tarantool/third_party/luajit/src/lj_gc.c:514
#12 0x00005f0d1ec23b96 in lj_gc_finalize_cdata (L=0x40ed1378)
    at /home/shiny/dev/tarantool/third_party/luajit/src/lj_gc.c:593
#13 0x00005f0d1ec2d7b3 in cpfinalize (L=0x40ed1378, dummy=0x0, ud=0x0)
    at /home/shiny/dev/tarantool/third_party/luajit/src/lj_state.c:275
#14 0x00005f0d1ec07eb8 in lj_vm_cpcall () at buildvm_x86.dasc:1204
#15 0x00005f0d1ec2d921 in lua_close (L=0x40ed1378)
    at /home/shiny/dev/tarantool/third_party/luajit/src/lj_state.c:308
#16 0x00005f0d1eb6d43d in tarantool_lua_free ()
    at /home/shiny/dev/tarantool/src/lua/init.c:1252
#17 0x00005f0d1e8d502e in tarantool_free ()
    at /home/shiny/dev/tarantool/src/main.cc:562
#18 0x00005f0d1e8d603b in main (argc=1, argv=0x5f0d2aa63e78)
    at /home/shiny/dev/tarantool/src/main.cc:1104

It is easier to reproduce with #10207 because we start to call lua_close on Tarantool exit there. So all Lua objects are collected.
Yet the issue is possible in 3.2 as after swim worker fiber is finished Lua can collect swim object just due to memory pressure.

Introduced in 3.2.0-entrypoint-128-g1f41645219.

Metadata

Metadata

Assignees

Labels

3.2Target is 3.2 and all newer release/master branchesbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions