[PATCH v7] eal: fix rte_memcpy strict aliasing/alignment bugs

Luc Pelletier lucp.at.work at gmail.com
Fri Apr 8 15:47:59 CEST 2022


Hi David,

Le jeu. 7 avr. 2022 à 11:24, David Marchand
<david.marchand at redhat.com> a écrit :

> > As a side note, we probably need to check other similar places in DPDK code.
>
> What would be the best way to detect those problematic places?

As far as I'm aware, there is no silver bullet to detect all strict
aliasing violations. A good summary of the different options are
described here:

https://gist.github.com/shafik/848ae25ee209f698763cffee272a58f8#catching-strict-aliasing-violations

However, this is not 100% and might still miss some strict aliasing violations.

The bottom line is that anywhere there's a cast to something other
than void* or char*, it could be a strict aliasing violation. So,
doing an exhaustive search throughout the code base for casts seems
like the only (tedious, time-consuming) solution.


More information about the stable mailing list