msgpack / msgpack-c

MessagePack implementation for C and C++ / msgpack.org[C/C++]
Other
3.01k stars 875 forks source link

Alignment #820

Open nobody93 opened 4 years ago

nobody93 commented 4 years ago

Hi,

Does msgpack-c use structure? Is any chance that msgpack pack data could cause alignment issues?

I am running msgpack-c on iMX6 Linux platform, I have several messages using different data type uint16_t, uint8_t, etc, when I process those messages, it caused following kernel error, I was not clear what could cause the alignment problems as I don't use any structure in my application.

Nov 20 05:23:18 kernel: Alignment trap: not handling instruction e8532f00 at [] Nov 20 05:23:18 kernel: Unhandled fault: alignment exception (0x001) at 0x38626667 Nov 20 05:23:18 kernel: pgd = 34bdb7e7 Nov 20 05:23:18 kernel: [38626667] *pgd=00000000

Thank you.

redboltz commented 4 years ago

Does msgpack-c use structure?

Yes.

Is any chance that msgpack pack data could cause alignment issues?

msgpack-c cares about alignment. So alignment failure shouldn't be happened.

Here are alignment related codes:

https://github.com/msgpack/msgpack-c/blob/master/include/msgpack/sysdep.h#L100 https://github.com/msgpack/msgpack-c/blob/master/include/msgpack/v1/detail/cpp11_zone.hpp#L239

It might help you.

I need more information to analyze the issue.