Skip to content

Master crashes when processing an anonymous subscribe request with a nil uuid #11531

@sergepetrenko

Description

@sergepetrenko

Steps to reproduce: run the following script on a single tarantool instance:

box.cfg{listen = 3301}
box.once("bootstrap", function()
    box.schema.user.grant('guest', 'replication')
end)

nb = require("net.box")
c = nb.connect(3301)

require('fiber').sleep(0.1)

c:_inject(
    box.iproto.encode_packet(
        {
            [box.iproto.key.SYNC] = c:_next_sync(),
            [box.iproto.key.REQUEST_TYPE] = box.iproto.type.SUBSCRIBE,
        },
        {
            [box.iproto.key.REPLICASET_UUID] = box.info.replicaset and box.info.replicaset.uuid or box.info.cluster.uuid,
            [box.iproto.key.REPLICA_ANON] = true,
        }
))

On versions 3.3, 3.4, master, it'll result in a crash:

2025-05-26 14:14:53.099 [14069] main/129/main box.cc:5205 I> subscribed replica 00000000-0000-0000-0000-000000000000 at fd 20, aka [::1]:3301, peer of [::1]:62980
2025-05-26 14:14:53.099 [14069] main/129/main box.cc:5207 I> remote vclock {} local vclock {1: 1}
tarantool> Segmentation fault
  code: SEGV_ACCERR
  addr: 0x64
  context: 0x1280a7c18
  siginfo: 0x1280a7bb0
Current time: 1748258093
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  0x1051f0ddc in crash_collect+192
#2  0x1051f0ca0 in crash_signal_cb+84
#3  0x188f60624 in _sigtramp+56
#4  0x10505cf1c in box_process_subscribe(iostream*, xrow_header const*)+4444
#5  0x10505cf1c in box_process_subscribe(iostream*, xrow_header const*)+4444
#6  0x104ef9ba4 in tx_process_replication(cmsg*)+860
#7  0x105208360 in cmsg_deliver+52
#8  0x10520a50c in fiber_pool_f+824
#9  0x104eedfe4 in fiber_cxx_invoke(int (*)(char*), char*)+32
#10 0x1051fc1f0 in fiber_loop+264
#11 0x105601d18 in coro_startup+8

On version 3.2 (and probably 2.11) it'll result in an assertion failure in debug build:

Assertion failed: (!tt_uuid_is_nil(replica_uuid)), function replicaset_add_anon, file replication.cc, line 356.

In release build everything seems to work on these versions.

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions