msgpack-c icon indicating copy to clipboard operation
msgpack-c copied to clipboard

Alignment

Open nobody93 opened this issue 5 years ago • 1 comments

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.

nobody93 avatar Dec 02 '19 07:12 nobody93

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.

  • msgpack-c version
  • Which part of msgpack-c are you using C or C++ ?
  • A minimal and complete code that reproduces the issue

redboltz avatar Jan 06 '20 01:01 redboltz