[PATCH libxcb] Fix alignment issues in FD passing code

2013-11-11 Thread Mark Kettenis
From: Mark Kettenis kette...@openbsd.org A char array on the stack is not guaranteed to have more than byte alignment. This means that casting it to a 'struct cmsghdr' and accessing its members may result in unaligned access. This will generate SIGBUS on struct alignment architectures like

Re: [PATCH libxcb] Fix alignment issues in FD passing code

2013-11-11 Thread Mouse
A char array on the stack is not guaranteed to have more than byte alignment. This means that casting it to a 'struct cmsghdr' and accessing its members may result in unaligned access. This will generate SIGBUS on struct alignment architectures like OpenBSD/sparc64. The canonical solution

Re: [Xcb] [PATCH libxcb] Fix alignment issues in FD passing code

2013-11-11 Thread Matthieu Herrb
On Mon, Nov 11, 2013 at 11:11:56PM +0100, Mark Kettenis wrote: From: Mark Kettenis kette...@openbsd.org A char array on the stack is not guaranteed to have more than byte alignment. This means that casting it to a 'struct cmsghdr' and accessing its members may result in unaligned access.