[llvm-dev] Fix for PR24155 on PPC

Evgenii Stepanov via llvm-dev llvm-dev at lists.llvm.org
Wed Oct 4 13:03:07 PDT 2017


Hi,

this is easier to understand by reading msan source in compiler-rt.
See MappingDesc, CheckMemoryLayoutSanity(), InitShadow().
Specifically, these constants must match the definitions of
MEM_TO_SHADOW and SHADOW_TO_ORIGIN.

Basically, you need to identify all possible memory addresses that may
be occupied by the time MSan is initialized. These are usually binary
and library mappings, main thread stack, etc. Think about different
modes like ASLR on/off, pie/no-pie, etc. All of these addresses, plus
the heap (see kAllocatorSpace, you control that) must belong to
MappingDesc::APP regions. See CheckMemoryLayoutSanity for other
constraints.

On Wed, Oct 4, 2017 at 8:34 AM, Nemanja Ivanovic
<nemanja.i.ibm at gmail.com> wrote:
> It would appear that the fix for https://bugs.llvm.org/show_bug.cgi?id=24155
> really only applies to X86. Which I suppose is fine since that's where the
> bug was reported.
>
> However, we've recently upgraded the OS's on some of our PPC64 systems and
> are hitting the same problems. I certainly wouldn't mind providing a similar
> fix for PPC, but I don't know what the values in MemoryMapParams mean nor
> what they should be set to.
>
> I am hoping that someone can explain to me what those mean and what they
> should be set to as well as how this relates to the kernel we're on.


More information about the llvm-dev mailing list