Open jengelh opened 1 year ago
777 if (!pool_list) {
778 pool_list = MALLOC(pool_list_size);
779 if (!pool_list) {
780 return NULL;
781 }
782
783 INIT_LIST_HEAD(&pool_list->thr_list);
784 (void)pthread_spin_init(&pool_list->lock, PTHREAD_PROCESS_PRIVATE);
785 for (i = 0; i < NPOOLS; ++i) {
786 pool_list->pools[i].parent = &pools[i];
787 pool_list->pools[i].hot_list = NULL;
788 pool_list->pools[i].cold_list = NULL;
789 }
790 }
NPOOLS is 14. pool_list_size is reported to be 336, which is 14 sizeof(pool_list), which is not enough for a struct with hanging tail.
(gdb) ptyp *pool_list
type = struct per_thread_pool_list {
struct list_head thr_list;
pthread_spinlock_t lock;
_Bool poison;
per_thread_pool_t pools[];
}
Blech:
pool_list_size = sizeof(per_thread_pool_list_t) +
sizeof(per_thread_pool_t) * (NPOOLS - 1);
Does it happen without memory pools?
(mempool=no tcmalloc=yes) startup runs fine. In openSUSE, glusterfs was built without tcmalloc. One dependency less…
(mempool=no tcmalloc=yes) startup runs fine. In openSUSE, glusterfs was built without tcmalloc. One dependency less…
Tests have shown to improve performance nicely with tcmalloc (and without memory pools).
Well then remove --without-tcmalloc?
The patch (https://github.com/gluster/glusterfs/pull/4196) is reverted from release-11 to avoid an issue.
Just the revert isn't enough to fix the crash in the debian package of 11.0. With the patch from https://github.com/gluster/glusterfs/pull/4193, then it no longer crashes, and the DEP8 tests pass.
Just the revert isn't enough to fix the crash in the debian package of 11.0. With the patch from #4193, then it no longer crashes, and the DEP8 tests pass.
Let me update that statement: the revert does seem enough in the sense that the crash no longer happens.
Description of problem:
glusterd from glusterfs-11 just dies on startup. With ASAN enabled I get
(Without ASAN, glibc malloc throws an assert at some stage in the glusterd initialization due to to corruption.)
The exact command to reproduce the issue:
- The operating system / glusterfs version:
openSUSE Tumbleweed 20230701 gcc 13.1.1