Skip to content

Segfault in convertClearFollower() when follower exits abruptly #857

Description

@kadinsayani

When a dqlite follower node terminates unexpectedly (without a graceful shutdown), convertClearFollower() tries to free an invalid current_leader.address pointer, causing a crash:

#6  0x00007668d86add55 in __GI___libc_free (mem=0x1) at ./malloc/malloc.c:3375
#7  0x00007668d88c0e54 in convertClearFollower (r=0x766840003ce0) at src/raft/convert.c:49

We discovered this segfault during LXD's test_clustering_heal_networks_stop() integration test (prior to canonical/lxd#16806).

core.tar.gz contains the core dump captured at crash.

Additional information:

  • dqlite compiled with autoreconf -i && CFLAGS="-g -O0" ./configure --enable-build-raft --enable-debug && make -j
  • lxd compiled with CC="cc" CGO_LDFLAGS_ALLOW="(-Wl,-wrap,pthread_create)|(-Wl,-z,now)" go install -v -tags "libsqlite3" -trimpath -gcflags="all=-N -l" ./lxd

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions