[SR-Users] What is the alignment of shm_malloc and friends?

Richard Chan shihping.chan at gmail.com
Mon Jun 20 16:52:47 CEST 2022


On Mon, 20 Jun 2022 at 7:09 PM, Daniel-Constantin Mierla <miconda at gmail.com>
wrote:

> Hello,
>
> iirc, the alignment is to sizeof(void*), which is 8.
>
> I haven't met cases when the alignment is required to be different that
> the size of the pointer/memory address. Any particular reason for
> wolfssl to require that?
>
>
https://www.gnu.org/software/libc/manual/html_node/Aligned-Memory-Blocks.html
Modern malloc/realloc return 16 byte aligned memory on 64bit systems
so 3rd party libraries now assume this behaviour.

wolfSSL has some optimisations with aligned data and Debian has this flag
on by default in 5.2.0. I did verify that without this flag existing shm
functions work.
With this flag turned on Kamailio will segfault unless I add wrappers to
align up
to 16 bytes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220620/d5e3e194/attachment.htm>


More information about the sr-users mailing list