commit d561d929d64dccbda5a4b7be3956ce7894bd1a31 from: Ilya Verbin date: Wed Oct 16 13:58:07 2024 UTC box: fix SIGSEGV on unaligned access to `struct applier` All structures with a non-default alignment (set by `alignas()`) must be allocated by `aligned_alloc()`, otherwise an access to such a structure member fill crash, e.g. if compiled with AVX-512 support. See also commit a60ec82d4f07 ("box: fix SIGSEGV on unaligned access to a struct with extended alignment"). Closes #10699 NO_DOC=bugfix NO_CHANGELOG=minor NO_TEST=tested by debug_asan_clang workflow commit - 11145f6a82b1753e81baf8a439b29962dfef4221 commit + d561d929d64dccbda5a4b7be3956ce7894bd1a31 blob - bf9e093c4ef0bb67adfe1145767c3d852b0cb6ad blob + e5a2a20840c5a4c19e9323ead60295f6248828f7 --- src/box/applier.cc +++ src/box/applier.cc @@ -2767,8 +2767,8 @@ applier_kill(struct applier *applier, struct error *e) struct applier * applier_new(const struct uri *uri) { - struct applier *applier = (struct applier *) - xcalloc(1, sizeof(struct applier)); + struct applier *applier = xalloc_object(struct applier); + memset(applier, 0, sizeof(*applier)); if (iostream_ctx_create(&applier->io_ctx, IOSTREAM_CLIENT, uri) != 0) { free(applier); diag_raise();