``` bencode.c:149:14: runtime error: member access within misaligned address 0xffff9f18937f for type 'struct bencode_item_t', which requires 8 byte alignment 0xffff9f18937f: note: pointer points here 9f ff ff 00 00 14 00 00 00 00 00 00 00 98 1b 21 9f ff ff 00 00 f0 8b 9a fe ff ff 00 00 18 26 9c ^ bencode.c:50:64: runtime error: member access within misaligned address 0xffff9f18937f for type 'struct bencode_item_t', which requires 8 byte alignment 0xffff9f18937f: note: pointer points here 9f ff ff 00 00 14 00 00 00 00 00 00 00 98 1b 21 9f ff ff 00 00 f0 8b 9a fe ff ff 00 00 18 26 9c ^ bencode.c:50:54: runtime error: member access within misaligned address 0xffff9f18937f for type 'struct bencode_item_t', which requires 8 byte alignment 0xffff9f18937f: note: pointer points here 9f ff ff 00 00 14 00 00 00 00 00 00 00 98 1b 21 9f ff ff 00 00 f0 8b 9a fe ff ff 00 00 00 00 00 ^ bencode.c:50:48: runtime error: member access within misaligned address 0xffff9f18937f for type 'struct bencode_item_t', which requires 8 byte alignment 0xffff9f18937f: note: pointer points here 9f ff ff 00 00 14 00 00 00 00 00 00 00 98 1b 21 9f ff ff 00 00 f0 8b 9a fe ff ff 00 00 00 00 00 ```
This change does not help ```diff struct bencode_item { + bencode_buffer_t *buffer; bencode_item_t *parent, *child, *last_child, *sibling; bencode_type_t type; struct iovec iov[2]; /* when decoding, iov[1] contains the contents of a string object */ unsigned int iov_cnt; unsigned int str_len; /* length of the whole ENCODED object. NOT the length of a byte string */ long long int value; /* when decoding an integer, contains the value; otherwise used internally */ - bencode_buffer_t *buffer; char __buf[0]; }; ```
The structure in master branch is:
```c struct bencode_item { bencode_type_t type; struct iovec iov[2]; /* when decoding, iov[1] contains the contents of a string object */ unsigned int iov_cnt; unsigned int str_len; /* length of the whole ENCODED object. NOT the length of a byte string */ long long int value; /* when decoding an integer, contains the value; otherwise used internally */ bencode_item_t *parent, *child, *last_child, *sibling; bencode_buffer_t *buffer; char __buf[0]; }; ```
Did you shift the other fields as well, not only the one in the diff?
yes, tried to do this but no luck.
From my point of view, RTPengine uses its own memory malloc function and this function does not align memory segments.
Closing it, being long time with no activity. If anyone wants to go on with it, can just make a PR.
Closed #3058 as completed.
May be related. https://github.com/kamailio/kamailio/pull/3445
May be related. #3445
Yes, almost certainly exactly the same issue
yes, I have compiled Kamailio sources with the fix and the issue was resolved.