On 26 April 2017 at 07:11, Cédric Le Goater <c...@kaod.org> wrote: > yes. May be we could add this flag : > > --extra-cflags=-fsanitize=undefined > > to the travis builds using clang ? It is reporting a couple of errors on ppc64 > > target/ppc/translate.c:980:56: runtime error: left shift of negative value > -32768 > target/ppc/translate.c:983:56: runtime error: left shift of negative value -16 > hw/usb/hcd-ohci.c:1122:9: runtime error: left shift of 15 by 28 places cannot > be represented in type 'int' > hw/usb/hcd-ohci.c:1122:9: runtime error: left shift of 15 by 28 places cannot > be represented in type 'int' > hw/usb/hcd-ohci.c:1179:12: runtime error: left shift of 15 by 28 places > cannot be represented in type 'int'
All the stuff about shifts is false positives, because the sanitizer doesn't know that -fwrapv makes these operations defined behaviour. Newer versions of clang I think get this correct, and less new but not ancient clang has a flag that says "don't report that particular set of shift errors". For my pullreq tests at the moment I just use grep to filter them out: https://git.linaro.org/people/peter.maydell/misc-scripts.git/tree/greplogs but as the TODO note says I should find out what the right ubsan flag is to suppress them at source. thanks -- PMM