[LLVMdev] UBSan detects misaligned memory accesses in llvm-profdata and llvm-cov

Justin Bogner mail at justinbogner.com
Fri Sep 12 14:42:01 PDT 2014


Alexey Samsonov <vonosmas at gmail.com> writes:
> Hi!
>
> UBSan bootstrap bot fails with error report on 5 llvm-cov and llvm-profdata
> lit-tests:
> http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/4526
> /steps/check-llvm%20ubsan/logs/stdio
> Also seeĀ http://llvm.org/bugs/show_bug.cgi?id=20815.

Thanks for pointing these out!

> The error reports look vaild: in general it's incorrect to load uint64_t, or
> even structures like "RawHeader" or "CoverageMappingTURecord" from a random
> address. Also, if you parse files stored on disk, it would certainly help to
> know endianness of data in these files and, e.g., use routines from Support/
> Endian.h. Can you take a look at this?

I've fixed the llvm-profdata failure in r217708. The file format has a
known endianness and is always padded to a proper alignment, so this is
just a matter of rejecting files that are malformed.

I'm a bit less familiar with the llvm-cov format, so I'll look into that
one and get it fixed in the next day or two.




More information about the llvm-dev mailing list