Re: [PATCH] xf86drm: ensure proper alignment of pointers in drmProcessPciDevice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Emil,

On 14.05.2016 18:03, Emil Velikov wrote:
Hi Nicolai,

On 13 May 2016 at 07:14, Nicolai Hähnle <nhaehnle@xxxxxxxxx> wrote:
From: Nicolai Hähnle <nicolai.haehnle@xxxxxxx>

Previously, (*device)->businfo.pci would end up misaligned, which results
in undefined behavior.

Can you point me to a source where I can read more on the topic ?
I'm pretty sure I ran this through valgrind and it gave a clear bill of health.

Valgrind doesn't complain here either, I noticed it with -fsanitize=undefined (ubsan) applied to Mesa.

That makes sense, since unaligned loads/stores aren't really a bug as far as the x86 ISA is concerned, which is the level at which valgrind looks at the code. On the other hand, apparently already an unaligned cast (not just the dereference!) is undefined behavior as far as C is concerned. I'm not a C language lawyer, but that's what people are saying on the interwebs, so it must be true :)

P.S. Please run the following in your repo $git config --local
format.subjectPrefix "PATCH libdrm"

Done.

Cheers,
Nicolai
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux